Copy packed linear texture rows one depth slice at a time #1201
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!1201
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1201"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@BradRoland on GitHub · 2026-11-25 23:49 UTC · original
BradRoland:codex/linear-texture-row-copy→main· +43 −0 · 1 files · 1 commits · openLayout::tileanddetilecurrently issue a host copy per row, even for a linear mip whose logical row width equals both the title pitch and the caller's pitch. In that case each depth slice can be copied in one operation. Each side keeps its own slice stride, so padding between depth slices and the adjacent mip levels stay intact.On an i9-12900K I timed the public
tileanddetileentry points with reused buffers. Both revisions ran in one optimized process pinned to one logical CPU. Each pair used the same buffers, alternating which implementation ran first. These are medians across 24 pairs, 128 MiB copied per batch.Padded-row and 64 KiB tiled controls took the existing path and had mixed timings. The padded 63×64 tile control measured 201 → 218 ns. Results for the largest packed copy were sensitive to buffer placement across separate processes. Gameplay impact is unmeasured.
The new regression checks both directions against per-row offsets in a 3D mip, including untouched bytes around the mip and between slices. The formats suite passed 26 tests with four ignored, and Clippy passed with warnings denied. I also ran the #1152 D3D12 readback fixture with 64×64 linear
R32_FLOATresources on an RTX 4080 and WARP. Both passed its byte comparisons for full and restricted views.@Yoshi-233 on GitHub · 2026-11-26 03:57 UTC · original
I tested #1201 together with #1055 because both change the same volume-copy path. The #1055 texture patch applied cleanly to
5bb9592.I used a CPU reference that copies one element at a time using
Layout::offset. I checked the entire destination in both directions, including padding and neighboring mips. All 1,920 valid cases matched on the parent, #1201 alone, #1055 alone, and the two together. Of those cases, 180 meet the packed-linear fast-path condition. The rest cover padded rows or the 4 KiB swizzle. The input for detiling was generated separately from the tiling output.I also tried 960 calls with the depth pitch one byte shorter than the active slice. Both the parent and #1201 alone accepted all 960 and wrote to the destination. #1055 alone and the combination returned
TooSmallfor all 960 and left every destination unchanged. The exact minimum pitch still worked, including when it omitted the final row's padding.On the combined tree,
cargo test --locked -p victory-formats --libpassed 27 tests with 4 ignored (Linux x86-64). The results support applying the two changes together. This was a byte-correctness check; I didn't measure throughput.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.