i965: add support for cached shaders with xfb qualifiers
authorTimothy Arceri <timothy.arceri@collabora.com>
Mon, 23 Jan 2017 21:35:51 +0000 (08:35 +1100)
committerJordan Justen <jordan.l.justen@intel.com>
Wed, 1 Nov 2017 06:36:54 +0000 (23:36 -0700)
For now this disables the shader cache when transform feedback is
enabled via the GL 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/mesa/drivers/dri/i965/brw_disk_cache.c

index eef58d5ba3f855fe0f79ac63f55f8723aff5564e..f05ef853bfcf62b453e0bbed2549d0bdc669308b 100644 (file)
@@ -250,6 +250,14 @@ brw_disk_cache_upload_program(struct brw_context *brw, gl_shader_stage stage)
    if (prog == NULL)
       return false;
 
+   /* FIXME: For now we don't read from the cache if transform feedback is
+    * enabled via the API. However the shader cache does support transform
+    * feedback when enabled via in shader xfb qualifiers.
+    */
+   if (prog->sh.LinkedTransformFeedback &&
+       prog->sh.LinkedTransformFeedback->api_enabled)
+      return false;
+
    if (prog->sh.data->LinkStatus != linking_skipped)
       goto fail;