[Mesa-dev] [RFC 12/20] mesa: add _Linked helper to gl_shader_program struct
Tapani Pälli
tapani.palli at intel.com
Mon Jun 2 05:05:53 PDT 2014
This boolean indicates if program has ever been linked succesfully,
will be used by binary shader cache to detect relinking.
Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
---
src/mesa/main/mtypes.h | 1 +
src/mesa/program/ir_to_mesa.cpp | 2 ++
2 files changed, 3 insertions(+)
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 917d071..688a3bd 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2747,6 +2747,7 @@ struct gl_shader_program
GLboolean LinkStatus; /**< GL_LINK_STATUS */
GLboolean Validated;
GLboolean _Used; /**< Ever used for drawing? */
+ GLboolean _Linked; /**< Ever linked? */
GLchar *InfoLog;
unsigned Version; /**< GLSL version used for linking */
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index 59cf123..b3fab72 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -3091,6 +3091,8 @@ _mesa_glsl_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
if (prog->LinkStatus) {
if (!ctx->Driver.LinkShader(ctx, prog)) {
prog->LinkStatus = GL_FALSE;
+ } else {
+ prog->_Linked = GL_TRUE;
}
}
--
1.8.3.1
More information about the mesa-dev
mailing list