summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/shaderapi.c
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2017-02-04 10:46:53 +1100
committerTimothy Arceri <[email protected]>2017-02-09 12:22:56 +1100
commita3fd8bb8c58e35ef06928fe0c565480b0e8f6343 (patch)
treec69b33074384b952b1b2f3daad7bb307e9e29f67 /src/mesa/main/shaderapi.c
parentac5845453c655a08ecabe3a891a3d2d9fea39866 (diff)
st/mesa/i965: create link status enum
For the on-disk shader cache we want to be able to differentiate between a program that was linked and one that was loaded from cache. V2: - don't return the new enum directly to the application when queried, instead return GL_TRUE or GL_FALSE as required. Fixes google-chrome corruptions when using cache. Reviewed-by: Anuj Phogat <[email protected]>
Diffstat (limited to 'src/mesa/main/shaderapi.c')
-rw-r--r--src/mesa/main/shaderapi.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index 4667866ca06..4406aaa9803 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -636,7 +636,7 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname,
*params = shProg->DeletePending;
return;
case GL_LINK_STATUS:
- *params = shProg->data->LinkStatus;
+ *params = shProg->data->LinkStatus ? GL_TRUE : GL_FALSE;
return;
case GL_VALIDATE_STATUS:
*params = shProg->data->Validated;
@@ -815,7 +815,7 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname,
}
case GL_PROGRAM_SEPARABLE:
/* If the program has not been linked, return initial value 0. */
- *params = (shProg->data->LinkStatus == GL_FALSE) ? 0 : shProg->SeparateShader;
+ *params = (shProg->data->LinkStatus == linking_failure) ? 0 : shProg->SeparateShader;
return;
/* ARB_tessellation_shader */
@@ -1160,7 +1160,7 @@ _mesa_link_program(struct gl_context *ctx, struct gl_shader_program *shProg)
ralloc_free(filename);
}
- if (shProg->data->LinkStatus == GL_FALSE &&
+ if (shProg->data->LinkStatus == linking_failure &&
(ctx->_Shader->Flags & GLSL_REPORT_ERRORS)) {
_mesa_debug(ctx, "Error linking program %u:\n%s\n",
shProg->Name, shProg->data->InfoLog);
@@ -2095,7 +2095,7 @@ _mesa_ProgramBinary(GLuint program, GLenum binaryFormat,
* Since any value of binaryFormat passed "is not one of those specified as
* allowable for [this] command, an INVALID_ENUM error is generated."
*/
- shProg->data->LinkStatus = GL_FALSE;
+ shProg->data->LinkStatus = linking_failure;
_mesa_error(ctx, GL_INVALID_ENUM, "glProgramBinary");
}
@@ -2270,7 +2270,7 @@ _mesa_CreateShaderProgramv(GLenum type, GLsizei count,
/* Possibly... */
if (active-user-defined-varyings-in-linked-program) {
append-error-to-info-log;
- shProg->data->LinkStatus = GL_FALSE;
+ shProg->data->LinkStatus = linking_failure;
}
#endif
}