-
Notifications
You must be signed in to change notification settings - Fork 475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not clear how many swapchain images should application want #1137
Comments
@stonesthrow assigned to SI. |
All the above taken into account, the intent is not that the spec dictate an ideal number of images to the application. No such universal logic was known (or is known now, that I'm aware of) such that we could bake hard advice into the spec via notes or requirements. Instead, we left it as a 3-step dance where the implementation could provide a minimum spec, the application could provide its minimum spec, and ultimately the implementation could again add additional images as necessary. For example, do deal with a poor platform that for whatever reason required blocking in vkAcquireNextImage(), the implementation could report an additional image itself or allocate one more image than the application requested. It's true the app doesn't have similar options due to lack of visibility, but the more complicated the mechanism becomes, the more likely it is to be misused on either side. Hence, I'm going to close this. If there are specific issues you'd like to spin out of the above 7 points/responses, please file separate targeted issues and/or propose spec or API changes. |
Ok, this is not clear from the spec. For usual app where the acquire and present is in 1:1 pairs, technically only I mean even |
Linking to: #1158 |
The current API makes it somewhat fundamentally unclear to applications how many swapchain images they should want.
That can be bit of a problem, because too little could lead to bad perf. Too many is waste of memory.
I just wonder if there is a room for improvement here.
Things that seem contributing to the problem:
With
minImageCount
it is not clear if the count includes some internal PE buffers the application might never get, or not. This is somewhat important to guess the performance behavior. Some people still operate under "double buffering", "tripple buffering" terminology; which is hard to map to here if it is unclear how many actual buffers are there in the first place.Swapchain can create more images anyway. I mean after all that boilerplate querying stuff, the swapchain creation will do whatever it wants anyway?
Some drivers feel like they are inflating
minImageCount
above the count that is absolutely neccesary, to coax apps into picking the "right" count. Other drivers might not be so "kind".minImageCount
does not depend on presentation mode (and possibly other stuff), which could influence the nature of the value.It is not clear upront if the driver subscribes to the
vkAcquireNextImage
Semaphore mechanic, or if it blocks the call. (If it has blocking semantic, I would possibly want an extra image.)Only
numImages - minImageCount + 1
are acquirable. But per spec it seems allowed to get more on some drivers. (And it is not clear upfront if driver will behave that way. Which in some cases could be good enough, and reduce the number of swapchain images needed.)I think
vkQueuePresent
is technically allowed to block. Which then makes asking for more than one image pointless. (And it is not clear upfront if driver will behave that way.)There are only so many PEs. I wonder if better abstraction could be made. Or perhaps an extension covering only the "sane" subset. Or at least possibility for app to query as much as possible about the behavior of the PE, to be able to start making some educated guesses without trial and error.
The text was updated successfully, but these errors were encountered: