i965/blorp: Use prog data counters to guide wm/ps setup
authorTopi Pohjolainen <topi.pohjolainen@intel.com>
Wed, 18 May 2016 13:09:49 +0000 (16:09 +0300)
committerTopi Pohjolainen <topi.pohjolainen@intel.com>
Thu, 23 Jun 2016 18:39:09 +0000 (21:39 +0300)
just as core upload logic does.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/gen6_blorp.c
src/mesa/drivers/dri/i965/gen7_blorp.c
src/mesa/drivers/dri/i965/gen8_blorp.c

index 317a5f2dd21b1aa6844af82c071b512f6f908f34..3fc1d57261f7813353011dc16452a0dbc815203c 100644 (file)
@@ -656,7 +656,9 @@ gen6_blorp_emit_wm_config(struct brw_context *brw,
    dw5 |= GEN6_WM_LINE_END_CAP_AA_WIDTH_0_5;
    dw5 |= (brw->max_wm_threads - 1) << GEN6_WM_MAX_THREADS_SHIFT;
    dw6 |= 0 << GEN6_WM_BARYCENTRIC_INTERPOLATION_MODE_SHIFT; /* No interp */
-   dw6 |= 0 << GEN6_WM_NUM_SF_OUTPUTS_SHIFT; /* No inputs from SF */
+   dw6 |= (params->wm_prog_data ? prog_data->num_varying_inputs : 0) <<
+          GEN6_WM_NUM_SF_OUTPUTS_SHIFT;
+
    if (params->wm_prog_data) {
       dw5 |= GEN6_WM_DISPATCH_ENABLE; /* We are rendering */
 
index 92617dbcae39b568596f6b09b000ac7f45a16f55..bb760e787c84bb45e384509819a9458722439865 100644 (file)
@@ -555,6 +555,8 @@ gen7_blorp_emit_ps_config(struct brw_context *brw,
          dw4 |= GEN7_PS_8_DISPATCH_ENABLE;
       if (params->wm_prog_data->dispatch_16)
          dw4 |= GEN7_PS_16_DISPATCH_ENABLE;
+      if (params->wm_prog_data->num_varying_inputs)
+         dw4 |= GEN7_PS_ATTRIBUTE_ENABLE;
    } else {
       /* The hardware gets angry if we don't enable at least one dispatch
        * mode, so just enable 16-pixel dispatch if we don't have a program.
index 8d696cf75ca17a419e56d5ff0255126e31131975..1df2e3b63af9ce1da2d3ef6c09df1c277e364392 100644 (file)
@@ -452,10 +452,11 @@ gen8_blorp_emit_ps_extra(struct brw_context *brw,
 
    dw1 |= GEN8_PSX_PIXEL_SHADER_VALID;
 
-   if (params->src.mt) {
+   if (params->src.mt)
       dw1 |= GEN8_PSX_KILL_ENABLE;
+
+   if (params->wm_prog_data->num_varying_inputs)
       dw1 |= GEN8_PSX_ATTRIBUTE_ENABLE;
-   }
 
    if (params->dst.num_samples > 1 && prog_data &&
        prog_data->persample_msaa_dispatch)