KhronosGroup / Vulkan-Samples

One stop solution for all Vulkan samples
Apache License 2.0
4.36k stars 648 forks source link

Multisampling and sRGB issue #1182

Closed matteomeli closed 3 days ago

matteomeli commented 1 month ago

I have noticed some issues with the resulting displayed colours of the MSAA sample. When I select MSAA from the drop down list (any sample count) the scene appears much darker. If I choose no MSAA instead, the scene appears much brighter, looking correct.

With MSAA: image

Without MSAA: image

This is on my laptop with an AMD Radeon RX 7700S (discrete), but it also happens with the integrated chip AMD Radeon 780M.

I wrote a much simpler program to just load a texture onto a quad, and I can reproduce the same issue. If I load the texture and create its view with VK_R8G8B8A8_SRGB format, then, if multisampling is enabled, it appears much darker. With multisampling enabled, f I load it with VK_R8G8B8A8_UNORM, then it will appear fine. But if I then disable multisampling, it appears very bright.

On my desktop (Intel UHD Graphics 630 and NVIDIA GeForce RTX 2080 SUPER), the issue doesn't reproduce at all, again with either card.

Any idea what's going on? Is it a known driver issue about multisampling and sRGB on AMD cards?

Driver details are: AMD Software Adrenaline Edition Version: 23.40.18.02 AMD Windows Driver Version: 31.0.24018.2001

SaschaWillems commented 1 month ago

If you can reproduce this in a simple app, it's most probably a driver issue and nothing we can fix.

Sample looks and works fine for me on an RTX 4070 and a Google Pixel 4a.

matteomeli commented 1 month ago

Yeah was worried it could be that.

Have you tried, or could you try, the sample on AMD GPU?

jeroenbakker-atmind commented 1 month ago

I tried on an M2 and a Arc and was not able to reproduce. I can test AMD early November

mdrost commented 3 weeks ago

I am just following Vulkan Tutorial and probably encountered the same problem.
Code from Generating Mipmaps chapter gives me normal colors: obraz Code from Multisampling chapter gives me darker colors: obraz If for Multisampling chapter I change VK_FORMAT_R8G8B8A8_SRGB to VK_FORMAT_R8G8B8A8_UNORM then colors are fine.
The same change for Generating Mipmaps chapter gives brighter colors: obraz

I am using Windows 11 with AMD Ryzen 7 7800X3D and AMD Radeon RX 7900 XTX.
Driver Version: 24.10.29.01-240714a-406784C-AMD-Software-Adrenalin-Edition
AMD Windows Driver Version: 32.0.11029.1008

SaschaWillems commented 3 weeks ago

Can you open an issue with your GPU vendor? Most probably nothing we can fix on our side.

marty-johnson59 commented 3 days ago

Hi @matteomeli, we're closing this as it appears to be a vendor bug - please reopen if this is not the case. Thanks!