Repository navigation
Conversation
… view A title buffer view becomes a view of its host copy with the first element moved by the view's offset in the copy (offset / stride). A structured view whose start in the copy is not a multiple of its stride (a 32-byte stride, 16 bytes past an element: logged as "buffer view not on an element of its host copy" on the way to the menus) cannot be expressed there, so its slot was left null: shaders read zeros through it and their writes were lost. Such a view is now made as the raw view of the same bytes (R32_TYPELESS, raw flag, first element and count in dwords) when its start is 16-byte aligned; the host removes the device for raw views that are not, so other starts stay refused. It is a view of the same shared host copy, so what shaders write through it lands where the other views of that memory read, and is copied back to title memory as before. Translated shaders read heap buffer views raw unless they index them; one that indexes it declares it structured, which D3D12 leaves undefined over a raw view (an RTX 5080 and WARP read and write the right bytes). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t copy's elements a raw view) into the integration The SRV's coherency range (PR Marvisak#185) is computed before the view is rewritten; the 16-byte raw-start check stays on the in-element path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AZ9pSB4ZoXYUifuXg8gm66
Shader PRs 136, 163, 164, 160, 176, 193, 177, 180, 138, 139, 145, 154, 156, 157, 162, 166, 168, 169, 179, 200, 226 and 25. Marvisak#193's runtime stride table is combined with the runtime PRs: - descriptor/host.rs keeps Marvisak#135's retire-on-keep, dynamic pool and sampler cap, Marvisak#185's Slots (made + directly indexed SRVs) and Marvisak#206's raw fallback for structured views off their host copy's elements. The stride table still holds the title view's element stride: a raw view made by Marvisak#206 starts at the same byte (raw_window never rounds), so the shader's index * stride + offset reads the same bytes. - Slots Marvisak#193 did not know about now write their stride: a directly indexed SRV (Marvisak#185) when its record changes, and make_null_kind's typed null views (0). - draw.rs keeps bind() returning whether it bound (with the stride table root SRV set inside it) and the bounded indirect argument copy. - pipeline/host.rs keeps the per-stage subobject stream; the stride table root parameter merges cleanly. - depth_bounds_test's HostShader gains stride_table: false. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AZ9pSB4ZoXYUifuXg8gm66
… elements a raw view Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @AnoHunted for the structured-view fix. I tested the open PR at head Result: 2 passed, 0 failed. |
…ent become raw views) AnoHunted's Marvisak#206: a structured buffer view whose start in its host copy is not on an element, which stayed null, is made as the raw view of the same bytes where those start on 16 bytes. Conflict resolution, crates/victory-gpu/src/descriptor/host.rs: - buffer_srv and buffer_uav: Marvisak#206's three-way choice (on an element, raw view of the same bytes, refused) is kept, and Marvisak#123's refusal of a raw view that does not start on 16 bytes of the host copy follows it, as it followed the old test. Marvisak#206 moved `FirstElement += offset / element` into its first arm and `CounterOffsetInBytes = 0` before the choice; the copies of those lines on this tree's side are dropped. - tests: this tree's and Marvisak#206's are all kept. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Seven more upstream PRs are in (Marvisak#493, Marvisak#483, Marvisak#206, Marvisak#469, Marvisak#459, Marvisak#454, Marvisak#579) and the wave64 stack is at Marvisak#439's head 965ce30. Records how each was combined with what the tree had, that a capped view heap keeps 2^18 dynamic slots and why, Marvisak#189 and Marvisak#578 as left out, and a new section with testers' reports from the title: the set without the world-entry hang on three NVIDIA cards and how this tree differs from it, VICTORY_SKIP_WAVE64 as the switch to try, and Marvisak#136 bisected as making every frame black. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Tested on an RTX 4070 (Windows 11, driver 621.01), diag build of My reading, not verified in that pass's DXIL: the translator declares a heap buffer view structured, with the entry's stride, when the shader reads it with an index, so a raw host view may not match that declaration. The raw window may need to depend on how the shader declares the slot. Two runs; details in #71 (comment) (section 6). |
|
@SantannaCarlos thank you, that's exactly the case this needed. You're right. When the shader indexes the view, the translator declares the slot structured with the entry's stride. The raw fallback then puts a raw descriptor under a structured declaration, which D3D12 leaves undefined. My synthetic probe passed on NVIDIA and WARP, but your 336-byte-stride compute pass shows it isn't safe in the title: it is worse than the null view main leaves there. I'm turning this into a draft so it isn't merged as is. A correct version needs one of two things:
I'll come back to it on top of that work rather than keep this fallback. |
|
Verified head The previous hardware run logged a structured-buffer view offset off its 32-byte element. With this PR in the stack, that warning no longer appeared in the bounded hardware run. Both added raw-window/read-write tests passed on the RTX 4080; diagnostics GPU suite: 66 passed, 1 ignored. All-target/all-feature GPU Clippy, diagnostics build and asset policy passed. Stack also contains #211, #89, #492, #985 and #1146 on main No game captures, retail files or raw logs attached. |
|
Tested exact head Integration: Slaktarn700 Observed bindings: before this PR, compute Tests:
Runtime: the default-limit run ends after 108.1 s, exit 5. Our bounded fence probe reports submission 5209/completed 5208. The last resolved pre-command marker is 62, preceding a 34x1x1 dispatch of the same Prior isolation and shader-exclusion controls: #71 (comment) . A second controlled run used the same application binary, only adding All runs were offline and app-muted. No game files, shader code, dumps or captures attached. No controllable visible gameplay confirmed. AI-assisted testing with Codex on the user's hardware. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What
buffer_srvandbuffer_uav(crates/victory-gpu/src/descriptor/host.rs) now make a structured buffer viewwhose start in its host copy is not on an element as the raw view of the same bytes (
R32_TYPELESS, raw flag,first element and count in dwords), when that start is 16-byte aligned. Views on an element are made as before.
Everything else (typed views, strides that are not a multiple of 4, starts that are not 16-byte aligned) is still
refused with the same log line. The math is in a small
raw_windowhelper, with a unit test and a host GPU test.Why
A title buffer view is made on the host copy of the innermost title buffer that holds it, with its first element
moved by its offset in that copy (
FirstElement += offset / stride). A view of memory inside a bigger title buffercan start anywhere in it. The log in #16 already has
buffer view not on an element of its host copywithelement=32on the way to the menus: a 32-byte-stride view 16 bytes past an element. D3D12 puts structuredelement
iat bytei * strideof the resource, so that start cannot be written as a structured view of the copy.The slot stayed null: shaders read zeros through it and their writes were lost.
Why a raw view and not a host copy of its own starting at the view: such a copy would be a second buffer for the
same memory. Writes through it would not reach readers of the shared copy in the same submission (and the other
way round), and the refresh and copy-back steps only know the shared copy (
shadow::find). The raw view is aview of the shared copy, so
readable's refresh andgpu_writes/copy-back keep working unchanged. They usebuffer_range, which gives the same bytes. What a UAV writes lands where every other view of that memory reads,and goes back to title memory after the submission.
How shaders see it: the emitter declares heap buffer views raw for dword loads and stores, atomics and
typed-format loads without an index, and structured only when the shader indexes them
(
victory-shader/src/emit/mod.rs, "Buffer views in the heap"). A raw reader is served exactly. A shader thatindexes the view declares it structured (stride 32) over a raw descriptor. D3D12 leaves that undefined, so it is
marked as a shortcut. On the RTX 5080 and on WARP such reads and writes got the right bytes (probe below, not
part of the PR). AMD is not known.
The 16-byte rule is
D3D12_RAW_UAV_SRV_BYTE_ALIGNMENT. It is not optional. In a probe run, a raw SRV or UAV atbyte 4 or 8 of a buffer removed the device (
DXGI_ERROR_INVALID_CALL) on both the NVIDIA GPU and WARP. At byte 16the device stayed up.
#123 is the same rule for the title's own raw views: it refuses one that lands off 16 bytes in its copy. This PR
covers structured views that land off an element. The two touch neighbouring lines in
buffer_srvandbuffer_uavand fit together: the views this one makes are always 16-byte aligned.Tested
Windows 11, NVIDIA GeForce RTX 5080, Rust 1.98.1; also
WARP (
VICTORY_D3D12_WARP=1, diagnostics build).New tests in
descriptor/host.rs:structured_views_off_an_element_are_raw_views_of_the_same_bytes: the raw view covers exactly the structuredview's bytes, and the cases it must refuse (not 16-byte aligned, stride 6, stride 0, more than
u32::MAXdwords).
structured_views_off_an_element_read_and_write_their_bytes(host GPU): a 1 KiB title buffer of numbereddwords. A structured SRV (stride 32, 4 elements) starts at byte 16 and a structured UAV at byte 272, both made
by
buffer_srv/buffer_uav. Acs_5_1shader (system compiler) copies the SRV into a buffer of ours andwrites marks through the UAV. It runs through
HostListandHost::execute, so the refresh and copy-back stepsare the real ones. Checks: what it read is title bytes 16..144; after copy-back, title bytes 272..400 hold the
marks; no other byte changed.
the RTX 5080 and on WARP.
Whole runs, main (
d2a4bae) and branch side by side in one job:cargo test --workspace(RTX 5080): main 264 passed, 0 failed, 4 ignored; branch 266 passed, 0 failed,4 ignored (the two new tests).
cargo test -p victory-gpu --features diagnosticson WARP: main 45 passed, 0 failed, 1 ignored; branch 47passed, 0 failed, 1 ignored.
cargo clippy -p victory-gpu --all-targets: one warning on both, the same one, inhost.rs(not touchedhere).
cargo xtask policy: 151 files ok on both.rustfmt --checkondescriptor/host.rs: none of the reported spots are lines this change adds (the filewas not rustfmt-clean before).
Probe (not part of the PR):
StructuredBuffer<E>/RWStructuredBuffer<E>with a 32-byteE, over the raw fallback views: right bytes readand written, RTX 5080 and WARP.
0x887A002D), so there was no debug-layer or GPU-based validation check.Not tested
AI-assisted (Claude Code, Claude Opus 5.5). No game files were used.