From b1620e0ae5e07de78a6b5b131de67598d0e5bc47 Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 29 Oct 2026 12:19:43 +0000 Subject: [PATCH] Use matching name for GL input/output variables * GL doesn't use location matching due to it not being supported always. --- renderdoc/data/glsl/debug_sample.frag | 28 ++++++++++----------- renderdoc/data/glsl/shaderdebug_sample.vert | 11 +++++--- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/renderdoc/data/glsl/debug_sample.frag b/renderdoc/data/glsl/debug_sample.frag index 8117585da..31391dd68 100644 --- a/renderdoc/data/glsl/debug_sample.frag +++ b/renderdoc/data/glsl/debug_sample.frag @@ -105,7 +105,7 @@ uniform PRECISION sampler2DRectShadow tex2DRectShadow; #endif -in vec4 input_uvwa; +in vec4 v2f_uvwa; out RESULT Output; #ifdef GATHER_OFFSETS @@ -204,12 +204,12 @@ RESULT DoFetch2DMSArray() RESULT DoSampleBias2D() { - return textureOffset(tex2D, input_uvwa.xy, fetch_offset.xy, debugsample.gles_bias); + return textureOffset(tex2D, v2f_uvwa.xy, fetch_offset.xy, debugsample.gles_bias); } RESULT DoSampleBias3D() { - return textureOffset(tex3D, input_uvwa.xyz, fetch_offset.xyz, debugsample.gles_bias); + return textureOffset(tex3D, v2f_uvwa.xyz, fetch_offset.xyz, debugsample.gles_bias); } RESULT DoSampleBiasCube() @@ -217,7 +217,7 @@ RESULT DoSampleBiasCube() #if FLOAT_TEX // no offsets for cubes - return texture(texCube, input_uvwa.xyz, debugsample.gles_bias); + return texture(texCube, v2f_uvwa.xyz, debugsample.gles_bias); #else // cubes are only handled on float type @@ -227,7 +227,7 @@ RESULT DoSampleBiasCube() RESULT DoSampleBias2DArray() { - return textureOffset(tex2DArray, input_uvwa.xyz, fetch_offset.xy, debugsample.gles_bias); + return textureOffset(tex2DArray, v2f_uvwa.xyz, fetch_offset.xy, debugsample.gles_bias); } #ifdef TEXSAMPLE_CUBE_ARRAY @@ -236,7 +236,7 @@ RESULT DoSampleBiasCubeArray() #if FLOAT_TEX // no offsets for cubes - return texture(texCubeArray, input_uvwa.xyzw, debugsample.gles_bias); + return texture(texCubeArray, v2f_uvwa.xyzw, debugsample.gles_bias); #else // cubes are only handled on float type @@ -249,7 +249,7 @@ RESULT DoSampleDrefBias2D() { #if FLOAT_TEX - return vec4(textureOffset(tex2DShadow, vec3(input_uvwa.xy, debugsample.compare), fetch_offset.xy, + return vec4(textureOffset(tex2DShadow, vec3(v2f_uvwa.xy, debugsample.compare), fetch_offset.xy, debugsample.gles_bias), 0, 0, 0); @@ -265,23 +265,23 @@ RESULT DoSampleDrefBias2D() #ifdef OPENGL_CORE RESULT DoQueryLod1D() { - return RESULT(FLOAT_CONV(textureQueryLod(tex1D, input_uvwa.x)), 0, 0); + return RESULT(FLOAT_CONV(textureQueryLod(tex1D, v2f_uvwa.x)), 0, 0); } RESULT DoQueryLod2D() { - return RESULT(FLOAT_CONV(textureQueryLod(tex2D, input_uvwa.xy)), 0, 0); + return RESULT(FLOAT_CONV(textureQueryLod(tex2D, v2f_uvwa.xy)), 0, 0); } RESULT DoQueryLod3D() { - return RESULT(FLOAT_CONV(textureQueryLod(tex3D, input_uvwa.xyz)), 0, 0); + return RESULT(FLOAT_CONV(textureQueryLod(tex3D, v2f_uvwa.xyz)), 0, 0); } RESULT DoQueryLodCube() { #if FLOAT_TEX - return RESULT(FLOAT_CONV(textureQueryLod(texCube, input_uvwa.xyz)), 0, 0); + return RESULT(FLOAT_CONV(textureQueryLod(texCube, v2f_uvwa.xyz)), 0, 0); #else // cubes are only handled on float type return RESULT(0, 0, 0, 0); @@ -290,19 +290,19 @@ RESULT DoQueryLodCube() RESULT DoQueryLod1DArray() { - return RESULT(FLOAT_CONV(textureQueryLod(tex1DArray, input_uvwa.x)), 0, 0); + return RESULT(FLOAT_CONV(textureQueryLod(tex1DArray, v2f_uvwa.x)), 0, 0); } RESULT DoQueryLod2DArray() { - return RESULT(FLOAT_CONV(textureQueryLod(tex2DArray, input_uvwa.xy)), 0, 0); + return RESULT(FLOAT_CONV(textureQueryLod(tex2DArray, v2f_uvwa.xy)), 0, 0); } #ifdef TEXSAMPLE_CUBE_ARRAY RESULT DoQueryLodCubeArray() { #if FLOAT_TEX - return RESULT(FLOAT_CONV(textureQueryLod(texCubeArray, input_uvwa.xyz)), 0, 0); + return RESULT(FLOAT_CONV(textureQueryLod(texCubeArray, v2f_uvwa.xyz)), 0, 0); #else // cubes are only handled on float type return RESULT(0, 0, 0, 0); diff --git a/renderdoc/data/glsl/shaderdebug_sample.vert b/renderdoc/data/glsl/shaderdebug_sample.vert index 60a38ea25..91a70c387 100644 --- a/renderdoc/data/glsl/shaderdebug_sample.vert +++ b/renderdoc/data/glsl/shaderdebug_sample.vert @@ -24,7 +24,10 @@ #include "glsl_globals.h" -layout(location = 0) out vec4 uvwa; +#ifdef VULKAN +layout(location = 0) +#endif + out vec4 v2f_uvwa; #ifdef VULKAN @@ -59,9 +62,9 @@ void main(void) #endif gl_Position = verts[VERTEX_ID]; - uvwa = in_uvwa; + v2f_uvwa = in_uvwa; if(VERTEX_ID == 1) - uvwa.xyz += in_ddx.xyz; + v2f_uvwa.xyz += in_ddx.xyz; else if(VERTEX_ID == 2) - uvwa.xyz += in_ddy.xyz; + v2f_uvwa.xyz += in_ddy.xyz; }