Skip to content

dxbc, xshader: read four-word typed UAVs in a mesh pipeline's pixel layout - #214

Open
NickStallman wants to merge 1 commit into
brcly:mainfrom
NickStallman:fix/xshader-unresolved-image-lz
Open

NickStallman wants to merge 1 commit into
brcly:mainfrom
NickStallman:fix/xshader-unresolved-image-lz

Conversation

@NickStallman

Copy link
Copy Markdown
Contributor

In ProjectScarlett's world load, 170 distinct mesh-pipeline pixel shaders were refused with unresolved image [image_sample_lz]. This was the most common refusal there. The root attached to them puts a UAV (u7) at the slot where the program reads t91, so the sample resolved to a UAV.

#177 lays such pixel tables out as the program reads them (MeshLayout::from_pixel_shader). But read_stage in mesh_table.rs gave up on a record type these programs have: a four-word typed UAV (class 0x303, shape 4, PSV type 6). No pixel layout was built, the pixel stage was translated against the title's root, and that failed.

  • mesh_table.rs: read a four-word typed UAV in pixel programs when PSV names the register as a typed UAV and not a structured one. This is the same pattern as dxbc: read typed SRV buffers in raster stages under single-table roots #202 for typed SRV buffers.
  • image.rs: a sample or gather that resolves to a table UAV now says <op> reads table UAV u<N>: the root does not describe the program's table instead of unresolved image. The outcome is unchanged.
  • Tests: pixel_layout_reads_four_word_typed_unordered_access_views and sampling_a_root_uav_slot_names_the_mismatched_root.

Result

  • Offline, against the prefix cache: rebuilding these requests the way the runtime now does translates 240 of the 241 cached refusals of this kind, including all 170 from the world load. Across all 21,867 cached requests, nothing else changed.
  • In game, RTX 5090: unresolved image refusals during the world load went from 46 to 0 between two runs on the same save.

Checks

  • RTX 5090, NVIDIA 595.99.02, GE-Proton11-14: tuxbox.py check passed every group.
  • AMD Raphael iGPU, RADV, Mesa 26.0.8: every group passed except the five guest-present* gates. They fail on this machine for an unrelated reason, as in host: also hide VK_EXT_descriptor_heap on GPUs that need storage CBVs #212.
  • cargo test for the shader compiler (326) and tuxbox-dxbc (66): OK. Python tests: 368 OK.

🤖 Generated with Claude Code

…ayout

ProjectScarlett's most common translator refusal after loading into the world
is `unresolved image [image_sample_lz]` (241 recorded requests, about 170 seen
in one run). Every one is a mesh pipeline's pixel program translated against
the title's root. That root does not describe the program's table: the program
samples t91 at s8 + 0x1740 (slot 186, per its FSSM record and PSV), where the
root declares u7. The emitter resolves the slot to a UAV and cannot sample it.

brcly#177 lets the runtime lay out such a table as the pixel program reads it
(`MeshLayout::from_pixel_shader`, `ComputeTable::pixel_root`). These programs
also record typed UAVs with four words and shape 4 (class 0x303), which
`read_stage` did not accept, so the pixel layout was dropped and the guest
root kept. Accept that record in pixel programs when PSV names the register
as a typed UAV and not a structured one.

The emitter now names the mismatch instead of "unresolved image" when a
sample or gather resolves to a table UAV.

Against the recorded requests, with the pixel root the runtime would now build
(simulated from the root-less program and the request's root): 240 of the 241
translate; one has another root layout. The recorded rooted requests are
unchanged apart from the refusal text (19,948 of 21,867 translate before and
after).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant