diff options
author | Nicolai Hähnle <[email protected]> | 2017-06-10 19:57:18 +0200 |
---|---|---|
committer | Eduardo Lima Mitev <[email protected]> | 2017-12-12 08:18:32 +0100 |
commit | accb7d439094ce284b139a5e87930b489702f8eb (patch) | |
tree | f431b6bbb252430b0d0349b6f4758f5edbd178b3 /src/mesa/main/shaderapi.c | |
parent | 4ccd00d7626b26f8aac02fe71508951223f9ad45 (diff) |
mesa: refuse to compile SPIR-V shaders or link mixed shaders
Note that gl_shader::CompileStatus will also indicate whether a shader
has been successfully specialized.
v2: Use the 'spirv_data' member of gl_shader to know if it is a SPIR-V
shader, instead of a dedicated flag. (Timothy Arceri)
v3: Use bool instead of GLboolean. (Ian Romanick)
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/main/shaderapi.c')
-rw-r--r-- | src/mesa/main/shaderapi.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index 0f65cb0a967..d824a88ca2f 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -1097,6 +1097,18 @@ _mesa_compile_shader(struct gl_context *ctx, struct gl_shader *sh) if (!sh) return; + /* The GL_ARB_gl_spirv spec says: + * + * "Add a new error for the CompileShader command: + * + * An INVALID_OPERATION error is generated if the SPIR_V_BINARY_ARB + * state of <shader> is TRUE." + */ + if (sh->spirv_data) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glCompileShader(SPIR-V)"); + return; + } + if (!sh->Source) { /* If the user called glCompileShader without first calling * glShaderSource, we should fail to compile, but not raise a GL_ERROR. |