GPU: small unordered-access textures get their host copies with their views (one tile repeated over the shore after #996) #1183
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!1183
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1183"
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?
@seabed-dev on GitHub · 2026-11-28 15:05 UTC · original
seabed-dev:fix/unordered-textures-with-views→main· +100 −1 · 2 files · 1 commits · merged 2026-11-28 19:39 UTCFollows #996. With #996 the tessellated terrain next to water is drawn; this makes its ground look right.
What it fixes
With #996 applied, the ground that it brings back (the sand at a beach, the seabed) shows one tile of the terrain's virtual texture repeated everywhere, in strips about a texel of the terrain's material map wide, and the tile changes while you move. It looks like a texture set to repeat.
Cause
That terrain's pixel shader (
PS_TexturedDeferred) looks its pages up in a page table: a 256x256 R16_UINT texture of six levels. It takes the table from the view heap by an index it reads from a constant buffer (slot 8716 here). The programs that write the table (terrain_indirection_texture:CS_UpdateIndirectionand its siblings) take it the same way: an index from a buffer, the descriptor from the resource heap,image_store.A host copy is made when a list names its texture, and a slot written with a view of a texture that has none waits for it (
descriptor.rswait_for/make_waiting). No list ever names this texture, so:The textures the title fills itself are covered by the pass over textures picked by index. A texture the host writes has nobody: with
VICTORY_QUEUE_HOST_TEXTURES=0it leaves that queue, and with it on the pass has nothing to bring up to date for it.Fix
A texture with the unordered-access flag and neither the target nor the depth flag, of at most 1 MiB of texels, gets its host copy when a view of it is written into a view heap (
wait_for), instead of on a first use that may never come.VICTORY_UNORDERED_NOW_KBsets the size: 1024 by default, 0 turns the rule off (as before).Measured
RTX 5080 16 GB, Ryzen 9 9950X3D, 32 GB, Windows 11, Series X profile, 2560x1440.
What the rule adds to the card. Counted in a build that only counts (on Vice-Tay 57deba5c4, which has the same
wait_for): every host-written texture seen in a view heap without a host copy, and whether anything made it later. One session over water, a beach, the inside of a bar and a street, 6,000 frames:About 400 unordered-access textures are seen by frame 2,400 and the number does not grow with the places visited. Among those still waiting, nothing lies between 682 KiB and 2.7 MiB, so the default is not on an edge. (Sizes are texel bytes with levels counted as 4/3, not allocations.)
Frame time, this fork, #996 plus this PR, rule on against
VICTORY_UNORDERED_NOW_KB=0, four unattended runs of 180 s alternating, the 40 s where the picture stands still at the start of play:On 33.0 ms, off 33.2 ms; two runs of one setting differ by more than the settings do. No difference these runs can show.
Tested
216bca9(#996) plus this commit, release build: played at a beach and in the water next to it; the ground is continuous, no strips, nothing else looked different. The rule's log line counts the host copies it makes.cargo test -p victory-gpu: 454 passed, 0 failed, 36 ignored. One new test,small_unordered_textures_are_made_with_their_views.cargo test --workspace: all pass except three invictory-shader(emit::rect::tests::the_rectangle_stage_is_a_geometry_shader,rectangles_are_drawn_whole,emit::barycentric_tests::first_half_values_render_on_hardware_and_warp: "Container part 'Pipeline State Validation' does not match"). They fail the same way on this PC without this commit, and this commit does not touch that crate.cargo clippy --workspace --all-targets --all-features -- -D warnings: three errors, none in lines this commit touches (victory-shader/src/emit/mod.rs:2768,victory-gpu/src/descriptor.rs:1234,victory-gpu/src/shadow.rs:1708); the same without this commit.Not tested
MST_DS_CascadeShadows) were not looked at.Notes