Repository navigation
Conversation
…disables degamma Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Real-AMD coverage — the sRGB-as-UNORM path (a sampler with DISABLE_DEGAMMA on an sRGB texture) holds across GCN5, RDNA2 and RDNA3.
The 1×1 texel (40, 120, 200, 255) comes back as the UNORM value through the point sampler for 8_8_8_8, 8 and 8_8 on all four. sRGB decode is a sampler-hardware behavior, so the clean GCN5 Wave64 pass — beyond your RX 6650 XT (RDNA2) run — confirms SKIP_DEGAMMA is honored the same way across the GCN→RDNA span. AI-assisted: yes |
|
Thanks for the GCN5, RDNA2 and RDNA3 runs. One distinction for whoever reviews this: the execution test goes through Vulkan after this change has already rewritten the sRGB T# to UNORM, so these runs show the rewrite samples correctly on those drivers, not how the hardware itself treats the S# bit. The hardware evidence for the bit is still the RX 6650 XT oracle measurement in the description (gfx1032 only); it is not measured on a PS5 or on GCN. AI-assisted: yes |
|
Correction to the title evidence in this PR's description. The PPSA02306 and PPSA02630 descriptors it cites (image words in buffer and sampler slots) appear to come from pixel programs the driver should not run (draws whose color write masks reach no formatted target); I have not traced each descriptor to its draw, but the stops disappear when those programs are skipped. With only #21747's one-line change to So these titles do not need this PR once #21747 is merged, and the description's "stops on it" no longer motivates it. What remains is the hardware behaviour this PR implements, measured as the description states; it applies only when a program really samples or loads through such a descriptor. I am leaving the PR open on that basis, and the maintainers may reasonably decide it is not worth the code without a title that needs it. AI-assisted: yes |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — changes requested
Changes are required before merge: remove or defer the earlier sRGB/disabled-degamma refusal so execution can reach the new materialization logic.
What I ran
Reviewed head 61b4473e2c5ab779761259d1e920965e821ca624 using the prepared diff and repo_read.py; no commands or tests were run.
Results
| Check | Result | Note |
|---|---|---|
| Diff and changed files | passed | Three changed files inspected |
| Runtime call path | passed | Earlier refusal remains active |
| Tests | not run | No test execution available |
Findings
Blocking
core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp:3009applies the descriptor rewrite during materialization, butShaderResources.cpp:5994still callsRequireDisablesDegammaOnwhile processing the guest texture and sampler.Sampler.cpp:171throws for this exact pairing, so the draw is rejected before it can reach the changed materializer. Remove or update that refusal for the supported cases, while retaining it for unsupported cases.
Non-blocking
None.
Not verified
Tests were not run. All three changed files listed in the manifest were included; source context was read for the materializer and the earlier refusal path. The prepared bundle does not provide a readable files.json, so additional file exclusions were not verified. PS5 behavior is not verified; the description reports RDNA2 measurements only.
To get this to a good state
Update the earlier refusal path to permit the supported direct sampled sRGB cases, then rerun the relevant tests.
|
Thanks for the review. I do not think the refusal is reached for the rewritten cases, because it runs on the materialized descriptor, not the guest's:
If you see a path where AI-assisted: yes |
|
Closing this as a duplicate of my own earlier #20728, which I should have found before opening it. DISABLE_DEGAMMA here is the same S# word 0 bit 31 that #20728 calls SKIP_DEGAMMA. #20728 covers more: it selects a UNORM view instead of rewriting the materialized format, handles the BC sRGB formats this PR leaves refused, keeps FORCE_DEGAMMA's precedence when both bits are set, and has a 70-mode gfx1032 measurement behind it. Reviewers should look at #20728 instead. The real-AMD runs above and the review discussion apply to this PR's approach only. As the comment above says, the PPSA02630 draws that motivated it appear to come from pixel programs #21747 skips. AI-assisted: yes |
What
A sampler with DISABLE_DEGAMMA (S# word 0 bit 31,
SKIP_DEGAMMAin Mesa's gfx10 register description) paired with an sRGB texture threwguest sampler descriptor disables degamma with an sRGB texture, which is not implemented(RequireDisablesDegammaOn). Destruction AllStars (PPSA02630) stops on it.The bit makes the hardware return the stored values of an sRGB texture without the sRGB-to-linear conversion, which is what the UNORM format of the same layout returns.
materializeDisabledDegamma(next tomaterializeForcedDegamma, which does the opposite for FORCE_DEGAMMA on RGBA8_UINT) rewrites a direct, sampled-only, non-comparison image of format 8_SRGB, 8_8_SRGB or 8_8_8_8_SRGB (128, 129, 130) to 8_UNORM, 8_8_UNORM or 8_8_8_8_UNORM (1, 14, 56) when every sampler it is paired with sets the bit. Mixed sampler states, the BC sRGB formats (unmeasured) and table images keep the guest format, so they still reach the existing refusal.Hardware measurement
tools/hw-oracleon an RX 6650 XT (gfx1032, RDNA2, Linux 7.2.14, hsa-rocr 10.1, clang 23.1.5; wave32, IEEE off, DX10 clamp on, denormals preserved, round to nearest even, FP16 overflow off). A 1x1 texel with bytes (40, 120, 200, 255),image_sampleandimage_sample_lzDIM 2D, point sampler00000092 00fff000 05500000 0, with and without bit 31:So with the bit, each sRGB format returns exactly what its UNORM format returns, and the bit does nothing on UNORM. This is an RDNA2 measurement, not PS5 evidence.
Tested
Linux 7.2.14, Ryzen 9 7950X, RX 6650 XT, RADV (Mesa 26.2.7), GCC 16.2.1, Release,
ANYPS5_ENABLE_SPIRV_TOOLS=OFF.agc_driver_image_disabled_degamma: draws a 1x1 texel (40, 120, 200, 255) through a point sampler for 8_8_8_8, 8 and 8_8. With the bit, the sRGB texture draws exactly what the UNORM texture draws, and the bit changes nothing on UNORM; without the bit the sRGB texture still decodes its data channels. WithmaterializeDisabledDegammadisabled the test fails with the originaldisables degamma with an sRGB texturerefusal.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code