mesa/glsl: add api_enabled flag to gl_transform_feedback_info
authorTimothy Arceri <timothy.arceri@collabora.com>
Sat, 19 Nov 2016 05:16:08 +0000 (16:16 +1100)
committerJordan Justen <jordan.l.justen@intel.com>
Wed, 1 Nov 2017 06:36:54 +0000 (23:36 -0700)
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.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/compiler/glsl/link_varyings.cpp
src/mesa/main/mtypes.h

index 70e4b8c7f703c6c42d472857c6ade6049500ab18..66a20a2c9b668e1a6136924246f8bdebfcf81adb 100644 (file)
@@ -1316,9 +1316,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,
index b7a46aed5349c0c7d91934a80f4f3029ef95868a..2acf64eb56df96691bbfecfcad3826eb42d33bec 100644 (file)
@@ -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. */