Skip to content

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

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
oneandonlydean:up4/fix-implicit-lod-test-wqm
Oct 11, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
oneandonlydean:up4/fix-implicit-lod-test-wqm

Conversation

@oneandonlydean

Copy link
Copy Markdown
Collaborator

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 a11c8f7 against this branch (one commit on it).

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. test(agc): skip the level checks of the implicit-LOD 1D sample test on llvmpipe #3418 edits the same test for the same failure; merge one of the two.
  • AI-assisted: yes (Claude Code)

A pixel wave starts with only its covered pixels in EXEC, so a shader that
takes an implicit LOD has to run s_wqm first or the helper lanes of a partly
covered quad hold no coordinate. The test's pixel shader did not, which goes
unnoticed while its one triangle covers every quad whole. llvmpipe clips that
triangle at twice the viewport into three, and in the quads on the two inner
edges the helpers' zero coordinate gave the last mip instead of the expected
one.

The shader now starts with s_wqm_b64 exec, exec, as a compiled pixel shader
that samples with an implicit LOD does.
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.

1 participant