Repository navigation
fix(shader): allow constant-zero sRGB comparisons - #3532
Conversation
d74f660 to
12400d5
Compare
12400d5 to
9e8b5a2
Compare
|
I followed up on Ivica’s mode-matching observation from #3540. The comparison-only sRGB fallback now also adds matching |
|
Update before posting: this PR has advanced to I prepared a tested correction on top of this PR's The remaining problem in decoded.srgbDecode = !storage && !base.depthCompare && (srgbDecodeFormats & SrgbDecodeBit(format)) != 0u;
if (decoded.srgbDecode && !base.srgbDecodeCompatible) {
throw std::runtime_error("samples or gathers an sRGB image the device cannot sample, which is not implemented");
}This preserves #3438's existing zero-result semantics. The commit includes regression coverage for all 8 compare functions × point/bilinear × R8/RG8/RGBA8 sRGB, uncached and cached; cache-hit/variant assertions across UNORM → sRGB → UNORM; all four decode masks in runtime mode selection; mixed compare/sample and compare/gather refusals; and a forced-decode CTest. It preserves the current cube-wrap restriction. #3540 changes sRGB cube behavior separately, so its tests would need reconciling if that lands first. Validated on a locally managed Linux x64 runner: GCC 13.3, Release, Mesa 25.2.8 lavapipe (LLVM 20.1.2), SPIR-V Tools enabled. Seven focused executions passed, with zero CTest skips:
The run tested Focused tests can be reproduced after a Release build with: ctest --test-dir build --output-on-failure -R '^(agc_driver_(emulated_color_compare(_srgb_decode)?|image_srgb_load|runtime_images|graphics)|agc_shader_memory)$'
APS5_SRGB_SHADER_DECODE=1 ctest --test-dir build --output-on-failure -R '^agc_driver_runtime_images$'The logs are in private validation run 38139866682, workflow AI-assisted: yes (Codex). |
|
Thanks, jweidenh. I carried your tested commit I rebuilt the Release targets on current
CTest reported 6/6 passed with no test-level skips. Conventions and diff checks also pass. Hosted checks are rerunning on the updated head. |
|
Update: hosted checks finished on |
|
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.
|
|
Native Windows + NVIDIA run, the configuration #3526 was reported on:
With the PR the test creates all three 8-bit sRGB textures ( |
What
Fixes #3526. On devices that cannot sample an 8-bit sRGB view, a comparison-only sRGB descriptor was rejected during
decodeImageDescriptorbefore the emulated comparison could produce its measured constant-zero result.For comparison resources, the decoded descriptor now keeps
srgbDecodedisabled so its UNORM view matches the emulated comparison runtime mode. Ordinary unsupported sRGB sampling and gathering still throw, including when a descriptor is used for both comparison and ordinary sampling. The patch preserves the existing cube-wrap restriction; #3540 covers the separate 8-bit sRGB bilinear cube case.The regression coverage and implementation from jweidenh's tested commit
5377951care included with the original commit authorship preserved.Tested
agc_shader_memory_tests,agc_driver_graphics_tests,agc_driver_emulated_color_compare_tests,agc_driver_image_srgb_load_tests, andagc_driver_runtime_images_tests.agc_shader_memory,agc_driver_graphics,agc_driver_emulated_color_compare,agc_driver_image_srgb_load,agc_driver_runtime_images, andagc_driver_emulated_color_compare_srgb_decode(forced sRGB shader decode).python3 tools/check_conventions.py --base upstream/mainandgit diff --check upstream/main...HEADpassed.Checklist
main; no other open PR implements the same behavior