if (z_res) {
iris_resource_prepare_depth(ice, batch, z_res, zs_surf->u.tex.level,
zs_surf->u.tex.first_layer, num_layers);
+ iris_cache_flush_for_depth(batch, z_res->bo);
+ }
+
+ if (s_res) {
+ iris_cache_flush_for_depth(batch, s_res->bo);
}
}
ice->state.blend_enables & (1u << i),
draw_aux_buffer_disabled[i]);
- // XXX: NEW_AUX_STATE
- ice->state.draw_aux_usage[i] = aux_usage;
+ if (ice->state.draw_aux_usage[i] != aux_usage) {
+ ice->state.draw_aux_usage[i] = aux_usage;
+ /* XXX: Need to track which bindings to make dirty */
+ ice->state.dirty |= IRIS_ALL_DIRTY_BINDINGS;
+ }
iris_resource_prepare_render(ice, batch, res, surf->view.base_level,
surf->view.base_array_layer,
aux_usage);
iris_cache_flush_for_render(batch, res->bo, surf->view.format,
- ISL_AUX_USAGE_NONE);
+ aux_usage);
}
}
//DBG("%s to mt %p level %u layer %u\n", __FUNCTION__, mt, level, layer);
struct blorp_surf surf;
- iris_blorp_surf_for_resource(&surf, &res->base, res->aux.usage, level,
- true);
+ iris_blorp_surf_for_resource(&ice->vtbl, &surf, &res->base, res->aux.usage,
+ level, true);
iris_batch_maybe_flush(batch, 1500);
assert(res->aux.usage == ISL_AUX_USAGE_MCS);
struct blorp_surf surf;
- iris_blorp_surf_for_resource(&surf, &res->base, res->aux.usage, 0, true);
+ iris_blorp_surf_for_resource(&ice->vtbl, &surf, &res->base, res->aux.usage,
+ 0, true);
struct blorp_batch blorp_batch;
blorp_batch_init(&ice->blorp, &blorp_batch, batch, 0);
* - 7.5.3.2 Depth Buffer Resolve
* - 7.5.3.3 Hierarchical Depth Buffer Resolve
*/
-static void
+void
iris_hiz_exec(struct iris_context *ice,
struct iris_batch *batch,
struct iris_resource *res,
iris_batch_maybe_flush(batch, 1500);
struct blorp_surf surf;
- iris_blorp_surf_for_resource(&surf, &res->base, ISL_AUX_USAGE_HIZ,
- level, true);
+ iris_blorp_surf_for_resource(&ice->vtbl, &surf, &res->base,
+ ISL_AUX_USAGE_HIZ, level, true);
struct blorp_batch blorp_batch;
blorp_batch_init(&ice->blorp, &blorp_batch, batch,
* pass-through state. (You can also think of this as being both a
* resolve and an ambiguate in one operation.)
*/
- iris_resource_set_aux_state(res, level, layer, 1,
+ iris_resource_set_aux_state(ice, res, level, layer, 1,
ISL_AUX_STATE_PASS_THROUGH);
break;
case ISL_AUX_OP_PARTIAL_RESOLVE:
- iris_resource_set_aux_state(res, level, layer, 1,
+ iris_resource_set_aux_state(ice, res, level, layer, 1,
ISL_AUX_STATE_COMPRESSED_NO_CLEAR);
break;
aux_usage == ISL_AUX_USAGE_CCS_D);
if (aux_usage == ISL_AUX_USAGE_CCS_E) {
- iris_resource_set_aux_state(res, level, layer, 1,
+ iris_resource_set_aux_state(ice, res, level, layer, 1,
ISL_AUX_STATE_COMPRESSED_CLEAR);
} else if (aux_state != ISL_AUX_STATE_PARTIAL_CLEAR) {
- iris_resource_set_aux_state(res, level, layer, 1,
+ iris_resource_set_aux_state(ice, res, level, layer, 1,
ISL_AUX_STATE_PARTIAL_CLEAR);
}
break;
case ISL_AUX_STATE_PASS_THROUGH:
if (aux_usage == ISL_AUX_USAGE_CCS_E) {
- iris_resource_set_aux_state(res, level, layer, 1,
+ iris_resource_set_aux_state(ice, res, level, layer, 1,
ISL_AUX_STATE_COMPRESSED_NO_CLEAR);
} else {
/* Nothing to do */
switch (aux_state) {
case ISL_AUX_STATE_CLEAR:
assert(aux_usage == ISL_AUX_USAGE_CCS_D);
- iris_resource_set_aux_state(res, level, layer, 1,
+ iris_resource_set_aux_state(ice, res, level, layer, 1,
ISL_AUX_STATE_PARTIAL_CLEAR);
break;
case ISL_AUX_STATE_COMPRESSED_CLEAR:
if (!fast_clear_supported) {
iris_mcs_partial_resolve(ice, batch, res, layer, 1);
- iris_resource_set_aux_state(res, 0, layer, 1,
+ iris_resource_set_aux_state(ice, res, 0, layer, 1,
ISL_AUX_STATE_COMPRESSED_NO_CLEAR);
}
break;
switch (iris_resource_get_aux_state(res, 0, layer)) {
case ISL_AUX_STATE_CLEAR:
- iris_resource_set_aux_state(res, 0, layer, 1,
+ iris_resource_set_aux_state(ice, res, 0, layer, 1,
ISL_AUX_STATE_COMPRESSED_CLEAR);
break;
switch (hiz_op) {
case ISL_AUX_OP_FULL_RESOLVE:
- iris_resource_set_aux_state(res, level, layer, 1,
+ iris_resource_set_aux_state(ice, res, level, layer, 1,
ISL_AUX_STATE_RESOLVED);
break;
case ISL_AUX_OP_AMBIGUATE:
/* The HiZ resolve operation is actually an ambiguate */
- iris_resource_set_aux_state(res, level, layer, 1,
+ iris_resource_set_aux_state(ice, res, level, layer, 1,
ISL_AUX_STATE_PASS_THROUGH);
break;
switch (iris_resource_get_aux_state(res, level, layer)) {
case ISL_AUX_STATE_CLEAR:
assert(aux_usage == ISL_AUX_USAGE_HIZ);
- iris_resource_set_aux_state(res, level, layer, 1,
+ iris_resource_set_aux_state(ice, res, level, layer, 1,
ISL_AUX_STATE_COMPRESSED_CLEAR);
break;
case ISL_AUX_STATE_RESOLVED:
if (aux_usage == ISL_AUX_USAGE_HIZ) {
- iris_resource_set_aux_state(res, level, layer, 1,
+ iris_resource_set_aux_state(ice, res, level, layer, 1,
ISL_AUX_STATE_COMPRESSED_NO_CLEAR);
} else {
- iris_resource_set_aux_state(res, level, layer, 1,
+ iris_resource_set_aux_state(ice, res, level, layer, 1,
ISL_AUX_STATE_AUX_INVALID);
}
break;
case ISL_AUX_STATE_PASS_THROUGH:
if (aux_usage == ISL_AUX_USAGE_HIZ) {
- iris_resource_set_aux_state(res, level, layer, 1,
+ iris_resource_set_aux_state(ice, res, level, layer, 1,
ISL_AUX_STATE_COMPRESSED_NO_CLEAR);
}
break;
}
void
-iris_resource_set_aux_state(struct iris_resource *res, uint32_t level,
+iris_resource_set_aux_state(struct iris_context *ice,
+ struct iris_resource *res, uint32_t level,
uint32_t start_layer, uint32_t num_layers,
enum isl_aux_state aux_state)
{
for (unsigned a = 0; a < num_layers; a++) {
if (res->aux.state[level][start_layer + a] != aux_state) {
res->aux.state[level][start_layer + a] = aux_state;
- // XXX: dirty works differently
- // brw->ctx.NewDriverState |= BRW_NEW_AUX_STATE;
+ /* XXX: Need to track which bindings to make dirty */
+ ice->state.dirty |= IRIS_ALL_DIRTY_BINDINGS;
}
}
}
* formats. However, there are issues with blending where it doesn't
* properly apply the sRGB curve to the clear color when blending.
*/
- /* XXX:
if (devinfo->gen >= 9 && blend_enabled &&
isl_format_is_srgb(render_format) &&
- !isl_color_value_is_zero_one(res->fast_clear_color, render_format))
+ !isl_color_value_is_zero_one(res->aux.clear_color, render_format))
return ISL_AUX_USAGE_NONE;
- */
if (res->aux.usage == ISL_AUX_USAGE_CCS_E &&
format_ccs_e_compat_with_resource(devinfo, res, render_format))