Commit 8b086e25 authored by Kenneth Graunke's avatar Kenneth Graunke
Browse files

iris: Update shader image aux state tracking after draws

parent e2903862
Pipeline #705064 waiting for manual action with stages
......@@ -762,6 +762,9 @@ struct iris_context {
*/
enum isl_aux_usage draw_aux_usage[BRW_MAX_DRAW_BUFFERS];
/** Array of aux usages used for images in this draw. */
enum isl_aux_usage image_aux_usage[PIPE_MAX_SHADER_IMAGES];
/** Aux usage of the fb's depth buffer (which may or may not exist). */
enum isl_aux_usage hiz_usage;
......
......@@ -147,13 +147,13 @@ resolve_image_views(struct iris_context *ice,
unsigned num_layers =
pview->u.tex.last_layer - pview->u.tex.first_layer + 1;
enum isl_aux_usage aux_usage =
ice->state.image_aux_usage[i] =
iris_image_view_aux_usage(ice, pview, info);
iris_resource_prepare_access(ice, res,
pview->u.tex.level, 1,
pview->u.tex.first_layer, num_layers,
aux_usage, false);
ice->state.image_aux_usage[i], false);
}
iris_emit_buffer_barrier_for(batch, res->bo, IRIS_DOMAIN_DATA_WRITE);
......@@ -283,6 +283,8 @@ void
iris_postdraw_update_resolve_tracking(struct iris_context *ice,
struct iris_batch *batch)
{
struct iris_screen *screen = (void *) ice->ctx.screen;
struct intel_device_info *devinfo = &screen->devinfo;
struct pipe_framebuffer_state *cso_fb = &ice->state.framebuffer;
// XXX: front buffer drawing?
......@@ -335,6 +337,32 @@ iris_postdraw_update_resolve_tracking(struct iris_context *ice,
aux_usage);
}
}
if (devinfo->ver >= 12) {
for (gl_shader_stage stage = 0; stage < MESA_SHADER_COMPUTE; stage++) {
const struct iris_shader_state *shs = &ice->state.shaders[stage];
const struct shader_info *info = iris_get_shader_info(ice, stage);
const uint64_t images_used = !info ? 0 :
(info->images_used[0] | ((uint64_t)info->images_used[1]) << 32);
uint64_t views = shs->bound_image_views & images_used;
while (views) {
const int i = u_bit_scan64(&views);
const struct pipe_image_view *pview = &shs->image[i].base;
struct iris_resource *res = (void *) pview->resource;
if (res->base.b.target != PIPE_BUFFER) {
unsigned num_layers =
pview->u.tex.last_layer - pview->u.tex.first_layer + 1;
iris_resource_finish_write(ice, res, pview->u.tex.level,
pview->u.tex.first_layer, num_layers,
ice->state.image_aux_usage[i]);
}
}
}
}
}
void
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment