D3D11 Depth Overlay improvements

Handle depth copying with a texture array source
Clear stencil to zero during the depth copy to match the other implementations
Specify the bind flags when creating the new depth-stencil texture
This commit is contained in:
Jake Turner
2023-12-03 21:00:34 +00:00
parent d52f97c225
commit defe79d82c
4 changed files with 66 additions and 3 deletions
+23
View File
@@ -23,6 +23,10 @@
******************************************************************************/
Texture2D<float2> srcDepth : register(t0);
cbuffer ViewInput : register(b0)
{
uint4 viewData; // viewIndex, ???, ???, ???
};
void RENDERDOC_DepthCopyPS(float4 pos : SV_Position, out float depth : SV_Depth)
{
@@ -30,6 +34,14 @@ void RENDERDOC_DepthCopyPS(float4 pos : SV_Position, out float depth : SV_Depth)
depth = srcDepth.Load(int3(srcCoord, 0)).r;
}
Texture2DArray<float2> srcDepthArray : register(t0);
void RENDERDOC_DepthCopyArrayPS(float4 pos : SV_Position, out float depth : SV_Depth)
{
int2 srcCoord = int2(pos.xy);
depth = srcDepthArray.Load(int4(srcCoord, viewData.x, 0)).r;
}
Texture2DMS<float2> srcDepthMS : register(t0);
void RENDERDOC_DepthCopyMSPS(float4 pos
@@ -40,3 +52,14 @@ void RENDERDOC_DepthCopyMSPS(float4 pos
int2 srcCoord = int2(pos.xy);
depth = srcDepthMS.Load(srcCoord, sample).r;
}
Texture2DMSArray<float2> srcDepthMSArray : register(t0);
void RENDERDOC_DepthCopyMSArrayPS(float4 pos
: SV_Position, uint sample
: SV_SampleIndex, out float depth
: SV_Depth)
{
int2 srcCoord = int2(pos.xy);
depth = srcDepthMSArray.Load(int3(srcCoord, viewData.x), sample).r;
}