Doing my very first steps with Vulkan (basically following the steps in https://vulkan-tutorial.com/ to render the “magic” color triangle everybody starts with) I managed to do the needed calls to render and display the triangle (hurra…).
But I noticed something (at least to me) very surprising:
My card (a quite old GeForce GTX 670) allows me the swapchain image formats
-
eB8G8R8A8Unorm
-
eB8G8R8A8Srgb
-
eA2B10G10R10UnormPack32
The current code for rendering is even “more primitive” than given in the tutorial, I simply render and display the triangle once (as trigger I use a mouse click). All the code from creating the needed Vulkan stuff (instance, swapchain, …) to rendering to displaying is in a synchronous call and only fired “once”. Validation layer is enabled and seems happy with what I do (no messages).
With the 8 bit formats everything works as expected: Triangle is rendered, on rescaling or moving/obscuring the window the displayed content in the window gets destroyed or overwritten as you “would expect”.
But with the 10 bit format the content of the window is not overwritten when e.g. obscuring and then showing the window again. Even weirder, the output stays when resizing the window.
It gets stretched or shrinked accordingly, if I render the triangle on the window being small and then increase the size, artifacts on the borders clearly show, that there seems to be the rendered image “somehow still there” that is rendered onto the window on every repaint. So basically I end up with a window showing me the nice “three colored triangle” no matter what I do…🤣
(No idea if it is just a weird coincidence, that the 10bit color format shows that behaviour, but that is the “most educate guess” I have.)
This is especially astonishing to me as all Vulkan objects created when rendering/displaying are done as said in a synchronous call and released at the end of the call.
At least I assume so as I used the approach using “vk::Unique…” objects from vulkan.hpp on the stack only which run through the destructors at the end of the call for sure.
So “nothing” should still be active that is even able to render the triangle. Is this some weird quirk of my driver or is that to be expected?
I would really be curious if anyone knows an explanation for this…