Commit cd132a8e authored by Tapani Pälli's avatar Tapani Pälli Committed by Marge Bot
Browse files

iris: determine aux usage during predraw and state setup



Patch changes surface state setup to alloc/fill states for all possible
usages for image resource on gen12. Also predraw and binding table
population is changed to determine correct aux usage with the new
iris_image_view_aux_usage.

v2: alloc always all states independent on current image
    aux state on gen >= 12 , code cleanups (Nanley)
Signed-off-by: Tapani Pälli's avatarTapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin's avatarLionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery's avatarNanley Chery <nanley.g.chery@intel.com>
Part-of: <mesa/mesa!4080>
parent d4c879e6
......@@ -137,11 +137,13 @@ resolve_image_views(struct iris_context *ice,
unsigned num_layers =
pview->u.tex.last_layer - pview->u.tex.first_layer + 1;
/* The data port doesn't understand any compression */
enum isl_aux_usage aux_usage =
iris_image_view_aux_usage(ice, pview, info);
iris_resource_prepare_access(ice, batch, res,
pview->u.tex.level, 1,
pview->u.tex.first_layer, num_layers,
ISL_AUX_USAGE_NONE, false);
aux_usage, false);
}
iris_cache_flush_for_read(batch, res->bo);
......
......@@ -2705,7 +2705,11 @@ iris_set_shader_images(struct pipe_context *ctx,
enum isl_format isl_fmt = iris_image_view_get_format(ice, img);
alloc_surface_states(&iv->surface_state, 1 << ISL_AUX_USAGE_NONE);
/* Render compression with images supported on gen12+ only. */
unsigned aux_usages = GEN_GEN >= 12 ? res->aux.possible_usages :
1 << ISL_AUX_USAGE_NONE;
alloc_surface_states(&iv->surface_state, aux_usages);
iv->surface_state.bo_address = res->bo->gtt_offset;
void *map = iv->surface_state.cpu;
......@@ -2727,8 +2731,7 @@ iris_set_shader_images(struct pipe_context *ctx,
isl_fmt, ISL_SWIZZLE_IDENTITY,
0, res->bo->size);
} else {
/* Images don't support compression */
unsigned aux_modes = 1 << ISL_AUX_USAGE_NONE;
unsigned aux_modes = aux_usages;
while (aux_modes) {
enum isl_aux_usage usage = u_bit_scan(&aux_modes);
......@@ -4658,7 +4661,8 @@ use_ubo_ssbo(struct iris_batch *batch,
static uint32_t
use_image(struct iris_batch *batch, struct iris_context *ice,
struct iris_shader_state *shs, int i)
struct iris_shader_state *shs, const struct shader_info *info,
int i)
{
struct iris_image_view *iv = &shs->image[i];
struct iris_resource *res = (void *) iv->base.resource;
......@@ -4674,7 +4678,11 @@ use_image(struct iris_batch *batch, struct iris_context *ice,
if (res->aux.bo)
iris_use_pinned_bo(batch, res->aux.bo, write);
return iv->surface_state.ref.offset;
enum isl_aux_usage aux_usage =
iris_image_view_aux_usage(ice, &iv->base, info);
return iv->surface_state.ref.offset +
surf_state_offset_for_aux(res, res->aux.possible_usages, aux_usage);
}
#define push_bt_entry(addr) \
......@@ -4774,7 +4782,7 @@ iris_populate_binding_table(struct iris_context *ice,
}
foreach_surface_used(i, IRIS_SURFACE_GROUP_IMAGE) {
uint32_t addr = use_image(batch, ice, shs, i);
uint32_t addr = use_image(batch, ice, shs, info, i);
push_bt_entry(addr);
}
......
Markdown is supported
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