From caecb317510b69b7dca0b22a97340c7057fb8191 Mon Sep 17 00:00:00 2001 From: Jupeyy Date: Sat, 16 Dec 2023 23:43:22 +0100 Subject: [PATCH] Fix multi sampling accuracy --- data/shader/tile_border.frag | 2 +- data/shader/vulkan/tile_border.frag | 2 +- src/engine/client/backend/glsl_shader_compiler.cpp | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/data/shader/tile_border.frag b/data/shader/tile_border.frag index a186901c317..2182dd97967 100644 --- a/data/shader/tile_border.frag +++ b/data/shader/tile_border.frag @@ -9,7 +9,7 @@ uniform sampler2DArray gTextureSampler; uniform vec4 gVertColor; #ifdef TW_TILE_TEXTURED -noperspective in vec3 TexCoord; +noperspective centroid in vec3 TexCoord; #endif out vec4 FragClr; diff --git a/data/shader/vulkan/tile_border.frag b/data/shader/vulkan/tile_border.frag index 31166b66155..841a3f4d4d8 100644 --- a/data/shader/vulkan/tile_border.frag +++ b/data/shader/vulkan/tile_border.frag @@ -10,7 +10,7 @@ layout(push_constant) uniform SVertexColorBO { } gColorBO; #ifdef TW_TILE_TEXTURED -layout (location = 0) noperspective in vec3 TexCoord; +layout (location = 0) noperspective centroid in vec3 TexCoord; #endif layout (location = 0) out vec4 FragClr; diff --git a/src/engine/client/backend/glsl_shader_compiler.cpp b/src/engine/client/backend/glsl_shader_compiler.cpp index 1077221acd3..f4c6fa095d8 100644 --- a/src/engine/client/backend/glsl_shader_compiler.cpp +++ b/src/engine/client/backend/glsl_shader_compiler.cpp @@ -84,6 +84,8 @@ void CGLSLCompiler::ParseLine(std::string &Line, const char *pReadLine, EGLSLSha //search for 'in' or 'out' while(*pBuff && ((*pBuff != 'i' || *(pBuff + 1) != 'n') && (*pBuff != 'o' || (*(pBuff + 1) && *(pBuff + 1) != 'u') || *(pBuff + 2) != 't'))) { + // append anything that is inbetween noperspective & in/out vars + Line.push_back(*pBuff); ++pBuff; }