realitix / vulkan

The ultimate Python binding for Vulkan API
Apache License 2.0
505 stars 46 forks source link

Application unresponsive under Linux without vkQueueWaitIdle call #55

Closed stephane-13 closed 5 years ago

stephane-13 commented 5 years ago

When I run the program under Linux, the window is unresponsive and the whole screen is freezing intermittently. Adding an extra call to vkQueueWaitIdle( presentation_queue ) at the end of the draw_frame() function solves the issue. Is that something expected?

realitix commented 5 years ago

Hello,

What program are you running ?

stephane-13 commented 5 years ago

I'm running example/example_sdl2.py. I think my issue is due to vsync being enabled (enforced) at the driver level. The program, without vkQueueWaitIdle calls, hammers the rendering pipeline too fast.

realitix commented 5 years ago

Ok @stephane-13. Did you find a way to fix this ?

If not, I will update the test with a Wait for each loop.

stephane-13 commented 5 years ago

Yes, as I mentioned above, I had to add a call to vkQueueWaitIdle at the end of the draw_frame() function to limit the number of frames submitted to the rendering pipeline.

I assume that when vsync is enabled, the frames are sent too quickly (i.e. faster than 60Hz in my case) and the vkQueueWaitIdle call ensures that the previous frame has been processed before sending the next one.

realitix commented 5 years ago

I fixed it. When I add the wait, I move from 6000FPS to 5000FPS but for this test it's not a problem.