i965/blorp: Add a fast_clear_op enum

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
This commit is contained in:
Jason Ekstrand
2016-08-19 02:23:04 -07:00
parent 71dc2e0106
commit db95a8108f
4 changed files with 32 additions and 16 deletions

View File

@@ -145,7 +145,6 @@ brw_blorp_params_init(struct brw_blorp_params *params)
{
memset(params, 0, sizeof(*params));
params->hiz_op = GEN6_HIZ_OP_NONE;
params->fast_clear_op = 0;
params->num_draw_buffers = 1;
params->num_layers = 1;
}

View File

@@ -109,7 +109,7 @@ blorp_fast_clear(struct blorp_batch *batch,
params.y1 = y1;
memset(&params.wm_inputs, 0xff, 4*sizeof(float));
params.fast_clear_op = GEN7_PS_RENDER_TARGET_FAST_CLEAR_ENABLE;
params.fast_clear_op = BLORP_FAST_CLEAR_OP_CLEAR;
brw_get_fast_clear_rect(batch->blorp->isl_dev, surf->aux_surf,
&params.x0, &params.y0, &params.x1, &params.y1);
@@ -184,10 +184,15 @@ brw_blorp_ccs_resolve(struct blorp_batch *batch,
&params.x0, &params.y0,
&params.x1, &params.y1);
if (params.dst.aux_usage == ISL_AUX_USAGE_CCS_E)
params.resolve_type = GEN9_PS_RENDER_TARGET_RESOLVE_FULL;
else
params.resolve_type = GEN7_PS_RENDER_TARGET_RESOLVE_ENABLE;
if (batch->blorp->isl_dev->info->gen >= 9) {
if (params.dst.aux_usage == ISL_AUX_USAGE_CCS_E)
params.fast_clear_op = BLORP_FAST_CLEAR_OP_RESOLVE_FULL;
else
params.fast_clear_op = BLORP_FAST_CLEAR_OP_RESOLVE_PARTIAL;
} else {
/* Broadwell and earlier do not have a partial resolve */
params.fast_clear_op = BLORP_FAST_CLEAR_OP_RESOLVE_FULL;
}
/* Note: there is no need to initialize push constants because it doesn't
* matter what data gets dispatched to the render target. However, we must

View File

@@ -42,6 +42,13 @@ enum {
BLORP_NUM_BT_ENTRIES
};
enum blorp_fast_clear_op {
BLORP_FAST_CLEAR_OP_NONE = 0,
BLORP_FAST_CLEAR_OP_CLEAR,
BLORP_FAST_CLEAR_OP_RESOLVE_PARTIAL,
BLORP_FAST_CLEAR_OP_RESOLVE_FULL,
};
struct brw_blorp_surface_info
{
struct isl_surf surf;
@@ -168,10 +175,7 @@ struct brw_blorp_params
struct brw_blorp_surface_info src;
struct brw_blorp_surface_info dst;
enum gen6_hiz_op hiz_op;
union {
unsigned fast_clear_op;
unsigned resolve_type;
};
enum blorp_fast_clear_op fast_clear_op;
bool color_write_disable[4];
struct brw_blorp_wm_inputs wm_inputs;
unsigned num_draw_buffers;

View File

@@ -528,21 +528,25 @@ blorp_emit_ps_config(struct blorp_batch *batch,
ps.MaximumNumberofThreadsPerPSD = 64 - 2;
switch (params->fast_clear_op) {
case BLORP_FAST_CLEAR_OP_NONE:
break;
#if GEN_GEN >= 9
case (1 << 6): /* GEN7_PS_RENDER_TARGET_RESOLVE_ENABLE */
case BLORP_FAST_CLEAR_OP_RESOLVE_PARTIAL:
ps.RenderTargetResolveType = RESOLVE_PARTIAL;
break;
case (3 << 6): /* GEN9_PS_RENDER_TARGET_RESOLVE_FULL */
case BLORP_FAST_CLEAR_OP_RESOLVE_FULL:
ps.RenderTargetResolveType = RESOLVE_FULL;
break;
#else
case (1 << 6): /* GEN7_PS_RENDER_TARGET_RESOLVE_ENABLE */
case BLORP_FAST_CLEAR_OP_RESOLVE_FULL:
ps.RenderTargetResolveEnable = true;
break;
#endif
case (1 << 8): /* GEN7_PS_RENDER_TARGET_FAST_CLEAR_ENABLE */
case BLORP_FAST_CLEAR_OP_CLEAR:
ps.RenderTargetFastClearEnable = true;
break;
default:
unreachable("Invalid fast clear op");
}
}
@@ -627,12 +631,16 @@ blorp_emit_ps_config(struct blorp_batch *batch,
ps.SamplerCount = 1; /* Up to 4 samplers */
switch (params->fast_clear_op) {
case (1 << 6): /* GEN7_PS_RENDER_TARGET_RESOLVE_ENABLE */
case BLORP_FAST_CLEAR_OP_NONE:
break;
case BLORP_FAST_CLEAR_OP_RESOLVE_FULL:
ps.RenderTargetResolveEnable = true;
break;
case (1 << 8): /* GEN7_PS_RENDER_TARGET_FAST_CLEAR_ENABLE */
case BLORP_FAST_CLEAR_OP_CLEAR:
ps.RenderTargetFastClearEnable = true;
break;
default:
unreachable("Invalid fast clear op");
}
}