Skip to content

Commit

Permalink
Fix signedness mess-ups in shaders
Browse files Browse the repository at this point in the history
  • Loading branch information
wheremyfoodat committed Jul 18, 2024
1 parent e36b6c7 commit 7f593bd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/core/PICA/shader_gen_glsl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
)";
}
Expand Down
2 changes: 1 addition & 1 deletion src/host_shaders/opengl_fragment_shader.frag
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 7f593bd

Please sign in to comment.