[Mesa-dev] [PATCH 11/27] mesa/glsl: add api_enabled flag to gl_transform_feedback_info

Jordan Justen jordan.l.justen at intel.com
Sat Aug 19 07:44:27 UTC 2017


From: Timothy Arceri <timothy.arceri at collabora.com>

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.
---
 src/compiler/glsl/link_varyings.cpp | 5 ++++-
 src/mesa/main/mtypes.h              | 3 +++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/compiler/glsl/link_varyings.cpp b/src/compiler/glsl/link_varyings.cpp
index de3754c423..21fee32935 100644
--- a/src/compiler/glsl/link_varyings.cpp
+++ b/src/compiler/glsl/link_varyings.cpp
@@ -1074,9 +1074,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 25e90bad53..cb69d39d98 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. */
-- 
2.14.0



More information about the mesa-dev mailing list