GPU: preserve the shape of implicit depth-stencil views #2955

Open
ghptc wants to merge 2 commits from upstream-pr/2955 into main
ghptc commented 2026-11-29 19:00:08 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ghptc on 2026-11-29T19:00:08Z.


What it changes

On promoted typeless depth textures, a null DSV description needs an explicit typed format in the host view. The synthesized description always chose TEXTURE2D. That lost array layers, the 1D dimension, and multisample view dimensions.

Reconstruct the implicit view from the resolved host texture's description. Use mip zero and every array slice for default array views. Explicit mip, slice and flags follow the existing path. Resolve the format and shape against the same host texture supplied to the bind or clear call.

ESAT586's Marvisak/VIctory#1406 covers the same default DSV dimension, layers and MSAA correction in the sibling repository, alongside RTV/SRV/UAV cases. This patch addresses the DSV path in VIctory-NVIDIA. #2535 addresses depth-test defaults in PSO stream creation. #2770 addresses depth twin invalidation.

Validation

The renderer team's synthetic CPU control found 5 mismatches among 6 implicit descriptor cases on the baseline and 0 on the candidate. Explicit mip, slice and flags matched in both arms. The baseline's invalid descriptor plan was rejected on the CPU before it reached the driver.

Independent QA on an RTX 5070 checked the candidate offscreen with a single 2D texture and a three-layer 2D array, at 1x and 4x MSAA. The readback verifier matched all 442,368 bytes, including 36,864 directly read D32 samples at 1x and 73,728 RGBA pixels across 1x/4x. Resolved color verifies the 4x occlusion results. The 1D shapes were covered by the CPU control. Candidate draw median and P95 were 12.272 µs and 17.408 µs. These are fixture timings. In-game artifact attribution and a before/after GPU speedup were outside the experiment.

Based on f889bb076fa884fff8d2b6f0b50ac86f72abfd98. Original commits f2f2c3215e9ed8d42fa1275334f1cd697b4347b6 and 5f3ecbf78f5b5e79ea07aba8ced3ac6d67b446a4, cherry-picked with original authorship.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5554025700 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2955). Originally posted by [ghptc](https://github.com/ghptc) on 2026-11-29T19:00:08Z. --- ## What it changes On promoted typeless depth textures, a null DSV description needs an explicit typed format in the host view. The synthesized description always chose TEXTURE2D. That lost array layers, the 1D dimension, and multisample view dimensions. Reconstruct the implicit view from the resolved host texture's description. Use mip zero and every array slice for default array views. Explicit mip, slice and flags follow the existing path. Resolve the format and shape against the same host texture supplied to the bind or clear call. ESAT586's [Marvisak/VIctory#1406](https://github.com/Marvisak/VIctory/pull/1406) covers the same default DSV dimension, layers and MSAA correction in the sibling repository, alongside RTV/SRV/UAV cases. This patch addresses the DSV path in VIctory-NVIDIA. #2535 addresses depth-test defaults in PSO stream creation. #2770 addresses depth twin invalidation. ## Validation The renderer team's synthetic CPU control found 5 mismatches among 6 implicit descriptor cases on the baseline and 0 on the candidate. Explicit mip, slice and flags matched in both arms. The baseline's invalid descriptor plan was rejected on the CPU before it reached the driver. Independent QA on an RTX 5070 checked the candidate offscreen with a single 2D texture and a three-layer 2D array, at 1x and 4x MSAA. The readback verifier matched all 442,368 bytes, including 36,864 directly read D32 samples at 1x and 73,728 RGBA pixels across 1x/4x. Resolved color verifies the 4x occlusion results. The 1D shapes were covered by the CPU control. Candidate draw median and P95 were 12.272 µs and 17.408 µs. These are fixture timings. In-game artifact attribution and a before/after GPU speedup were outside the experiment. Based on `f889bb076fa884fff8d2b6f0b50ac86f72abfd98`. Original commits `f2f2c3215e9ed8d42fa1275334f1cd697b4347b6` and `5f3ecbf78f5b5e79ea07aba8ced3ac6d67b446a4`, cherry-picked with original authorship.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2955:upstream-pr/2955'
git switch 'upstream-pr/2955'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2955'
git switch 'upstream-pr/2955'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2955'
git switch 'upstream-pr/2955'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2955'
git switch 'main'
git merge --squash 'upstream-pr/2955'
git switch 'main'
git merge --ff-only 'upstream-pr/2955'
git switch 'main'
git merge 'upstream-pr/2955'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
trustno1-coder/VIctory-NVIDIA!2955
No description provided.