-
Notifications
You must be signed in to change notification settings - Fork 452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handling of SRGB vertex formats is confusing #2214
Comments
Thanks for your feedback! We'll have a look at this, it does seem that treating it as UNORM is what the spec states, we're having a look at our options and will let you know when we figure what we want to do. |
does it? I've tried a bunch of implementations on desktop and I've found no driver that supports RGBA8_SRGB vertex buffers.
Looking at RADV source, there's an explicit "if srgb return false" in VBO feature query. |
Tried looking at CTS for this and there is |
I was going off https://vulkan.gpuinfo.org/listdevicescoverage.php?bufferformat=R8G8B8A8_SRGB&featureflagbit=VERTEX_BUFFER&platform=linux for that one, the only one I've actually confirmed support for is MoltenVK Edit: Looking more closely, it looks like it's only actually supported by some older version of RADV, which makes it show up in the list even though newer drivers don't support it. And yeah, that's the test that seems to verify that |
Found the snippet that generates GLSL and UNORM and sRGB have the same code. There is no sRGB curve applied to verification here, so I think the CTS intends for sRGB to be decoded as UNORM for attributes, indeed.
|
Section 21.3.1 of the spec makes no mention of running an sRGB to linear conversion for SRGB formats. The CTS seems to take this as an indication that SRGB vertex formats should be treated identically to UNORM formats. MoltenVK and RADV both support SRGB vertex buffers, and I assume have implemented them in this way (confirmed for MoltenVK).
On the other hand, the VkFormat description makes no mention of this special handling, and states that the formats are all "stored with sRGB nonlinear encoding". In addition, I think most people would expect that the same color data with the same format would come up the same regardless of whether you loaded it from a texel buffer or a vertex attribute.
I think one of the following changes would improve clarity:
The text was updated successfully, but these errors were encountered: