Skip to content

D3D12: An sRGB Texture Keeps the Compression of Its Linear Twin - #475

Merged
dttdrv merged 1 commit into
mainfrom
placed-srgb-alias
Dec 5, 2026
Merged

dttdrv merged 1 commit into
mainfrom
placed-srgb-alias

Conversation

@dttdrv

@dttdrv dttdrv commented Dec 5, 2026

Copy link
Copy Markdown
Owner

A texture placed over its sRGB twin in a heap now reads what the twin drew, as it did before textures kept their lossless compression.

An sRGB texture that allows unordered access was made with Metal's pixel format view usage for uint clears, which its linear twin was not, so only the linear one kept its compression. No unordered access view is sRGB, so a uint clear always writes such a texture through a linear view, and the sRGB texture never needed the usage. Metal shows one texture's writes through another placed over the same memory only where the two agree on that usage: with it on one of them, nearly every texel reads wrong. D3D12 only promises shared contents for identical descriptions, but games rely on this pair, and vkd3d-proton's test_srgb_unorm_mismatch_usage_aliasing (from Assassin's Creed Shadows) covers it. That test passes again.

d3d12_alias_srgb draws through each twin of R8G8B8A8 and B8G8R8A8 and reads through the other, with unordered access on either twin, both or neither. It passes on native, 9, 8, 7 and their Metal 3 runs, and its fault patch is caught.

Related to #359.

An unordered access view is never sRGB, so a uint clear writes an sRGB
texture through its linear twin's format: judge the format view it needs
as the twin's. Aliased in a heap, the two then agree on compression,
which Metal needs to show one's contents through the other.
@dttdrv
dttdrv merged commit 5fc15c9 into main Dec 5, 2026
19 checks passed
@dttdrv
dttdrv deleted the placed-srgb-alias branch December 5, 2026 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant