Skip to content

cameraEffects: make sRGB conversion work in older GLSL#1738

Merged
illwieckz merged 1 commit intomasterfrom
illwieckz/srgb-oldglsl
Aug 11, 2025
Merged

cameraEffects: make sRGB conversion work in older GLSL#1738
illwieckz merged 1 commit intomasterfrom
illwieckz/srgb-oldglsl

Conversation

@illwieckz
Copy link
Member

I don't know which GLSL version allowed mix() to received both bvec3 and vec3, maybe I can just use the second writing everytime, I don't know if using bvec3 as input brings some optimizations or not.

@illwieckz illwieckz added T-Improvement Improvement for an existing feature A-Renderer labels Aug 8, 2025
@illwieckz illwieckz changed the title cameraEffects: make sRGB conversion work on older GLSL cameraEffects: make sRGB conversion work in older GLSL Aug 8, 2025
@illwieckz illwieckz force-pushed the illwieckz/srgb-oldglsl branch from edbefc9 to 13b3322 Compare August 8, 2025 20:59
@slipher
Copy link
Member

slipher commented Aug 11, 2025

LGTM

@illwieckz
Copy link
Member Author

With MESA_GL_VERSION_OVERRIDE and MESA_GLSL_VERSION OVERRIDE, without this branch I get the error with GL 2.1 and GLSL 120 but not with GL 3.0 and GLSL 130, so I assume that version test is correct.

@illwieckz illwieckz merged commit 366c736 into master Aug 11, 2025
9 checks passed
@illwieckz illwieckz deleted the illwieckz/srgb-oldglsl branch August 11, 2025 22:45
@illwieckz
Copy link
Member Author

For reference the compilation error message was:

Warn: Compile log:
0:108(10): error: no matching function for call to `mix(vec3, vec3, bvec3)'; candidates are:
0:108(10): error:    float mix(float, float, float)
0:108(10): error:    vec2 mix(vec2, vec2, float)
0:108(10): error:    vec3 mix(vec3, vec3, float)
0:108(10): error:    vec4 mix(vec4, vec4, float)
0:108(10): error:    vec2 mix(vec2, vec2, vec2)
0:108(10): error:    vec3 mix(vec3, vec3, vec3)
0:108(10): error:    vec4 mix(vec4, vec4, vec4)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Renderer T-Improvement Improvement for an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants