summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2016-10-31 21:16:50 +1100
committerTimothy Arceri <[email protected]>2016-11-30 14:13:52 +1100
commit34953f8907fddd0d2b27d276580a1d3223047987 (patch)
tree9a16abd121bb24f86c1a02086346508e11ae0fee
parentddf0f097e74d57858238fcdb13003ab5c974abc3 (diff)
mesa/glsl: add bitmask to track stages a program was linked against
This will be used to enable us to store the current gl_program rather than gl_shader_program in the gl_pipline_object allowing us to simplify handing of validation. Also we should not be depending on _LinkedShader for this information as it may contain shaders from a failed linking attempt rather than the current program still in use. We could also use this mask to iterate over the stages during linking with _mesa_bit_scan() rather then the current method of NULL checking each stage. Reviewed-by: Ian Romanick <[email protected]>
-rw-r--r--src/compiler/glsl/linker.cpp1
-rw-r--r--src/mesa/main/mtypes.h3
2 files changed, 4 insertions, 0 deletions
diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index 6f54f75ae1e..d26517ace29 100644
--- a/src/compiler/glsl/linker.cpp
+++ b/src/compiler/glsl/linker.cpp
@@ -4889,6 +4889,7 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
}
prog->_LinkedShaders[stage] = sh;
+ prog->data->linked_stages |= 1 << stage;
}
}
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 26b19653cb8..250877dd6b6 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2652,6 +2652,9 @@ struct gl_shader_program_data
GLboolean LinkStatus; /**< GL_LINK_STATUS */
GLboolean Validated;
GLchar *InfoLog;
+
+ /* Mask of stages this program was linked against */
+ unsigned linked_stages;
};
/**