You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm getting some rendering issues with the code in this repo. I lack the vocabulary to describe it properly so I've attached some screenshots and a video recording (see below).
I've done a lot of debugging but haven't been able to find a cause (unless it's a driver bug, which seems unlikely but not impossible). As a beginner with Vulkan, I don't know where else to go with my investigations. I'm hoping someone here with more experience will recognise the issue.
Everything shown below is running on the main branch of this repo, with no changes aside from to CMakeLists.txt to allow compilation on my system.
The issue appears to be deterministic -- every run of the programs shows the same pattern of glitchy fragments with the wrong colour.
The pattern of glitchy fragments changes with zoom, rotation and window size.
The glitchy fragments are generally stable frame-to-frame, but by rotating the models and resizing the window I can find ones that flicker (appear/disappear rapidly).
The incorrect colour appears to come from elsewhere in the image -- the colour is either black (from the background), or blue/green/brown (from the Suzanne models).
The issue is present when running as a native Wayland window or under X11 compatibility (Xwayland).
Compiling with GCC and clang gives the same result.
Investigations
Vulkan validation layers reported no issues, including when GPU Assisted Validation was enabled.
Tried various RADV_DEBUG environment variable flags (nodcc, nodisplaydcc, nofastclears, nohiz, llvm) but none had any effect on the issue.
Enabled back-face culling (set .cullMode = VK_CULL_MODE_BACK_BIT, .frontFace = VK_FRONT_FACE_COUNTER_CLOCKWISE on rasterizationState). No effect.
Captured frames in RenderDoc and inspected the pixels with the wrong colour in the Texture Viewer, which showed that:
the correct colour for the fragments were computed by the fragment shader (shown as 'Shader Out' in RenderDoc);
if there was more than one fragment per pixel, the correct fragment passed the depth test;
the wrong colour was written to the final pixel, and it appears to come from a fragment that fails the depth test (although when back-face culling is enabled, there's only one fragment per pixel and the wrong colour appears to come from nowhere).
Example 1 -- pixels in the white part of the Suzanne model's eye are incorrectly coloured black:
Example 2 -- blue fragments appear on top of the brown Suzanne model. The fragment shader's output colour is correct (brown) but the colour written to the texture is blue. (Although the blue fragment fails the depth test, there shouldn't be any blue fragments at that position because there's zero overlap with the blue Suzanne model on the left. Interestingly, the blue model on the left has some incorrect brown pixels on it, like the colours from each model have swapped places.)
Example 3 -- same as example 2 but with back-face culling enabled, showing that the fragment shader outputs the correct colour for the single fragment at that pixel, but the final colour written to the texture is wrong and appears from nowhere:
This bizarre behaviour seems to point towards a driver bug or a hardware issue, but with the major caveat that no other applications or games on my system have any issues, including complex games running under dxvk/Proton. I've also considered issues like the depth texture or swapchain images having the wrong sizes, but everything looks correct in the code.
I'll try to get this code running on Windows on the same machine to confirm if the behaviour is the same. Edit: runs on Windows on the same hardware without issues (Vulkan 1.4.315, compiled with Visual Studio).
I'm getting some rendering issues with the code in this repo. I lack the vocabulary to describe it properly so I've attached some screenshots and a video recording (see below).
I've done a lot of debugging but haven't been able to find a cause (unless it's a driver bug, which seems unlikely but not impossible). As a beginner with Vulkan, I don't know where else to go with my investigations. I'm hoping someone here with more experience will recognise the issue.
Everything shown below is running on the main branch of this repo, with no changes aside from to
CMakeLists.txtto allow compilation on my system.System info
Selected device: AMD Radeon RX 6800 XT (RADV NAVI21)Vulkan Instance Version: 1.4.341(fromvulkaninfo)The issue
screenrecording-2026-03-30_21-08-47.mp4
Investigations
RADV_DEBUGenvironment variable flags (nodcc,nodisplaydcc,nofastclears,nohiz,llvm) but none had any effect on the issue..cullMode = VK_CULL_MODE_BACK_BIT, .frontFace = VK_FRONT_FACE_COUNTER_CLOCKWISEonrasterizationState). No effect.Example 1 -- pixels in the white part of the Suzanne model's eye are incorrectly coloured black:
Example 2 -- blue fragments appear on top of the brown Suzanne model. The fragment shader's output colour is correct (brown) but the colour written to the texture is blue. (Although the blue fragment fails the depth test, there shouldn't be any blue fragments at that position because there's zero overlap with the blue Suzanne model on the left. Interestingly, the blue model on the left has some incorrect brown pixels on it, like the colours from each model have swapped places.)
Example 3 -- same as example 2 but with back-face culling enabled, showing that the fragment shader outputs the correct colour for the single fragment at that pixel, but the final colour written to the texture is wrong and appears from nowhere:
This bizarre behaviour seems to point towards a driver bug or a hardware issue, but with the major caveat that no other applications or games on my system have any issues, including complex games running under dxvk/Proton. I've also considered issues like the depth texture or swapchain images having the wrong sizes, but everything looks correct in the code.
I'll try to get this code running on Windows on the same machine to confirm if the behaviour is the same.Edit: runs on Windows on the same hardware without issues (Vulkan 1.4.315, compiled with Visual Studio).I'm happy to provide more details on request.