Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend D3D12 Depth Test Overlay #102

Conversation

Zorro666
Copy link
Owner

@Zorro666 Zorro666 commented Nov 9, 2023

Description

D3D12 Replay support for Issue 2858

This is a PR in a sequence of PRs which all together complete the implementation of the feature.
Future PRs will cover replay support for Vulkan and extending the automated overlay tests GL_Overlay_Test, D3D11_Overlay_Test, D3D12_Overlay_Test, VK_Overlay_Test.

The feature enables supporting shader exported depth for the Depth Test overlay by replaying the draw using the pixel shader from the capture instead of a replacement shader. Depth test passing pixels are identified by using the stencil buffer to generate a stencil mask.

If the depth buffer used for the draw does not have a stencil buffer then a new depth buffer is created with a depth+stencil format and a fullscreen pass is used to copy depth from the original depth buffer to the newly created depth+stencil buffer.

Tested on Windows using changes to D3D12_Overlay_Test

The change makes the pixel shader write out depth 0.0 for a small rectangle just bottom-left of the centre

Before (using v1.29) : the rectangle of output depth 0.0 is shown as failing the depth test

Depth Buffer format D24_S8
image
Depth Buffer format D32F_S8
image
Depth Buffer format D16 MSAA
imageDepth
Depth Buffer format D32F MSAA
image

After : the rectangle of output depth 0.0 is shown as passing the depth test

Depth Buffer format D24_S8
image
Depth Buffer format D32F_S8
image
Depth Buffer format D16 MSAA
image
Buffer format D32F MSAA
image

@Zorro666 Zorro666 changed the title Extend D3D11 Depth Test Overlay Extend D3D12 Depth Test Overlay Nov 9, 2023
@Zorro666 Zorro666 force-pushed the support-shader-exported-depth-in-depth-test-overlay-d3d12 branch 4 times, most recently from 49f555e to 928ab0b Compare November 10, 2023 11:20
Support shader exported depth by replaying using the capture pixel shader to determine passing pixels
@Zorro666 Zorro666 force-pushed the support-shader-exported-depth-in-depth-test-overlay-d3d12 branch from 928ab0b to fb06951 Compare November 10, 2023 11:29
@Zorro666
Copy link
Owner Author

baldurk#3126

@Zorro666 Zorro666 closed this Nov 10, 2023
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.

1 participant