Skip to content

shader: replace #3225 image descriptor work - #3349

Open
romn4rch wants to merge 7 commits into
R0Y00:mainfrom
romn4rch:copilot/pr-3225-review-11950081
Open

romn4rch wants to merge 7 commits into
R0Y00:mainfrom
romn4rch:copilot/pr-3225-review-11950081

Conversation

@romn4rch

@romn4rch romn4rch commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Change

Replacement for #3225: this PR carries the pixel-stage GFX10 image-descriptor size-field lowering and addresses the outstanding review feedback on descriptor-load provenance, swapped s_lshr_b32 operands, and views whose first mip is not resource mip 0. It adds regression controls for an s_load_dwordx16 upper image, overwritten descriptor words, and branched code, and registers the control test in the Windows PR CTest preset. The original #3225 remains open; updating its author-owned head failed with HTTP 403, so this is a separate replacement submission, not a request to merge or close either PR. Refs #3225.

Verification

Passed locally:

  • python -B tests/startup_gfx2hlsl_image_desc_word_check.py
  • python -B tests/startup_image_sample_l_check.py
  • python -B tests/startup_gfx2hlsl_cselect_descnum_check.py (includes expected negative-control mutant failures; check exits successfully)
  • python -B tests/startup_gfx2hlsl_load_desc_check.py
  • python -B tests/startup_gfx2hlsl_scalar_m0_check.py
  • python -B tests/startup_gfx2hlsl_image_get_lod_check.py
  • python -B tests/startup_tools_lint_check.py tools/startup
  • git --no-pager diff --check origin/main...HEAD

ctest --preset pr -N -R '^startup_gfx2hlsl_image_desc_word_controls$' reported Total Tests: 0: this worktree has no configured dev CTest build, so the registered CTest was not run locally. On this PR's commit, GitHub Actions currently has three jobs pending (Build and test on Windows, Assemble and translate gfx1013 fixtures, and Run platform-independent Python checks on Linux); Build and test on Windows at /O2 is skipped. GitHub reports mergeable=true, mergeable_state=blocked; the three pending jobs are the visible blocker.

Evidence and follow-up

The new controls extend the repository's source-built image-sample fixture with synthetic instruction encodings; no game files or external samples are used. Negative controls ensure nonmatching/unsafe descriptor reads remain refused. The behavior and reproduction command are documented in docs/experiments.md; local GPU draw validation was not run.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed.
  • I did not include game files, dumps, distribution links or secrets.

If this change was AI-assisted, say so in the description. Recent contributions follow this practice.

AI-assisted.

cursoragent and others added 7 commits November 27, 2026 23:31
A pixel stage can read the exact GFX10 width, height and 3D depth fields of an image descriptor as numbers. Other words and uses stay refused.

Fixes part of R0Y00#2022

Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com>
Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com>
A pixel size-field read uses the dimension of the descriptor load the
image instruction reads. Another load into the same SGPRs does not
borrow it. A copy of the sampled words still does.

Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com>
Resolved: tools/startup/gfx2hlsl.py (Pipeline SRV declarations: kept main's texcube entry and this branch's img_<component>_<kind> helper loop).
…-numeric

Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com>

# Conflicts:
#	tools/startup/gfx2hlsl.py
s_lshr_b32 of a size field lowers only when the descriptor word is the
value being shifted. A size-field SRV is marked imagedim, and the draw
path refuses that view when MostDetailedMip is not 0. Sampling a shifted
view that does not read a size field is unchanged.

Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@romn4rch romn4rch changed the title shader: pixel image descriptor review follow-up shader: replace #3225 image descriptor work Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants