Repository navigation
fix(agc): sample formats that FORCE_DEGAMMA leaves unchanged without it - #8069
Merged
oneandonlydean merged 1 commit intoOct 21, 2026
Merged
oneandonlydean merged 1 commit into
oneandonlydean merged 1 commit into
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
This was referenced Oct 19, 2026
Contributor
|
NVIDIA and AMD iGPU runs of Windows 11 Home 26300, WinLibs GCC 15.2.0, Release,
AI-assisted: yes (Claude Code); results above were run on this machine. |
This was referenced Oct 19, 2026
12 tasks done
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) makes
mainrefuse every texture that is not sRGB and has no sRGB view, for example a 32-bit float texture:On an RX 6700 XT the bit changes only 8-bit-per-channel formats. I measured it through the hardware oracle's HIP path (scripts and tables): a 64x1 linear texture, each lane reads its own texel at its centre (point) and halfway to the next one (bilinear), with two random fills, so 512 component values per format and mode:
8,8_8and8_8_8_8with the bit read bit for bit as8_SRGB,8_8_SRGBand8_8_8_8_SRGB, asmainalready samples them (through an sRGB view);8,8_8and8_8_8_8with the bit read bit for bit as those sRGB formats over the same bytes;16,16_16and16_16_16_16UNORM, SNORM and FLOAT (guest formats 7, 8, 13, 23, 24, 29, 65, 66, 71),32,32_32and32_32_32_32FLOAT (22, 64, 77),10_11_11FLOAT (36),2_10_10_10UNORM (50),5_9_9_9FLOAT (132),5_6_5,1_5_5_5and4_4_4_4UNORM (133, 134, 136), and BC4, BC5 and BC6H, unsigned and signed (175 to 180). The sRGB formats 128 to 130 do too.ForcesDegammaOnnow leaves the formats of the last item to their plain view, as if the bit were clear. SNORM8,8_8and8_8_8_8(they would need an sRGB view of an SNORM image) and formats I did not measure still throw. The FORCE_DEGAMMA debt entry is cut to what is still open.Tested
Windows 11 26200, AMD Radeon RX 6700 XT (gfx1031), driver 32.0.21045.5002, WinLibs GCC 15.2.0 r7, Release,
BUILD_TESTING=ON, onmain585075cb7. The runs useVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation(Vulkan-ValidationLayersvulkan-sdk-1.4.363.0, built locally),ANYPS5_NO_SHADER_CACHE=1,ANYPS5_REQUIRE_VULKAN=1andctest -V, with the implicit overlay layers on this PC switched off (VK_LOADER_LAYERS_DISABLE=~implicit~); no log reports the layer as not found.agc_driver_image_sample_force_degammano longer expects guest format 22 (32_FLOAT) to be refused. It now requires a point sample of32_FLOATand of BC4 UNORM through a FORCE_DEGAMMA sampler to equal, bit for bit, the sample without it, and it expects8_8_8_8_SNORM(guest format 57) to be refused instead.agc_driver_graphicschecks the list:IgnoresForcedDegammaholds for 7, 13, 22, 36, 50, 77, 132, 133, 175 and 179, and not for 1, 2, 14, 15, 56, 57, 128, 130, 169, 171, 173 and 181 (8-bit UNORM, SNORM and sRGB formats, and BC1, BC2, BC3 and BC7 UNORM).VUID-errors.Sampler.cppline reverted,agc_driver_image_sample_force_degammafails:a texture of guest format 22, which is not sRGB and has no sRGB view, is sampled through a sampler that forces sRGB decoding, which is not implemented. NoVUID-errors.main8c9161eacwith its own version of both tests: they pass, with noVUID-errors.python tools/check_conventions.py --base origin/mainwith this title and body passes.python tools/pr_overlap.py --branch fix/force-degamma-unchanged-formatslists feat(agc): read sampler border colours from the border colour table #6804, which adds a debt entry on the line above the FORCE_DEGAMMA entry, and fix(agc): give a block-copied BC texture an sRGB view for FORCE_DEGAMMA samplers #7799 (its pushed head no longer touches the debt file); the rest are pull requests that conflict withmainand share only the debt file, plus fix(shader): emulate sRGB sampling when unsupported #5371, which edits the same test file for its R8 and RG8 sRGB fallback.main9127ea36don an NVIDIA RTX 5070 Ti (driver 617.42) and an AMD Radeon iGPU (RDNA2,1002:13c0, AMD proprietary driver 2026.04.17), Windows 11 Home 26300,ANYPS5_REQUIRE_VULKAN=1:agc_driver_image_sample_force_degamma,agc_driver_graphicsand the other related tests, 16 in all, pass on both, and withSampler.cppback tomainagc_driver_image_sample_force_degammafails on both with the message above. On WSL Ubuntu 24.04 with llvmpipe (Mesa 25.2.8), with this and six other PRs merged, 61 of the 62 related tests pass; the other fails on a WSL write-watch limit.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)1002:13c0), AMD proprietary driver 2026.04.17, Windows 11 Home 26300; llvmpipe (Mesa 25.2.8), WSL Ubuntu 24.04🤖 Generated with Claude Code