From b80e3f0ad7934518afc841b3c3270d45c43eb51d Mon Sep 17 00:00:00 2001 From: sfan5 Date: Fri, 9 Jan 2026 19:19:26 +0100 Subject: [PATCH] Avoid inVertexColor name collision --- client/shaders/Irrlicht/Renderer2D.vsh | 4 ++-- client/shaders/Irrlicht/Solid.vsh | 4 ++-- irr/include/EVertexAttributes.h | 2 +- src/client/shader.cpp | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/client/shaders/Irrlicht/Renderer2D.vsh b/client/shaders/Irrlicht/Renderer2D.vsh index 0d9c1ba60c..13fd094a38 100644 --- a/client/shaders/Irrlicht/Renderer2D.vsh +++ b/client/shaders/Irrlicht/Renderer2D.vsh @@ -3,7 +3,7 @@ /* Attributes */ attribute vec4 inVertexPosition; -attribute vec4 inVertexColor; +attribute vec4 inVertexColor_raw; attribute vec2 inTexCoord0; /* Uniforms */ @@ -24,5 +24,5 @@ void main() gl_Position = uProjection * (inVertexPosition + vec4(0.375, 0.375, 0.0, 0.0)); gl_PointSize = uThickness; vTextureCoord = inTexCoord0; - vVertexColor = inVertexColor.bgra; + vVertexColor = inVertexColor_raw.bgra; } diff --git a/client/shaders/Irrlicht/Solid.vsh b/client/shaders/Irrlicht/Solid.vsh index fd7467f5ce..bda28b2ee4 100644 --- a/client/shaders/Irrlicht/Solid.vsh +++ b/client/shaders/Irrlicht/Solid.vsh @@ -4,7 +4,7 @@ attribute vec3 inVertexPosition; attribute vec3 inVertexNormal; -attribute vec4 inVertexColor; +attribute vec4 inVertexColor_raw; attribute vec2 inTexCoord0; /* Uniforms */ @@ -29,7 +29,7 @@ void main() vec4 TextureCoord0 = vec4(inTexCoord0.x, inTexCoord0.y, 1.0, 1.0); vTextureCoord0 = vec4(uTMatrix0 * TextureCoord0).xy; - vVertexColor = inVertexColor.bgra; + vVertexColor = inVertexColor_raw.bgra; vec3 Position = (uWVMatrix * vec4(inVertexPosition, 1.0)).xyz; diff --git a/irr/include/EVertexAttributes.h b/irr/include/EVertexAttributes.h index 9af92953c7..feb1a121f2 100644 --- a/irr/include/EVertexAttributes.h +++ b/irr/include/EVertexAttributes.h @@ -21,7 +21,7 @@ enum E_VERTEX_ATTRIBUTES const char *const sBuiltInVertexAttributeNames[] = { "inVertexPosition", "inVertexNormal", - "inVertexColor", + "inVertexColor_raw", // (BGRA <-> RGBA swapped) "inVertexAux", "inTexCoord0", "inTexCoord1", diff --git a/src/client/shader.cpp b/src/client/shader.cpp index 034a8ffb12..52dff3d2c5 100644 --- a/src/client/shader.cpp +++ b/src/client/shader.cpp @@ -720,7 +720,7 @@ void ShaderSource::generateShader(ShaderInfo &shaderinfo) ATTRIBUTE_(0) highp vec4 inVertexPosition; ATTRIBUTE_(1) mediump vec3 inVertexNormal; - ATTRIBUTE_(2) lowp vec4 inVertexColor; + ATTRIBUTE_(2) lowp vec4 inVertexColor_raw; ATTRIBUTE_(3) mediump float inVertexAux; ATTRIBUTE_(4) mediump vec2 inTexCoord0; ATTRIBUTE_(5) mediump vec2 inTexCoord1; @@ -734,7 +734,7 @@ void ShaderSource::generateShader(ShaderInfo &shaderinfo) } // Our vertex color has components reversed compared to what OpenGL // normally expects, so we need to take that into account. - vertex_header += "#define inVertexColor (inVertexColor.bgra)\n"; + vertex_header += "#define inVertexColor (inVertexColor_raw.bgra)\n"; fragment_header = ""; if (use_glsl3) {