0
$\begingroup$

I'm working on an engine for Win32 exclusively. Can I safely assume that the flag VK_PRESENT_MODE_FIFO_KHR will always generate 2 and only 2 images for the swapchain?

$\endgroup$

1 Answer 1

1
$\begingroup$

There is nothing in Vulkan which guarantees or requires this. So even if it were a safe assumption today (if it were enforced by Windows in some way), all it would take would be one Windows update to break you.

It's best to work with what you're given, even if what you're given may be more than you would prefer.

$\endgroup$
4
  • $\begingroup$ I find it hard to believe that there's no explicit way to have double-buffering. Uh, bad news then. I liked when my arrays had a fixed size. $\endgroup$
    – unknown
    Feb 1, 2018 at 17:01
  • $\begingroup$ @demanze: Vulkan exists to tell you how the hardware works and for you to interface with it. What you do with that information is up to you. If a hard FIFO implementation has a maxImageCount of 1, then you can create your own image to serve as a second buffer for a double-buffering system. Or you can just fail to have your application work, as hard FIFO with only 1 presentable image makes it pretty much impossible to present images on every vblank, no matter how fast you render. $\endgroup$ Feb 1, 2018 at 17:09
  • $\begingroup$ @demanze: If you want 2 presentable images, and the implementation supports 2 presentable images, then you can ask for 2 presentable images. Now it might give you more than that, but it will never give you less. $\endgroup$ Feb 1, 2018 at 17:10
  • $\begingroup$ No, I didn't mean that I was afraid there would be only 1. I'm actually scared one implementation could give me 3 or more. In my current prototype, I have an array of size 2 (for pointers to images/imageViews/framebuffers apart of the Swapchain). Now, I could put a maximum of 16 or 64 and keep a fixed sized array but I would rather have a way to have always 2 with the spec backing me up somewhere. :) $\endgroup$
    – unknown
    Feb 1, 2018 at 17:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.