summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Arceri <timothy.arceri@collabora.com>2016-11-19 16:16:08 +1100
committerJordan Justen <jordan.l.justen@intel.com>2017-10-22 02:21:21 -0700
commit5b146e2a66d9464ef8b7cf30d6da117bda986c41 (patch)
treef62f787690dfbe633786dcf8d1b4bf9b1efc2999
parent81007e7976c0713e3dc0d58152f69b10c3590ef5 (diff)
mesa/glsl: add api_enabled flag to gl_transform_feedback_info
This will be used to disable the shader cache when xfb is enabled via the api as we don't currently allow for it when generating the sha for the shader.
-rw-r--r--src/compiler/glsl/link_varyings.cpp5
-rw-r--r--src/mesa/main/mtypes.h3
2 files changed, 7 insertions, 1 deletions
diff --git a/src/compiler/glsl/link_varyings.cpp b/src/compiler/glsl/link_varyings.cpp
index 69c92bf53b..95773ccaa6 100644
--- a/src/compiler/glsl/link_varyings.cpp
+++ b/src/compiler/glsl/link_varyings.cpp
@@ -1126,9 +1126,12 @@ store_tfeedback_info(struct gl_context *ctx, struct gl_shader_program *prog,
* however some drivers expect to receive the list of transform feedback
* declarations in order so sort it now for convenience.
*/
- if (has_xfb_qualifiers)
+ if (has_xfb_qualifiers) {
qsort(tfeedback_decls, num_tfeedback_decls, sizeof(*tfeedback_decls),
cmp_xfb_offset);
+ } else {
+ xfb_prog->sh.LinkedTransformFeedback->api_enabled = true;
+ }
xfb_prog->sh.LinkedTransformFeedback->Varyings =
rzalloc_array(xfb_prog, struct gl_transform_feedback_varying_info,
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index b7a46aed53..2acf64eb56 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1779,6 +1779,9 @@ struct gl_transform_feedback_buffer
/** Post-link transform feedback info. */
struct gl_transform_feedback_info
{
+ /* Was xfb enabled via the api or in shader layout qualifiers */
+ bool api_enabled;
+
unsigned NumOutputs;
/* Bitmask of active buffer indices. */