[Mesa-dev] [PATCH 05/14] i965/blorp: Use prog data counters to guide wm/ps setup
Topi Pohjolainen
topi.pohjolainen at intel.com
Wed May 25 16:08:40 UTC 2016
just as core upload logic does.
Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
src/mesa/drivers/dri/i965/gen6_blorp.c | 4 +++-
src/mesa/drivers/dri/i965/gen7_blorp.c | 2 ++
src/mesa/drivers/dri/i965/gen8_blorp.c | 5 +++--
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/gen6_blorp.c b/src/mesa/drivers/dri/i965/gen6_blorp.c
index d9f8c34..98883e9 100644
--- a/src/mesa/drivers/dri/i965/gen6_blorp.c
+++ b/src/mesa/drivers/dri/i965/gen6_blorp.c
@@ -626,7 +626,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 */
diff --git a/src/mesa/drivers/dri/i965/gen7_blorp.c b/src/mesa/drivers/dri/i965/gen7_blorp.c
index 58bf9e9..bba66cf 100644
--- a/src/mesa/drivers/dri/i965/gen7_blorp.c
+++ b/src/mesa/drivers/dri/i965/gen7_blorp.c
@@ -554,6 +554,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.
diff --git a/src/mesa/drivers/dri/i965/gen8_blorp.c b/src/mesa/drivers/dri/i965/gen8_blorp.c
index 6de9b73..5af8f10 100644
--- a/src/mesa/drivers/dri/i965/gen8_blorp.c
+++ b/src/mesa/drivers/dri/i965/gen8_blorp.c
@@ -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)
--
2.5.5
More information about the mesa-dev
mailing list