Repository navigation
feat(agc): accept samplers that force sRGB decoding of sRGB textures - #1487
Merged
adriadam10 merged 2 commits intoOct 10, 2026
Merged
Conversation
This was referenced Oct 8, 2026
Merged
Contributor
|
Tested on AMD under Linux, since this PR wasn't: RX 9070 XT (RDNA4, GFX1201), RADV / Mesa 26.2.4, Linux 7.2.9 (CachyOS), GCC Release build.
AI-assisted: the runs and this write-up were done by Claude (Claude Code) on my machine. |
Celegans12
force-pushed
the
feat/agc-forced-degamma-srgb
branch
from
October 8, 2026 14:52
dc182f2 to
f6c5d4e
Compare
This was referenced Oct 8, 2026
9 tasks done
Celegans12
force-pushed
the
feat/agc-forced-degamma-srgb
branch
from
October 9, 2026 02:10
f6c5d4e to
e7d313b
Compare
9 tasks done
A sampler with FORCE_DEGAMMA (S# word 0 bit 20) threw at decode, so every dispatch or draw sampling through one was skipped. DecodeSamplerResource now records the bit, but accepts it only for a caller that pairs the sampler with its images. The direct sampler binding does, and RequireDegammaFormat checks each sampled image against its paired samplers: only already sRGB formats (8, 8_8 and 8_8_8_8 SRGB, BC1, BC2, BC3 and BC7 SRGB) pass, decoded once, as shadPS4 (PS4) models it. Other textures and unpaired decodes still throw; gfx10 behaviour is not measured.
Co-Authored-By: Claude <noreply@anthropic.com>
Collaborator
|
Rebased onto current
Merging once CI is green. |
adriadam10
force-pushed
the
feat/agc-forced-degamma-srgb
branch
from
October 9, 2026 23:52
e7d313b to
ec2df26
Compare
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
|
9 tasks done
SleglJan
pushed a commit
to SleglJan/AnyPS5
that referenced
this pull request
Oct 10, 2026
…gamma-srgb feat(agc): accept samplers that force sRGB decoding of sRGB textures
This was referenced Oct 11, 2026
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.
What
A sampler with
FORCE_DEGAMMA(S# word 0 bit 20) throwsguest sampler descriptor forces sRGB decoding which is not implementedat decode. This is the direct-sampler part of the earlier version, now onmainwithout #757; the image table check follows once #757 lands.DecodeSamplerResourcerecords the bit asforceDegamma(host sampler unchanged) and accepts it only for callers that pair the sampler with its images (forceDegammaPaired, also onSamplerCache::Get).RequireDegammaFormatlets only sRGB textures (8, 8_8, 8_8_8_8, BC1/2/3/7 SRGB;IsSrgbTextureFormat) through such a sampler, sampled as before, so decoded once.8_SRGB,8_8_SRGBand8_8_8_8_SRGBsample bit for bit the same with and without FORCE_DEGAMMA, point and bilinear. Forcing UNORM8,8_8and8_8_8_8decodes per texel before filtering, contrary to the older GPCS4/fpPS4 notes; this PR still throws for those formats. BC sRGB formats remain unmeasured (measurement).Tested
mainf145139: configure-DBUILD_TESTING=ON, full build,--target libs,ctest:ctest --output-on-failure)mainf145139: 498/498 pass; the sampler tests also pass on Windows lavapipe (Mesa 26.2.4)agc_driver_image_sample_force_degamma: a forcing S# samples 8_8_8_8_SRGB bit for bit as a plain one (point, bilinear); UNORM throws. It fails onmain(guest sampler descriptor forces sRGB decoding which is not implemented).agc_driver_graphics: decode, unpaired refusal on a cache miss and hit,IsSrgbTextureFormat.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)