i965: get rid of brw->can_do_pipelined_register_writes
authorIago Toral Quiroga <itoral@igalia.com>
Wed, 4 Jan 2017 08:06:06 +0000 (09:06 +0100)
committerIago Toral Quiroga <itoral@igalia.com>
Thu, 5 Jan 2017 07:43:46 +0000 (08:43 +0100)
Instead, check the screen field directly.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_context.c
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/gen7_l3_state.c
src/mesa/drivers/dri/i965/intel_extensions.c
src/mesa/drivers/dri/i965/intel_screen.h

index 6b390b71f49163c6375db57649fadd3cfd705ec8..3f3da7d20096057aeaaf5de1ecb15600c44e37f0 100644 (file)
@@ -983,8 +983,6 @@ brwCreateContext(gl_api api,
 
    brw->must_use_separate_stencil = devinfo->must_use_separate_stencil;
    brw->has_swizzling = screen->hw_has_swizzling;
-   brw->can_do_pipelined_register_writes =
-      screen->hw_has_pipelined_register & HW_HAS_PIPELINED_SOL_OFFSET;
 
    isl_device_init(&brw->isl_dev, devinfo, screen->hw_has_swizzling);
 
index 17b4256880e9e3fa01e58e102fb5e3064c5e6aa3..113974badc8979d4eeeaf1cd9c3dab25a70ef892 100644 (file)
@@ -830,11 +830,6 @@ 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 e746b995c1e66ccb3c6bb06da04a6ee2e0fb9930..85f8e467f693e54a654d2f7b948d3b00354c5af8 100644 (file)
@@ -229,7 +229,7 @@ emit_l3_state(struct brw_context *brw)
    const float dw_threshold = (brw->ctx.NewDriverState & BRW_NEW_BATCH ?
                                small_dw_threshold : large_dw_threshold);
 
-   if (dw > dw_threshold && brw->can_do_pipelined_register_writes) {
+   if (dw > dw_threshold && can_do_pipelined_register_writes(brw->screen)) {
       const struct gen_l3_config *const cfg =
          gen_get_l3_config(&brw->screen->devinfo, w);
 
@@ -296,7 +296,8 @@ gen7_restore_default_l3_config(struct brw_context *brw)
    const struct gen_device_info *devinfo = &brw->screen->devinfo;
    const struct gen_l3_config *const cfg = gen_get_default_l3_config(devinfo);
 
-   if (cfg != brw->l3.config && brw->can_do_pipelined_register_writes) {
+   if (cfg != brw->l3.config &&
+       can_do_pipelined_register_writes(brw->screen)) {
       setup_l3_config(brw, cfg);
       update_urb_size(brw, cfg);
       brw->l3.config = cfg;
index 17fbc37c1ddcdf3979b5de913164351812f2bef5..8e67b5755a7ec8a5f9f6025a38b4dc166819b57d 100644 (file)
@@ -219,7 +219,7 @@ intelInitExtensions(struct gl_context *ctx)
       if (brw->is_haswell)
          ctx->Extensions.ARB_gpu_shader_fp64 = true;
 
-      if (brw->can_do_pipelined_register_writes) {
+      if (can_do_pipelined_register_writes(brw->screen)) {
          ctx->Extensions.ARB_draw_indirect = true;
          ctx->Extensions.ARB_transform_feedback2 = true;
          ctx->Extensions.ARB_transform_feedback3 = true;
index 62fde0362695b07367e9e5211f4d9a34001739f1..2cbff14f306c6b1fba647f1536f7a29b739738bd 100644 (file)
@@ -127,4 +127,10 @@ void aub_dump_bmp(struct gl_context *ctx);
 const int*
 intel_supported_msaa_modes(const struct intel_screen  *screen);
 
+static inline bool
+can_do_pipelined_register_writes(const struct intel_screen *screen)
+{
+   return screen->hw_has_pipelined_register & HW_HAS_PIPELINED_SOL_OFFSET;
+}
+
 #endif