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.
Description
D3D11 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 D3D12, 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.
Changes to existing implementation
Tested on Windows using changes to
D3D11_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
Depth Buffer format
D32_S8
Depth Buffer format
D16
MSAADepth Buffer format
D32
MSAAAfter : the rectangle of output depth 0.0 is shown as passing the depth test
Depth Buffer format
D24_S8
Depth Buffer format
D32_S8
Depth Buffer format
D16
MSAADepth Buffer format
D32
MSAA