glsl: fail compilation of compute shaders when unsupported
authorIago Toral Quiroga <itoral@igalia.com>
Fri, 14 Oct 2016 12:21:18 +0000 (14:21 +0200)
committerIago Toral Quiroga <itoral@igalia.com>
Mon, 17 Oct 2016 13:14:12 +0000 (15:14 +0200)
commit8785a8ff8948385a913e9bd75e8cdd1092bd750f
treef506952a8b4fcb431d4cc2f906b1588dcb3e2ccf
parent3d48353e299c1f6ab4dc331c70074fe69dbfcc6d
glsl: fail compilation of compute shaders when unsupported

Generally, we only check for the presence of compute shaders during
parsing when we find any language (like layout qualifiers) that are
specific to compute shaders, however, it is possible to define an
empty compute shader does not use any language specific to compute
shaders at all and we should fail the compilation anyway. dEQP checks
this.

This patch adds a check for compute shader availability after we have
parsed the source code. At this point we know the effective GLSL version
and also extensions enabled in the shader.

Fixes a subcase of the following dEQP tests:
dEQP-GLES31.functional.debug.negative_coverage.callbacks.shader.compile_compute_shader
dEQP-GLES31.functional.debug.negative_coverage.get_error.shader.compile_compute_shader
dEQP-GLES31.functional.debug.negative_coverage.log.shader.compile_compute_shader

The tests still fail because there is one more subcase that fails that needs
another fix.

Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
src/compiler/glsl/glsl_parser_extras.cpp