startup: pixel-stage resource-heap image record in gfx2hlsl (translator and manifest) #2761

Closed
github-bot wants to merge 2 commits from gh-pr/2761/head into gh-pr/2761/base
Owner

@⁠tedin7 on GitHub · 2026-11-26 06:32 UTC · original
tedin7:x2w-ps-heap-image → main · +110 −10 · 4 files · 2 commits · closed without merging

Part of #1723

What this unblocks: a pixel program that loads an image descriptor through the resource heap (s_load_dwordx8 at index << 5) now translates, with the record named in the manifest instead of refused. The translator and manifest only: the draw-time binding of that record is a separate slice, so no draw uses it yet.
Source: AMD "RDNA 2" Instruction Set Architecture reference guide, SMEM instruction S_LOAD_DWORDX8 (image resource descriptor load); Microsoft DirectX-Specs, D3D12 resource binding specification, descriptor heaps.

What changed (tools/startup/gfx2hlsl.py):

  • heap_record now serves the pixel stage: eight dwords (the image record) there, four (the buffer record) in compute. Other widths and the vertex stage keep their refusals.
  • The index may be a root constant word with an alignment mask (s_and_b32 word, -16) before it becomes a byte offset of an s_buffer_load from a table buffer. The mark carries through a literal s_add; an s_mul of a masked word is not named. Pixel stage only, because the compute dispatch does not read a mask.
  • The manifest word mask M is written by a shared heap_where helper (graphics and compute use the same text). Two-hop index chains (an index read from a non-table buffer) stay refused by name.

Tests: new startup_gfx2hlsl_pixel_heap_image (x8 record, x4 and compute-x8 refusals, mask marks, multiply refusal, manifest words) and an updated control in startup_gfx2hlsl_heap_record.

Verification (Linux only, no Win2025 run yet):

  • python3 -B tests/startup_gfx2hlsl_pixel_heap_image_check.py: PASS
  • python3 -B tests/startup_gfx2hlsl_heap_record_check.py: PASS
  • python3 -B tests/startup_gfx2hlsl_heap_word_check.py: PASS
  • 173 existing translation shapes compared against origin/main: all unchanged
  • remote_pycheck.sh --compare origin/main: no new failures

Draft until an independent review and a Win2025 run.

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-26 06:32 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2761) `tedin7:x2w-ps-heap-image` → `main` · +110 −10 · 4 files · 2 commits · closed without merging Part of #1723 What this unblocks: a pixel program that loads an image descriptor through the resource heap (`s_load_dwordx8` at index << 5) now translates, with the record named in the manifest instead of refused. The translator and manifest only: the draw-time binding of that record is a separate slice, so no draw uses it yet. Source: AMD "RDNA 2" Instruction Set Architecture reference guide, SMEM instruction S_LOAD_DWORDX8 (image resource descriptor load); Microsoft DirectX-Specs, D3D12 resource binding specification, descriptor heaps. What changed (`tools/startup/gfx2hlsl.py`): - `heap_record` now serves the pixel stage: eight dwords (the image record) there, four (the buffer record) in compute. Other widths and the vertex stage keep their refusals. - The index may be a root constant word with an alignment mask (`s_and_b32 word, -16`) before it becomes a byte offset of an `s_buffer_load` from a table buffer. The mark carries through a literal `s_add`; an `s_mul` of a masked word is not named. Pixel stage only, because the compute dispatch does not read a mask. - The manifest word `mask M` is written by a shared `heap_where` helper (graphics and compute use the same text). Two-hop index chains (an index read from a non-table buffer) stay refused by name. Tests: new `startup_gfx2hlsl_pixel_heap_image` (x8 record, x4 and compute-x8 refusals, mask marks, multiply refusal, manifest words) and an updated control in `startup_gfx2hlsl_heap_record`. Verification (Linux only, no Win2025 run yet): - `python3 -B tests/startup_gfx2hlsl_pixel_heap_image_check.py`: PASS - `python3 -B tests/startup_gfx2hlsl_heap_record_check.py`: PASS - `python3 -B tests/startup_gfx2hlsl_heap_word_check.py`: PASS - 173 existing translation shapes compared against `origin/main`: all unchanged - `remote_pycheck.sh --compare origin/main`: no new failures Draft until an independent review and a Win2025 run. AI-assisted; commands listed were executed locally.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 01:20:46 +00:00
github-bot closed this pull request 2026-11-27 01:20:46 +00:00
Author
Owner

@⁠tedin7 on GitHub · 2026-11-26 10:12 UTC · original

Withdrawn: shader translation is moving to the native C++ frontend (see #870), so we are not continuing this change to the Python translator. The branch stays available if any part is useful later. Thank you to everyone who reviewed and tested it.

**@⁠tedin7** on GitHub · 2026-11-26 10:12 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2761#issuecomment-7189057754) Withdrawn: shader translation is moving to the native C++ frontend (see #870), so we are not continuing this change to the Python translator. The branch stays available if any part is useful later. Thank you to everyone who reviewed and tested it.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.