Repository navigation
fix(gpu): take an unordered view's level from its MipSlice word - #525
Merged
Merged
Conversation
image_words builds the size fields of the console image descriptor that programs read as numbers through the view table. For an unordered view it took the level from word 4 of the view description: a shader view's MostDetailedMip, but for an unordered view (its union starts at byte 8) an array's size or a 3D view's depth. Its MipSlice is word 2, as uav_desc hands it to the host. A 2D unordered view of level 3 read as level 0, a view of six array slices as level 6. The test has the level where the host's description has it, and a view of level 2 of six array slices. From halfwave50/VIctory-macOS-halfwave b9ac764 (GPL-3.0, issue pragyaangaur#455). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What.
image_wordsbuilds the size fields of the console image descriptor, which programs read as numbers through the view table. For an unordered view (UAV) it now takes the level from word 2 of the view description,MipSlice, whereuav_deschands it to the host.Why. It read word 4. That is a shader view's
MostDetailedMip(an SRV's union starts at byte 16), but in an unordered view's description (its union starts at byte 8) word 4 is an array'sArraySizeor a 3D view'sWSize. So a 2D UAV of level 3 read as level 0, and a UAV of six array slices read as level 6. A program that reads those fields as numbers then works with the wrong level's size, or with a level that doesn't exist.Context: #488. With
VICTORY_UAV_SIZE_LEVEL0=1(every program) halfwave50 saw speckles on skin. Per their comment on #488, that run used a build from before this word-2 fix in their fork, so the wrong level is a plausible cause. Nobody has checked that in game yet, and this PR doesn't change #488's switch or its per-program default.Tests
descriptor::host::tests::a_texture_view_gives_its_image_descriptor_size_fields(Windows target, runs under Wine): the UAV's level is now where the host's description has it (word 2), and a new case covers a view of level 2 of six array slices, where the level must not be the slice count.cargo test --workspace722 passed;tools/macos/test-wine.sh --workspace --no-fail-fast1443 passed, 1 failed (draw::bake_sources::tests::bindless_bake_draw_pre_uploads_unmade_placed_texture_on_first_execution, intermittent on plain main too in our runs, which shared the machine with a game run); gnullvm clippy--workspace --all-targets -D warnings, with and without--all-features: clean;cargo xtask policy: ok.=1plus this fix is still unchecked (our open promise on fix(gpu): smooth sun-shadow edges on D3DMetal (optional VICTORY_UAV_SIZE_LEVEL0) #488).Credits. From halfwave50/VIctory-macOS-halfwave b9ac764 (GPL-3.0, issue #455).
Update: rebased onto main
f7dddb0(after #518–#522 and #447); tests re-run there, clippy and policy clean. This change has also been in our play builds on the M5 Pro (integration v8/v9, lit and correct prison scene) for the last day.🤖 Generated with Claude Code