mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Small tweaks to GL and HLSL shaders used to copy depth for Depth overlay
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user