When resizing the window, there's a race condition between the
validation of vkCreateSwapchainKHR's arguments and the actual
size of the window.
This ignores the validation warning when vkCreateSwapchainKHR succeeds.
On some graphic drivers vkAcquireNextImage and vkQueuePresentKHR
may return VK_SUBOPTIMAL_KHR. This is being handled as an error, which
leads to those frames being unnecessarily skipped.
Because example 42 was using the shaders from example 07 (callback), which have
input vertex attributes position and color, while the mesh from example 42 has
attributes position and normal, this causes problems on Windows when using
AMD gpus (no bunny mesh would appear on the window).
The glsl function findMSB is overriden, causing an error on Windows and Linux
when running on AMD or Intel gpus. Nvidia, for whatever reason, seems to allow
overriding the function.
When compiling shader cs_gdr_stream_compaction.sc on GCN 1.0 gpus
the following error appears:
Compute link error: HW_UNSUPPORTED.
ERROR: Internal compile error, error code: E_SC_NOTSUPPORTED
Shader not supported by HW
These changes avoid the error.
* Improves handling of window resizes on vulkan (avoids crashes)
* Change to previous commit as requested.
Rebased and added refresh swapchain check inside updateResolution(),
similar to renderer_d3d12.cpp.
On some platforms (Windows) the framebuffer size becomes 0x0 when
the window is minimized. This leads to a validation error and
subsequently crashes.
This change correctly cleans up semaphores and the swapchain.