Skip to content

d3d12: give 16-bit depth with stencil a writable depth plane - #162

Merged
brcly merged 1 commit into
brcly:mainfrom
Jerkin42:fix/d16-depth-uav
Nov 25, 2026
Merged

brcly merged 1 commit into
brcly:mainfrom
Jerkin42:fix/d16-depth-uav

Conversation

@Jerkin42

Copy link
Copy Markdown
Contributor

GTA VI creates its scene depth as D16_UNORM_S8_UINT with depth-stencil and unordered access and writes depth from compute through an R16_UNORM view. Host depth images cannot have unordered access, so those views had nothing to write to.

Uses the float depth pair that R32G8X24 surfaces already have. D32_FLOAT holds every 16-bit value exactly, so EQUAL depth tests still pass. A view of the stencil plane becomes a null view and is reported once.

🤖 Generated with Claude Code

GTA VI creates its scene depth as D16_UNORM_S8_UINT with both depth-stencil
and unordered access, and writes depth from compute through an R16_UNORM view
of the depth plane. Host depth images cannot have unordered access, so these
views had nothing to write to.

Use the float depth pair that R32G8X24 surfaces already have. The host depth
becomes D32_FLOAT_S8X24_UINT, whose float holds every 16-bit value exactly, so
an EQUAL test against a depth a shader wrote still passes.

A view of the stencil plane becomes a null view and is reported once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@brcly
brcly merged commit 63bec84 into brcly:main Nov 25, 2026
2 checks passed
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.

2 participants