From 833d73df09ee8925b7b4f5592611ad320b25e363 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Thu, 20 Jul 2023 18:18:53 +0200 Subject: [PATCH] shaders: short-circuit rounding if radius <= 0 --- src/render/shaders/Textures.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/render/shaders/Textures.hpp b/src/render/shaders/Textures.hpp index e571d6626..0928487fa 100644 --- a/src/render/shaders/Textures.hpp +++ b/src/render/shaders/Textures.hpp @@ -120,8 +120,10 @@ void main() { pixColor[2] = pixColor[2] * tint[2]; } + if (radius > 0.0) { )#" + ROUNDED_SHADER_FUNC("pixColor") + R"#( + } gl_FragColor = pixColor * alpha; })#"; @@ -167,8 +169,10 @@ void main() { pixColor[2] = pixColor[2] * tint[2]; } + if (radius > 0.0) { )#" + ROUNDED_SHADER_FUNC("pixColor") + R"#( + } gl_FragColor = pixColor * alpha; })#"; @@ -255,8 +259,10 @@ void main() { pixColor[2] = pixColor[2] * tint[2]; } + if (radius > 0.0) { )#" + ROUNDED_SHADER_FUNC("pixColor") + R"#( + } gl_FragColor = pixColor * alpha; }