Skip to content

Commit

Permalink
build: refuse to use broken glslang for validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Akaricchi committed Nov 24, 2020
1 parent bb3a809 commit 01cc9b1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
5 changes: 4 additions & 1 deletion misc/glslc-test-basic.frag.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
35 changes: 17 additions & 18 deletions resources/00-taisei.pkgdir/shader/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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
else
warning(test_result.stderr())
if test_result.returncode() == 0
validate_glsl = true
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
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
error('Basic glslc test failed, you probably have a broken/incompatible version.')
endif
endif
else
Expand Down

0 comments on commit 01cc9b1

Please sign in to comment.