Skip to content

test(agc): skip the emulated color compare clamp cases without MinLod - #7058

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
seradavid:fix/agc-emulated-color-compare-lod-clamp
Oct 17, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
seradavid:fix/agc-emulated-color-compare-lod-clamp

Conversation

@seradavid

@seradavid seradavid commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

What

agc_driver_emulated_color_compare fails on a device without shaderResourceMinLod instead of skipping the cases that need it.

The offset cases compile OffsetCode, an image_sample_cb_cl_o. The emitter reaches the LOD clamp of that instruction only through the device's shaderResourceMinLod and refuses the shader without it (the gate #388 left in place), so every one of those cases failed, at the first of them, point, wrap with negative offsets. ImageSampleLodClamp and ImageSampleBiasA16 already skip what a device without the feature cannot run.

The test now reads CapabilityMinLod once and skips only the cases that compile OffsetCode: point, wrap with negative offsets, the three offsets, bias and LOD clamp cases, and the cached bilinear case with offsets. Every other case still runs, including the Reject for the native R32 float offset case, which is refused before the emitter and needs no guard. A closing note names the cases that were skipped.

Found on llvmpipe (Mesa 25.0.7, Debian 13 under WSL2); lavapipe reports the feature from Mesa 25.2.8, so CI runs all of the cases and the guard changes nothing there.

The skip is conservative: the guarded cases themselves pass on the same device when the emitter's capability check is moved to the branch that actually emits the MinLod image operand (the compute stage takes the explicit-LOD path, where the clamp is folded with FMax and no MinLod operand is emitted). That gate, not the color comparison emulation, is what asks for the feature; relaxing it is a separate question and is not part of this change.

#907 rewrites this test file and keeps the same offset cases, so the guard is needed after it too. That PR and this one overlap on those lines, and whichever lands second rebases; this change does not build on it.

Tested

Debian 13 under WSL2 (6.18.54.1-microsoft-standard-WSL2), GCC 14.2.0, Release, BUILD_TESTING=ON, lavapipe (llvmpipe), on both sides of the feature:

  • Mesa 25.0.7 (no shaderResourceMinLod): agc_driver_emulated_color_compare and its _srgb_decode variant failed before the change at point, wrap with negative offsets and pass after it, with the note that the offset and LOD clamp cases were skipped. Full ctest -j 8: 1339 tests, 0 failed, 63 skipped, 23 s.
  • Mesa 26.1.6 (mesa-vulkan-drivers 26.1.6-1~bpo13+1, installed from trixie-backports): both tests pass without the note, so the guarded cases run, and agc_driver_image_sample_lod_clamp passes instead of skipping. Full ctest -j 8: 1339 tests, 0 failed, 59 skipped (five tests that skip without the feature now run; agc_driver_f64_fma_subnormals skips on 26.1.6 where it passes on 25.0.7, on its documented f64 denormal path, unrelated to this change).

The image_sample and gather tests pass on both.

Not tested: a title; a GPU whose driver is not lavapipe. CI's lavapipe has the feature, so the guarded cases keep their coverage there.

Checklist

  • Based on current main; no other open PR implements the same functions (fix(agc): color compare emulation: review follow-up to #668 #907 rewrites this test file and overlaps the offset-case lines changed here, but does not add a capability guard; the guard is still needed after it)
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: lavapipe (llvmpipe) on Linux (WSL2), Mesa 25.0.7 and Mesa 26.1.6 (26.1.6-1~bpo13+1)
  • AI-assisted: yes

The offset cases compile `image_sample_cb_cl_o`, whose LOD clamp the emitter
reaches only through the device's `shaderResourceMinLod`; without it the
emitter refuses the shader (the gate boykopovar#388 left in place). The test had no
capability guard, so on such a device every one of those cases failed at the
first of them, `point, wrap with negative offsets`, instead of skipping them
as `ImageSampleLodClamp` and `ImageSampleBiasA16` already do.

Found on llvmpipe (Mesa 25.0.7, Debian 13), which lacks the feature that
lavapipe reports from Mesa 25.2.8: `agc_driver_emulated_color_compare` and
its `_srgb_decode` variant both failed. The other cases still run; the note
names the cases that were skipped.
@github-actions github-actions Bot added the agc libSceAgc* label Oct 17, 2026
@github-actions

Copy link
Copy Markdown

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.

Pull request Shared files not compared
PR 907 core/libs/prx/libSceAgcDriver/tests/execution/EmulatedColorCompare.cpp

@oneandonlydean
oneandonlydean merged commit d0270a1 into boykopovar:main Oct 17, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants