Skip to content
This repository has been archived by the owner on Jul 29, 2021. It is now read-only.

Samples never deal with present queues different from rendering queue #266

Open
darksylinc opened this issue Nov 8, 2019 · 2 comments
Open
Assignees

Comments

@darksylinc
Copy link

Hi!

What the title says :)

According to Synchronization Examples and Google's samples it is possible the rendering queue does not support presentation; therefore a different queue must be used for presentation.

I don't know what GPUs out there require the code to handle this case, but it appears it must be dealt by the code. Maybe it's Optimus laptops, maybe it's Android devices that have a special queue for handling rotations.

@TonyBarbour TonyBarbour self-assigned this Nov 8, 2019
@TonyBarbour
Copy link
Contributor

If I remember correctly, back when we added separate queue handling into the cube demo, I couldn't find a device that has a graphics queue that didn't support present and I had to force it down that path to test the new code. But that was years ago, so things might have changed.

It looks like, in general, the samples address some of the issues with separate graphics and present queues. QueueSubmit is called with info.graphics_queue and QueuePresent is called with info.present_queue. I do see that image ownership of the swapchain image is not transferred between queues - is that what is missing? Anything else?

@darksylinc
Copy link
Author

Yeah, when having to deal with separate queues, image ownership transfer seems to be a requirement

Google's samples deal with this in:

https://github.com/googlesamples/vulkan-basic-samples/blob/master/demos/cube.c#L737

and

https://github.com/googlesamples/vulkan-basic-samples/blob/master/demos/cube.c#L1013

They use an additional semaphore because when the queue is the same, present just waits for the graphics submission to end. However when two queues are used, they use another vkQueueSubmit (I don't see why they couldn't be merged into the same queue with a pipeline barrier, but Google's way is probably more flexible if we consider two queues an edge case) and the present must wait for the second vkQueueSubmit that handles the ownership change.

So there's two things: The samples need two variables (one for the graphics queue, another for the present queue; which may or may not be set to the same value), and ownership transfer.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants