Skip to content

GPU: upload changed textures in the native prelude - #13

Draft
gmankab wants to merge 2 commits into
spidercraft:linux-native-runtimefrom
gmankab:contrib/native-texture-prelude
Draft

gmankab wants to merge 2 commits into
spidercraft:linux-native-runtimefrom
gmankab:contrib/native-texture-prelude

Conversation

@gmankab

@gmankab gmankab commented Nov 25, 2026 •

Copy link
Copy Markdown

Native Victory records a buffer-to-image upload every time a command list first samples a title-written texture. The list can copy a whole mip chain even when submission-time detiling found the same title bytes.

Move the upload into the prelude after the staging refresh. Only a pending upload transitions into COPY_DEST and copies staged data. The prelude then transitions the host texture to the first state the list expects. The existing resource references hold both the texture and staging buffer through execution.

The live regression uses a synthetic 1024×512 BC7 sRGB texture. It reads back all eight mips across submissions containing two lists. It overwrites clean staging with sentinels to detect any redundant upload, then changes the title data and checks that the next submission sees it.

A native startup replay also reached the 160-second limit on Lavapipe. Frame times during loading were similar with and without the patch.

Based-on: Marvisak#230
Depends-on: #12
Tested-on: Intel Xeon E5-2670 v3, Fedora Linux 45, Lavapipe and native VKD3D-Proton. 44 GPU tests and the opt-in BC7 regression passed with physical GPU access disabled.
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
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