Skip to content

GPU: create the title's video textures, and bound the mesh path the console allows - #1

Merged
Yeetbot159 merged 3 commits into
mainfrom
stable
Nov 24, 2026
Merged

Yeetbot159 merged 3 commits into
mainfrom
stable

Conversation

@Yeetbot159

Copy link
Copy Markdown
Owner

Three fixes, each measured against a run of the title.

A clear value only on a texture that can take one

The title asks for an optimized clear value on its NV12 and B4G4R4A4_UNORM textures. Our conversion strips the render-target flag for those formats, and D3D12 refuses a clear value on a resource that is neither a render target nor a depth target, so CreateCommittedResource returned E_INVALIDARG and those textures were never created. Measured: before, three 'no host texture ... 0x80070057' failures per run and the title died at frame 1479 reading 0xffffffffffffffff; after, no texture failures, no such crash, and a run passes frame 4000. A console resource that is both depth target and UAV is now a debug line and a null view instead of a host failure.

Bindless pointer chasing

Marvisak#1333 rebased by hand: a descriptor behind a pointer the shader computes is followed through the root constants, and the lowering binds one root view whose 16-bit register says where the pointer lives. This branch's complemented masks, cube gradient axes and descriptor stand-ins are kept.

The mesh path's bounds

The console's exp prim carries 10-bit vertex indices, so a primitive can name vertex 1023 while the program declares and every lane writes 128. Primitive indices past the declared vertices are culled, lanes past the declared outputs store nothing, and a mesh group count is clamped to 65535.

Also: every host operation leaves a breadcrumb in a lock-free ring and a removal dumps the newest 64 (neither the debug layer nor DRED works on every host), which turned 'the application made a call that is invalid' into 'dispatch 1x1x1 [compute e30970f1727063fd]' with its root arguments; and CopyTextureRegion into a buffer now lands in the host copy of its memory instead of being dropped.

cargo test --workspace: 23 suites green, victory-shader 150 passed / 1 ignored, victory-gpu 71 passed / 1 ignored. shadow::snapshot_tests::two_copies_keep_their_snapshots_apart is flaky and fails on unmodified main too. Not proven yet: the depth target is still zero because the title stops at its account picker.

BED and others added 3 commits November 24, 2026 19:17
…arget's UAV view as a degradation

The title hands an optimized clear value for its NV12 and B4G4R4A4_UNORM
textures; stripping the render-target flag for those formats left a clear
value on a resource that is neither a render target nor a depth target, and
D3D12 refuses that with E_INVALIDARG, so the textures were never created.
The conversion now reports whether the host flags still allow a clear value
and the creation path passes the title's only when they do.

A console resource that is both a depth target and a UAV loses the UAV
permission on its host copy (PC refuses both flags together), so a UAV view
of one would remove the device. That is now a debug line and a null view
rather than a host failure warning.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…breadcrumbs, texture to buffer copies

The bindless lane of Marvisak#1333 lands here by hand: a descriptor behind a pointer the
shader computes is followed through the root constants, with the bias meaning
only the pointer's own adds.

The mesh path gains the bound the console's 10-bit primitive indices need: a
vertex index past the declared max_vertices is culled, lanes past the declared
outputs store nothing, and a group count is clamped to the host's 65535. An
index naming a vertex the host does not have is undefined behaviour that AMD
hardware hangs on.

Every host operation now leaves a breadcrumb in a lock-free ring, and a device
removal dumps the newest 64, so an invalid call names itself instead of relying
on DRED or the debug layer, neither of which works on every host.

A texture copied into a buffer lands in the host copy of the buffer's memory and
goes back to title memory once the list has run, where before the copy was
dropped as unimplemented.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The four mesh tests the bound was written with were aimed at the merged
10-PR tree and do not compile against this one's helpers, which return the
lowered program without its IR module. What can be asserted here is what the
lowering records: whether the vertex and primitive lane bounds were installed,
and the vertex count primitive indices are culled against. The refusal test is
unchanged and needs nothing new.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

@graphify-labs graphify-labs Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Graphify review View in Graphify

Review before merging · Merge confidence 4/5

1 bug · 19 possible issues to check · High impact

The changes add host GPU operation breadcrumbs, revise texture-copy and descriptor handling, and extend shader translation for root-constant pointers and bounded mesh outputs.

P2  Pointer-based shader reads never bind their pointed-to buffer · host.rs:384

19 possible issues we couldn't confirm

They don't change the score.

What this review covered
  • One review pass used all of its turns for reading code, so it reported from what it had already read.
  • 4 more possible issues from the per-file sweep were left out to keep the report to its limit.
  • 16 of 16 changed files inspected. This is scope, not a correctness guarantee.
Code graph · 1021 functions depend on this change
  • 6 functions became more coupled. Largest: find() (15 callers), track_words() (15 callers), null_for() (4 callers).
  • Gate, test list and every flagged function: in the Graphify check.

Reviewed bf03c79

@Yeetbot159
Yeetbot159 merged commit 5728350 into main Nov 24, 2026
2 checks passed
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