iris: Drop the iris_resource aux usage bit fields

A big reason we had these fields was to help create a set of surface
states for a resource. That's largely being handled through other means
now.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14806>
This commit is contained in:
Nanley Chery 2022-01-17 13:34:06 -05:00 committed by Marge Bot
parent ae763940e8
commit 987bc44954
3 changed files with 10 additions and 30 deletions

View File

@ -401,8 +401,6 @@ iris_resource_disable_aux(struct iris_resource *res)
free(res->aux.state);
res->aux.usage = ISL_AUX_USAGE_NONE;
res->aux.possible_usages = 1 << ISL_AUX_USAGE_NONE;
res->aux.sampler_usages = 1 << ISL_AUX_USAGE_NONE;
res->aux.surf.size_B = 0;
res->aux.bo = NULL;
res->aux.extra_aux.surf.size_B = 0;
@ -486,9 +484,6 @@ iris_alloc_resource(struct pipe_screen *pscreen,
pipe_reference_init(&res->base.b.reference, 1);
threaded_resource_init(&res->base.b, false, 0);
res->aux.possible_usages = 1 << ISL_AUX_USAGE_NONE;
res->aux.sampler_usages = 1 << ISL_AUX_USAGE_NONE;
if (templ->target == PIPE_BUFFER)
util_range_init(&res->valid_buffer_range);
@ -805,11 +800,6 @@ iris_resource_configure_aux(struct iris_screen *screen,
}
}
res->aux.possible_usages |= 1 << res->aux.usage;
if (!has_hiz || iris_sample_with_depth_aux(devinfo, res))
res->aux.sampler_usages = res->aux.possible_usages;
enum isl_aux_state initial_state;
switch (res->aux.usage) {
case ISL_AUX_USAGE_NONE:
@ -1484,8 +1474,6 @@ iris_reallocate_resource_inplace(struct iris_context *ice,
old_res->aux.clear_color_bo = new_res->aux.clear_color_bo;
old_res->aux.clear_color_offset = new_res->aux.clear_color_offset;
old_res->aux.usage = new_res->aux.usage;
old_res->aux.possible_usages = new_res->aux.possible_usages;
old_res->aux.sampler_usages = new_res->aux.sampler_usages;
if (new_res->aux.state) {
assert(old_res->aux.state);

View File

@ -144,18 +144,6 @@ struct iris_resource {
*/
enum isl_aux_usage usage;
/**
* A bitfield of ISL_AUX_* modes that might this resource might use.
*
* For example, a surface might use both CCS_E and CCS_D at times.
*/
unsigned possible_usages;
/**
* Same as possible_usages, but only with modes supported for sampling.
*/
unsigned sampler_usages;
/**
* \brief Maps miptree slices to their current aux state.
*

View File

@ -2533,7 +2533,8 @@ iris_create_sampler_view(struct pipe_context *ctx,
!iris_sample_with_depth_aux(devinfo, isv->res)) {
aux_usages = 1 << ISL_AUX_USAGE_NONE;
} else {
aux_usages = isv->res->aux.sampler_usages;
aux_usages = 1 << ISL_AUX_USAGE_NONE |
1 << isv->res->aux.usage;
}
alloc_surface_states(&isv->surface_state, aux_usages);
@ -2702,7 +2703,8 @@ iris_create_surface(struct pipe_context *ctx,
!isl_format_supports_ccs_e(devinfo, view->format)) {
aux_usages = 1 << ISL_AUX_USAGE_NONE;
} else {
aux_usages = res->aux.possible_usages;
aux_usages = 1 << ISL_AUX_USAGE_NONE |
1 << res->aux.usage;
}
alloc_surface_states(&surf->surface_state, aux_usages);
@ -2736,7 +2738,7 @@ iris_create_surface(struct pipe_context *ctx,
* and create an uncompressed view with multiple layers, however.
*/
assert(!isl_format_is_compressed(fmt.fmt));
assert(res->aux.possible_usages == 1 << ISL_AUX_USAGE_NONE);
assert(res->aux.usage == ISL_AUX_USAGE_NONE);
assert(res->surf.samples == 1);
assert(view->levels == 1);
@ -2837,9 +2839,11 @@ iris_set_shader_images(struct pipe_context *ctx,
enum isl_format isl_fmt = iris_image_view_get_format(ice, img);
/* Render compression with images supported on gfx12+ only. */
unsigned aux_usages = GFX_VER >= 12 ? res->aux.possible_usages :
1 << ISL_AUX_USAGE_NONE;
unsigned aux_usages = 1 << ISL_AUX_USAGE_NONE;
/* Gfx12+ supports render compression for images */
if (GFX_VER >= 12)
aux_usages |= 1 << res->aux.usage;
alloc_surface_states(&iv->surface_state, aux_usages);
iv->surface_state.bo_address = res->bo->address;