Small tweaks to GL and HLSL shaders used to copy depth for Depth overlay

This commit is contained in:
Jake Turner
2023-11-09 12:12:25 +00:00
parent e1e179bd53
commit 74b0a8b1a7
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -36,6 +36,6 @@ uniform PRECISION sampler2D srcDepth;
void main()
{
ivec2 srcCoord = ivec2(int(gl_FragCoord.x), int(gl_FragCoord.y));
ivec2 srcCoord = ivec2(gl_FragCoord.xy);
gl_FragDepth = texelFetch(srcDepth, srcCoord, 0).x;
}
+1 -1
View File
@@ -42,6 +42,6 @@ uniform PRECISION sampler2DMS srcDepth;
void main()
{
ivec2 srcCoord = ivec2(int(gl_FragCoord.x), int(gl_FragCoord.y));
ivec2 srcCoord = ivec2(gl_FragCoord.xy);
gl_FragDepth = texelFetch(srcDepth, srcCoord, gl_SampleID).x;
}
+2 -2
View File
@@ -26,7 +26,7 @@ Texture2D<float2> srcDepth : register(t0);
void RENDERDOC_DepthCopyPS(float4 pos : SV_Position, out float depth : SV_Depth)
{
int2 srcCoord = int2(int(pos.x), int(pos.y));
int2 srcCoord = int2(pos.xy);
depth = srcDepth.Load(int3(srcCoord, 0)).r;
}
@@ -37,6 +37,6 @@ void RENDERDOC_DepthCopyMSPS(float4 pos
: SV_SampleIndex, out float depth
: SV_Depth)
{
int2 srcCoord = int2(int(pos.x), int(pos.y));
int2 srcCoord = int2(pos.xy);
depth = srcDepthMS.Load(srcCoord, sample).r;
}