CaffeineViking / vkhr

Real-Time Hybrid Hair Rendering using Vulkan™
MIT License
446 stars 34 forks source link

Does not work on Linux Nvidia driver #52

Open danilw opened 3 years ago

danilw commented 3 years ago

Linux Nvidia 750 Nvidia driver 455.45.01

1

I see a black screen and 1-2 FPS on Rasterizer Raymarcher and Hybrid Lod only on Ray Tracer, it renders a correct image

launching with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation output log.txt

CaffeineViking commented 3 years ago

Hey, thanks for reporting it @danilw! Quite curious, when I developed this it was on Linux and with a NVIDIA GPU. This was a few years ago, so it could be that drivers have regressed since then (or they've just gotten more strict...). I'll check this out if I have time.

Harrm commented 2 years ago

I've stumbled onto a similar issue, and after a short RenderDoc debugging session found out that the root of the problem is ImGUI -- if its overlay is turned off (I just commented out the corresponding code in the rasterizer), the image is rendered correctly. Continue investigating it, but I have zero experience with ImGUI so I'm not sure I'll have enough patience for it.

CaffeineViking commented 2 years ago

Hey, I was also able to reproduce this on my NVIDIA laptop after upgrading drivers. It doesn't happen on AMD or Intel though.

@Harrm I checked this a bit during my summer vacation and came to the same conclusion as you, that it's the ImGui rendering pass that's busted somehow. The PPLL composition and everything is completely fine, and the final image is also OK, but when ImGui render pass tries to compose on top of the final image it breaks. RenderDoc is kind enough to even write out what's the cause of the problem (I can't recall right now... but something about don't care image op). I tried fiddling a bit with this but I couldn't quite get it to work during the train trip (and I forgot about it until now lol). My current working theory is that final image results are being thrown away because of VK_ATTACHMENT_LOAD_OP_DONT_CARE and Vulkan validation layers seem to be telling me the same story. However, fixing that and adding correct transitions still wasn't enough, so no dice on an easy solution at least...