# glFlush + glFenceSync not work correctly

**URL:** <https://forums.imgtec.com/t/glflush-glfencesync-not-work-correctly/1894>\
**Category:** PowerVR Insider\
**Created:** [September 11, 2013, 5:51am UTC](https://forums.imgtec.com/t/glflush-glfencesync-not-work-correctly/1894 "2013-09-11T05:51:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rory\_yin](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@rory\_yin](https://forums.imgtec.com/u/rory_yin)\
**Post date:** [September 11, 2013, 5:51am UTC](https://forums.imgtec.com/t/glflush-glfencesync-not-work-correctly/1894/1 "2013-09-11T05:51:00Z")

</div>

i am trying to use glFlush + glFenceSync to alternate glFinish, but it seems that this doesn’t work.  
  
my code looks like follow:  
  
  
  
while(1) {  
  
glDrawArray();  
  
sync = glFenceSyncAPPLE(GL\_SYNC\_GPU\_COMMANDS\_COMPLETE\_APPLE, 0);  
  
enqueueSync(sy nc);  
  
glFlush();  
  
  
  
sync = getSyncQueueHeader()  
  
glGetSyncivAPPLE(sync, GL\_SYNC\_STATUS\_APPLE, 1, NULL, status)  
  
if (status == GL\_SIGNALED\_APPLE) {  
  
dequeueSync();  
  
dosomethingelse()  
  
}  
  
}  
  
  
  
i am not sure if my code is alright or just i need some more time to get my signal after glFlush? thanks!

---

<div class="post-metadata">

**Author:** ![tobias](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@tobias](https://forums.imgtec.com/u/tobias)\
**Post date:** [September 23, 2013, 8:10am UTC](https://forums.imgtec.com/t/glflush-glfencesync-not-work-correctly/1894/2 "2013-09-23T08:10:11Z")

</div>

Hi Rory,  
  
  
  
Using the EGL version of this functionality works on our drivers to do this at least in all the tests I’ve done myself - unfortunately the fence syncs you’re using are specific to Apple’s version of the drivers. If you’re encountering a problem with these functions I’m afraid you’ll have to get in contact with Apple directly, as we won’t be able to help.  
  
  
  
Regards,  
  
Tobias
