test(agc): enter whole quad mode in the implicit-LOD 1D sample test #3922

Merged
oneandonlydean merged 1 commit from upstream-pr/3922 into main 2026-10-11 19:45:56 +00:00
oneandonlydean commented 2026-10-11 19:10:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-11T19:10:37Z.


What

agc_driver_image_plane_address_on_line_implicit_lod, added by #3222, fails on lavapipe, so the Linux job has been red on main since that merge (first in run 38121052397; @orishamir reported it on #3222):

AGC graphics: image_sample 2d on a 1D texture with the first coordinate advancing 1 texels per pixel: pixel 20,0 component 0 is 170, expected 10

The cause is the test's pixel shader, not llvmpipe's sampler. Since #305 a pixel wave starts with only its covered pixels in EXEC, and the helper lanes of a partly covered quad join when the shader runs s_wqm. The test's shader never does. In a partly covered quad its helpers hold a zero coordinate, so the implicit LOD comes out as the last mip (mark 170).

Only llvmpipe gets partly covered quads here. The test's triangle reaches 3 in clip space, and llvmpipe clips it at twice the viewport and draws the result as three triangles. The wrong quads in @orishamir's map lie on the two inner edges, from the (-1,-1) corner towards (2,0) and (0,2). With the far vertices moved out to 5 there is one inner edge, towards (2,2), and the wrong quads follow it. With gl_HelperInvocation forced to false in the recompiled shader, every pixel reads the expected mip.

The shader now starts with s_wqm_b64 exec, exec (0xbefe0a7e). Title pixel shaders do the same: in the 90 captured programs I have that run s_wqm, it comes before the first implicit-LOD sample in every one, most often in this form.

#3418 gets the same test green by skipping its level checks on llvmpipe. With this change the checks run there too, so only one of the two is needed.

Tested

Linux, Release, CI's configure flags, main a11c8f7f against this branch (one commit on it).

  • Replica of the Linux job (Ubuntu 24.04 container, GCC 13.3, Mesa 25.2.8 llvmpipe LLVM 20.1.2, ANYPS5_REQUIRE_VULKAN=1 GALLIUM_OVERRIDE_CPU_CAPS=avx):
    • the test fails 3/3 on main with the message above and passes 5/5 with the change;
    • full ctest: 831/838 on main, 832/838 with the change. The six left are the same on both: agc_driver_emulated_color_compare (since #3438; #3532 fixes it), guest_kernel_stack_protect (#3459) and the four agc_driver_prepared_shaders* tests, which fail in this container (shader failure capture was incomplete) and pass in CI.
  • CachyOS, GCC 16.2.1, lavapipe from Mesa 26.2.3 (LLVM 22.1.8):
    • the test fails 3/3 on main and passes 5/5 with the change;
    • full ctest with the change: 837/838, only agc_driver_emulated_color_compare again.
  • RTX 4090 (610.57.04): the test passes 5/5 with the change.
  • With #3222's line in ResourceTracker.cpp put back to main's old form, the changed test still fails with image descriptor is incompatible with the static runtime image interface, as the original does.
  • tools/check_conventions.py --base origin/main passes.

Not tested: Windows, RADV.

Checklist

  • Based on current main; no other open PR implements the same functions
  • 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 in TechnicalDebt
  • 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. #3418 edits the same test for the same failure; merge one of the two.
  • AI-assisted: yes (Claude Code)
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4821591080 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3922). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-11T19:10:37Z. --- ### What `agc_driver_image_plane_address_on_line_implicit_lod`, added by #3222, fails on lavapipe, so the Linux job has been red on `main` since that merge (first in run 38121052397; @orishamir reported it on #3222): ``` AGC graphics: image_sample 2d on a 1D texture with the first coordinate advancing 1 texels per pixel: pixel 20,0 component 0 is 170, expected 10 ``` The cause is the test's pixel shader, not llvmpipe's sampler. Since #305 a pixel wave starts with only its covered pixels in EXEC, and the helper lanes of a partly covered quad join when the shader runs `s_wqm`. The test's shader never does. In a partly covered quad its helpers hold a zero coordinate, so the implicit LOD comes out as the last mip (mark 170). Only llvmpipe gets partly covered quads here. The test's triangle reaches 3 in clip space, and llvmpipe clips it at twice the viewport and draws the result as three triangles. The wrong quads in @orishamir's map lie on the two inner edges, from the (-1,-1) corner towards (2,0) and (0,2). With the far vertices moved out to 5 there is one inner edge, towards (2,2), and the wrong quads follow it. With `gl_HelperInvocation` forced to false in the recompiled shader, every pixel reads the expected mip. The shader now starts with `s_wqm_b64 exec, exec` (`0xbefe0a7e`). Title pixel shaders do the same: in the 90 captured programs I have that run `s_wqm`, it comes before the first implicit-LOD sample in every one, most often in this form. #3418 gets the same test green by skipping its level checks on llvmpipe. With this change the checks run there too, so only one of the two is needed. ### Tested Linux, Release, CI's configure flags, `main` a11c8f7f against this branch (one commit on it). - Replica of the Linux job (Ubuntu 24.04 container, GCC 13.3, Mesa 25.2.8 llvmpipe LLVM 20.1.2, `ANYPS5_REQUIRE_VULKAN=1 GALLIUM_OVERRIDE_CPU_CAPS=avx`): - the test fails 3/3 on `main` with the message above and passes 5/5 with the change; - full `ctest`: 831/838 on `main`, 832/838 with the change. The six left are the same on both: `agc_driver_emulated_color_compare` (since #3438; #3532 fixes it), `guest_kernel_stack_protect` (#3459) and the four `agc_driver_prepared_shaders*` tests, which fail in this container (`shader failure capture was incomplete`) and pass in CI. - CachyOS, GCC 16.2.1, lavapipe from Mesa 26.2.3 (LLVM 22.1.8): - the test fails 3/3 on `main` and passes 5/5 with the change; - full `ctest` with the change: 837/838, only `agc_driver_emulated_color_compare` again. - RTX 4090 (610.57.04): the test passes 5/5 with the change. - With #3222's line in `ResourceTracker.cpp` put back to `main`'s old form, the changed test still fails with `image descriptor is incompatible with the static runtime image interface`, as the original does. - `tools/check_conventions.py --base origin/main` passes. Not tested: Windows, RADV. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none. #3418 edits the same test for the same failure; merge one of the two. - [x] AI-assisted: yes (Claude Code)
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!3922
No description provided.