summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/shaderapi.c
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2017-03-09 22:58:37 +1100
committerTimothy Arceri <[email protected]>2017-03-12 17:24:40 +1100
commitbfa95997c4ecf74a329a047359d5e8d1217da49b (patch)
tree49f64331b9c2af6e09d443aae92d1e667320bfa4 /src/mesa/main/shaderapi.c
parent3d253d330a47eb06bd4745c3ee41c4aa9d6143be (diff)
mesa/glsl: introduce new gl_compile_status enum
This will allow us to tell if a shader really has been compiled or if the shader cache has just seen it before. Acked-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa/main/shaderapi.c')
-rw-r--r--src/mesa/main/shaderapi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index 0c38cea2555..ba69ede0e84 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -903,7 +903,7 @@ get_shaderiv(struct gl_context *ctx, GLuint name, GLenum pname, GLint *params)
*params = shader->DeletePending;
break;
case GL_COMPILE_STATUS:
- *params = shader->CompileStatus;
+ *params = shader->CompileStatus ? GL_TRUE : GL_FALSE;
break;
case GL_INFO_LOG_LENGTH:
*params = (shader->InfoLog && shader->InfoLog[0] != '\0') ?
@@ -1003,7 +1003,7 @@ shader_source(struct gl_shader *sh, const GLchar *source)
{
assert(sh);
- if (sh->CompileStatus == GL_TRUE && !sh->FallbackSource) {
+ if (sh->CompileStatus == compile_skipped && !sh->FallbackSource) {
/* If shader was previously compiled back-up the source in case of cache
* fallback.
*/
@@ -1034,7 +1034,7 @@ _mesa_compile_shader(struct gl_context *ctx, struct gl_shader *sh)
/* If the user called glCompileShader without first calling
* glShaderSource, we should fail to compile, but not raise a GL_ERROR.
*/
- sh->CompileStatus = GL_FALSE;
+ sh->CompileStatus = compile_failure;
} else {
if (ctx->_Shader->Flags & GLSL_DUMP) {
_mesa_log("GLSL source for %s shader %d:\n",