i965: Keep track of whether LRI is allowed in the context struct.
authorFrancisco Jerez <currojerez@riseup.net>
Thu, 3 Sep 2015 14:08:16 +0000 (17:08 +0300)
committerFrancisco Jerez <currojerez@riseup.net>
Wed, 9 Dec 2015 11:46:04 +0000 (13:46 +0200)
This stores the result of can_do_pipelined_register_writes() in the
context struct so we can find out later whether LRI can be used to
program the L3 configuration.

v2:
 * Split change of gen check in can_do_pipelined_register_writes (jljusten)

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/intel_extensions.c

index abc6d564cf8208b266b89051800a6f9acc6aeace..2fee6a7797f28762ae3383c0faa3612dec34a881 100644 (file)
@@ -865,6 +865,11 @@ struct brw_context
    bool use_rep_send;
    bool use_resource_streamer;
 
+   /**
+    * Whether LRI can be used to write register values from the batch buffer.
+    */
+   bool can_do_pipelined_register_writes;
+
    /**
     * Some versions of Gen hardware don't do centroid interpolation correctly
     * on unlit pixels, causing incorrect values for derivatives near triangle
index 8a1ec324e2ca62f055ee2f422e7e6af8dd640517..2fde0740b4713cc5ea3ad9c17c28981cc773a16f 100644 (file)
@@ -320,6 +320,8 @@ intelInitExtensions(struct gl_context *ctx)
    }
 
    brw->predicate.supported = false;
+   brw->can_do_pipelined_register_writes =
+      can_do_pipelined_register_writes(brw);
 
    if (brw->gen >= 7) {
       ctx->Extensions.ARB_conservative_depth = true;
@@ -336,7 +338,7 @@ intelInitExtensions(struct gl_context *ctx)
       ctx->Extensions.ARB_shader_storage_buffer_object = true;
       ctx->Extensions.EXT_shader_samples_identical = true;
 
-      if (can_do_pipelined_register_writes(brw)) {
+      if (brw->can_do_pipelined_register_writes) {
          ctx->Extensions.ARB_draw_indirect = true;
          ctx->Extensions.ARB_transform_feedback2 = true;
          ctx->Extensions.ARB_transform_feedback3 = true;