Attempt to fix GLSL errors on Blender startup.

I couldn't reproduce either, but calling min() with different argument
data types and indexing vectors with an index not known at compile time
seem likely to cause problems.

Ref T52404, T52404.
This commit is contained in:
Brecht Van Lommel 2017-08-15 17:52:58 +02:00
parent 84d33023ab
commit b68b26c265
Notes: blender-bot 2023-02-14 06:55:44 +01:00
Referenced by issue #52404, can't open blender windows 64bit
Referenced by issue #51644, Crash upon Startup
2 changed files with 9 additions and 7 deletions

View File

@ -55,7 +55,7 @@ void get_max_horizon_grouped(vec4 co1, vec4 co2, vec3 x, float lod, inout float
}
#define MAX_ITER 16
#define MAX_LOD 6
#define MAX_LOD 6.0
#define QUALITY 0.75
vec2 search_horizon_sweep(vec2 t_phi, vec3 pos, vec2 uvs, float jitter, vec2 max_dir)
{

View File

@ -39,16 +39,18 @@ void main()
}
#ifdef USE_AXIS
finalColor.rgb = vec3(0.0);
finalColor[axis] = 1.0;
if (axis == 0)
finalColor = vec4(1.0, 0.0, 0.0, 1.0);
else if (axis == 1)
finalColor = vec4(0.0, 1.0, 0.0, 1.0);
else
finalColor = vec4(0.0, 0.0, 1.0, 1.0);
#else
if (val < 0.0) {
finalColor.rgb = color;
finalColor = vec4(color, 1.0);
}
else {
finalColor.rgb = texture(ramp, val).rgb;
finalColor = vec4(texture(ramp, val).rgb, 1.0);
}
#endif
finalColor.a = 1.0;
}