diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index a3377a659c3..1e64317ff10 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -2149,12 +2149,19 @@ static const char *fs_hack_gamma_frag_shader_src = "\n" "layout(location = 0) out vec4 outColor;\n" "\n" +"vec3 color_from_index(vec3 index)\n" +"{\n" +" ivec3 i = ivec3(index);\n" +" return vec3(values[i.r].r, values[i.g].g, values[i.b].b);\n" +"}\n" +"\n" "void main(void)\n" "{\n" -" vec4 lookup = texture(tex, texCoord) * 255.0;\n" -" outColor.r = values[int(lookup.r)].r;\n" -" outColor.g = values[int(lookup.g)].g;\n" -" outColor.b = values[int(lookup.b)].b;\n" +" vec3 lookup = texture(tex, texCoord).xyz * 255.0;\n" +" vec3 lookup1, lookup2;\n" +" lookup1 = floor(lookup);\n" +" lookup2 = ceil(lookup);\n" +" outColor.xyz = mix(color_from_index(lookup1), color_from_index(lookup2), lookup - lookup1);\n" " outColor.a = 1.0;\n" "}\n" ;