From 7f593bd3a6effd4e074f4e9986167cf2238e4827 Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Fri, 19 Jul 2024 01:29:48 +0300 Subject: [PATCH] Fix signedness mess-ups in shaders --- src/core/PICA/shader_gen_glsl.cpp | 4 ++-- src/host_shaders/opengl_fragment_shader.frag | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/PICA/shader_gen_glsl.cpp b/src/core/PICA/shader_gen_glsl.cpp index 136647d70..6c6cd78c9 100644 --- a/src/core/PICA/shader_gen_glsl.cpp +++ b/src/core/PICA/shader_gen_glsl.cpp @@ -147,11 +147,11 @@ std::string FragmentGenerator::generate(const PICARegs& regs, const FragmentConf } float lutLookup(uint lut, int index) { - return texelFetch(u_tex_lighting_lut, ivec2(index, lut), 0).r; + return texelFetch(u_tex_lighting_lut, ivec2(index, int(lut)), 0).r; } vec3 regToColor(uint reg) { - return (1.0 / 255.0) * vec3(float((reg >> 20) & 0xFF), float((reg >> 10) & 0xFF), float(reg & 0xFF)); + return (1.0 / 255.0) * vec3(float((reg >> 20u) & 0xFFu), float((reg >> 10u) & 0xFFu), float(reg & 0xFFu)); } )"; } diff --git a/src/host_shaders/opengl_fragment_shader.frag b/src/host_shaders/opengl_fragment_shader.frag index 6a2baa963..9f369e39b 100644 --- a/src/host_shaders/opengl_fragment_shader.frag +++ b/src/host_shaders/opengl_fragment_shader.frag @@ -161,7 +161,7 @@ bool error_unimpl = false; vec4 unimpl_color = vec4(1.0, 0.0, 1.0, 1.0); float lutLookup(uint lut, int index) { - return texelFetch(u_tex_lighting_lut, ivec2(index, lut), 0).r; + return texelFetch(u_tex_lighting_lut, ivec2(index, int(lut)), 0).r; } vec3 regToColor(uint reg) {