Skip to content

Commit

Permalink
Small tweaks to GL and HLSL shaders used to copy depth for Depth overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
Zorro666 committed Nov 9, 2023
1 parent e1e179b commit 74b0a8b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion renderdoc/data/glsl/depth_copy.frag
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
2 changes: 1 addition & 1 deletion renderdoc/data/glsl/depth_copyms.frag
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
4 changes: 2 additions & 2 deletions renderdoc/data/hlsl/depth_copy.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}

0 comments on commit 74b0a8b

Please sign in to comment.