build: refuse to use broken glslang for validation

See #237, KhronosGroup/glslang#2206
This commit is contained in:
Andrei Alexeyev 2020-11-24 05:52:02 +02:00
parent bb3a809117
commit 01cc9b1a2b
No known key found for this signature in database
GPG key ID: 363707CD4C7FE8A4
2 changed files with 21 additions and 19 deletions

View file

@ -8,5 +8,8 @@ layout(location = 0) uniform sampler2D tex;
layout(location = 1) uniform vec4 color;
void main(void) {
outColor = texture(tex, texCoord) * color;
// https://github.com/KhronosGroup/glslang/issues/2206
float foo = 42;
foo = smoothstep(0, 1, foo);
outColor = texture(tex, texCoord) * color * foo;
}

View file

@ -170,30 +170,29 @@ if validate_glsl != 'false'
if test_result.returncode() == 0
glslc_args += '-Werror'
validate_glsl = true
else
glslc_args += '-std=430core'
warning('glslc does not support GL_ARB_explicit_uniform_location, forcing shader version to 430core as a workaround.\n\n@0@'.format(test_result.stderr()))
endif
test_result = run_command(glslc_command,
glslc_args,
glslc_frag_args,
glslc_test_basic_file,
'-o', '-',
capture : false
)
test_result = run_command(glslc_command,
glslc_args,
glslc_frag_args,
glslc_test_basic_file,
'-o', '-',
capture : false
)
if test_result.returncode() == 0
validate_glsl = true
if test_result.returncode() == 0
validate_glsl = true
else
warning(test_result.stderr())
if validate_glsl == 'auto'
warning('Basic glslc test failed, you probably have a broken/incompatible version. GLSL validation will be disabled.')
validate_glsl = false
else
warning(test_result.stderr())
if validate_glsl == 'auto'
warning('glslc test failed, you probably have an incompatible version. GLSL validation will be disabled.')
validate_glsl = false
else
error('glslc test failed, you probably have an incompatible version.')
endif
error('Basic glslc test failed, you probably have a broken/incompatible version.')
endif
endif
else