danilw / vulkan-shadertoy-launcher

using C, no external dependencies
MIT License
72 stars 4 forks source link

Investigation broken visual presentation on the screen when window size small #2

Closed danilw closed 2 years ago

danilw commented 2 years ago

(just to track if it was my bug or GPU/drivers/Vulkan bug)

Bug - black lines (on Nvidia, on AMD just broken UV with random shifts): (this is not Linux only, same behavior on Windows) 1

No Validation errors or warnings, window size set on startup not resized bugged from startup.

RenderDoc capture: 2

On renderdoc capture - captured frame is "fine" as you can see on preview, but visual presentation is broken in actual window.

This how it supposed to look: 3

Progress: I have working code that does not have bug(that based on this my code), so now Im comparing code to see where is the source of bug.

danilw commented 2 years ago

Finally found reason: https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/4274

in my code I did this:

VkSwapchainCreateInfoKHR swapchain_info = {
...
.flags = VK_KHR_swapchain,
...

this is my mistake/error flags = 0, is fix

I think reason why I did it is: https://khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkSwapchainCreateFlagBitsKHR.html 2

VK_KHR_swapchain is on new line (visually), when it is "comment" and just drop down from comment. Maybe I was tired or something when I read this part and did not notice it is a comment, and somehow VK_KHR_swapchain ended as .flags parameter in my code. Big mistake.

danilw commented 2 years ago

Fixed by https://github.com/danilw/vulkan-shadertoy-launcher/commit/491d4d633c3168f847bb38965357751ff12f40bb