Repository navigation
Fix sRGB filtering in GenerateMips - #449
Merged
Chuck Walbourn (walbourn) merged 1 commit intoNov 7, 2026
Merged
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Collaborator
|
Thanks for your contribution. I need to get some additional hardware to validate this on different platforms, but I'll pick it up when I can. |
Contributor
Author
|
Got it. Thanks for the review! |
Collaborator
|
I see that this converts the input sRGB to linear for the filtering, but where does it convert the result back to sRGB? |
Contributor
Author
Collaborator
|
OK, sorry. I see that you are converting the linear result to sRGB there. I'm trying to see where you convert the sRGB input to linear for the filtering... |
Collaborator
|
/azp run |
|
Azure Pipelines: No pipelines were found matching this branch/path. |
Contributor
Author
|
The SRV is configured as DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, so SrcMip.SampleLevel(Sampler, uv, SrcMipIndex) automatically decodes RGB to linear in hardware? |
Collaborator
|
Awesome. Thanks! I'll try it out... |
Collaborator
Collaborator
|
Note the MinGW failures are a known issue. I'll be fixing the headers problem via vcpkg next week. |
Chuck Walbourn (walbourn)
approved these changes
Nov 7, 2026
Chuck Walbourn (walbourn)
merged commit Nov 7, 2026
f3555e3
into
microsoft:main
213 of 245 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Hi, I try to fix #142.
My approach uses a typeless intermediate texture with an sRGB SRV and a UNORM UAV. The sRGB SRV decodes each texel before filtering, so filtering takes place in linear space. The compute shader then encodes the filtered RGB values back to sRGB before writing through the UNORM UAV. Alpha retains the existing linear behavior.
Local tests passed on RTX 5080 and WARP, covering different colors, texture sizes, and multiple mip levels. The repository’s clang-format check also passed.