Skip to content

GPU: resolve native texture contents in submission order - #15

Draft
gmankab wants to merge 3 commits into
spidercraft:linux-native-runtimefrom
gmankab:contrib/native-texture-submit-order
Draft

gmankab wants to merge 3 commits into
spidercraft:linux-native-runtimefrom
gmankab:contrib/native-texture-submit-order

Conversation

@gmankab

@gmankab gmankab commented Nov 25, 2026

Copy link
Copy Markdown

A list recording a copy could mark a texture as GPU-written before the queue submitted that list. An earlier submission then read an uninitialized texture. A partial first copy also lost the untouched title texels.

Resolve uploaded contents and GPU writes in submission order using the native texture prelude. A partial first copy uploads the initial contents before it modifies them. A full overwrite skips the destination upload.

Both new regressions failed on the prerequisite branch and pass with this patch. They check every texel after a partial copy and after submitting a reader before a previously recorded writer in the same batch. The 46-test Lavapipe suite passed. Both regressions and the eight-mip BC7 readback also passed headlessly on the RX 6800.

Based-on: Marvisak#1934
Depends-on: #13
Tested-on: Fedora Linux 45, Intel Xeon E5-2670 v3, Lavapipe and AMD Radeon RX 6800 with RADV using native VKD3D-Proton
Assisted-by: gpt-6.2 sol xhigh

Review this layer's diff.

GetCopyableFootprints includes the last row's payload but may omit its
trailing pitch padding. The old detiler made a mutable slice covering a
full pitch for every row, including bytes beyond the upload buffer.
Create the mapped slice with the allocated size and bound each mip's
slice to that allocation while preserving its row and depth pitches.

Round-trip eight synthetic BC7 mips through a native D3D12 device and
check their payload bytes, including the final row with no pitch padding.

Tested-on: RX 6800, Fedora Linux 45, native vkd3d-proton and RADV
Assisted-by: gpt-6.2 sol xhigh
Native recording issues a buffer-to-image copy for every sampled title texture, even when detiling found unchanged bytes. Decide whether to copy after the submission refresh. Transition the host texture from its current state to COPY_DEST only for a pending upload, then bring it to the state expected by the first command. A second list can reuse the uploaded texture in the same submission.

Based-on: Marvisak#230
Depends-on: spidercraft#12
Tested-on: Intel Xeon E5-2670 v3, Fedora Linux 45, Lavapipe and native VKD3D-Proton (44 GPU tests plus the eight-mip BC7 round-trip)
Assisted-by: gpt-6.2 sol xhigh
Marking a texture as GPU-written during recording can suppress the
initial title upload in a reader that gets submitted first. A partial
copy can also discard the untouched title texels on its first use.

Track the first read and GPU writes per list. Resolve both in the
submission prelude so an earlier writer remains authoritative and a
partial first write starts with the title contents. A full overwrite
still skips the destination upload.

Check a partial first copy and a read submitted ahead of a previously
recorded writer. Both cases inspect every texel through GPU readback.

Based-on: Marvisak#1934
Depends-on: spidercraft#13
Tested-on: Fedora Linux 45, Intel Xeon E5-2670 v3, Lavapipe and AMD Radeon RX 6800 with native VKD3D-Proton
Assisted-by: gpt-6.2 sol xhigh
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