{
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;
}
params.y1 = y1;
memset(¶ms.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,
¶ms.x0, ¶ms.y0, ¶ms.x1, ¶ms.y1);
¶ms.x0, ¶ms.y0,
¶ms.x1, ¶ms.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
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;
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;
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");
}
}
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");
}
}