iris: Add miplevel parameters to iris_resource_texture_aux_usage
Sometimes we only access a subset of a texture's miplevels, for example when peforming GenerateMipmaps(). We want to be able to look for the aux state being ISL_AUX_STATE_PASS_THROUGH for only the relevant miplevels, rather than all of them, when deciding whether to bypass aux. Avoids another occurrence of issues with reading via aux while in passthrough state (see issue #6558), fixing misrendering in Chrome and Electron apps while resizing the window to be smaller (#7272). Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7272 Reviewed-by: Nanley Chery <nanley.g.chery@intel.com> [v1] Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19028>
This commit is contained in:
committed by
Marge Bot
parent
21740580ce
commit
346994265a
@@ -493,7 +493,8 @@ iris_blit(struct pipe_context *ctx, const struct pipe_blit_info *info)
|
||||
struct iris_format_info src_fmt =
|
||||
iris_format_for_usage(devinfo, src_pfmt, ISL_SURF_USAGE_TEXTURE_BIT);
|
||||
enum isl_aux_usage src_aux_usage =
|
||||
iris_resource_texture_aux_usage(ice, src_res, src_fmt.fmt);
|
||||
iris_resource_texture_aux_usage(ice, src_res, src_fmt.fmt,
|
||||
info->src.level, 1);
|
||||
|
||||
iris_resource_prepare_texture(ice, src_res, src_fmt.fmt,
|
||||
info->src.level, 1, info->src.box.z,
|
||||
@@ -585,7 +586,8 @@ get_copy_region_aux_settings(struct iris_context *ice,
|
||||
false);
|
||||
} else {
|
||||
*out_aux_usage = iris_resource_texture_aux_usage(ice, res,
|
||||
res->surf.format);
|
||||
res->surf.format,
|
||||
level, 1);
|
||||
}
|
||||
*out_clear_supported = isl_aux_usage_has_fast_clears(*out_aux_usage);
|
||||
break;
|
||||
|
||||
@@ -893,7 +893,9 @@ iris_resource_set_aux_state(struct iris_context *ice,
|
||||
enum isl_aux_usage
|
||||
iris_resource_texture_aux_usage(struct iris_context *ice,
|
||||
const struct iris_resource *res,
|
||||
enum isl_format view_format)
|
||||
enum isl_format view_format,
|
||||
unsigned start_level,
|
||||
unsigned num_levels)
|
||||
{
|
||||
struct iris_screen *screen = (void *) ice->ctx.screen;
|
||||
struct intel_device_info *devinfo = &screen->devinfo;
|
||||
@@ -918,7 +920,7 @@ iris_resource_texture_aux_usage(struct iris_context *ice,
|
||||
* ISL_AUX_USAGE_NONE. This way, texturing won't even look at the
|
||||
* aux surface and we can save some bandwidth.
|
||||
*/
|
||||
if (!iris_has_invalid_primary(res, 0, INTEL_REMAINING_LEVELS,
|
||||
if (!iris_has_invalid_primary(res, start_level, num_levels,
|
||||
0, INTEL_REMAINING_LAYERS))
|
||||
return ISL_AUX_USAGE_NONE;
|
||||
|
||||
@@ -957,9 +959,12 @@ iris_image_view_aux_usage(struct iris_context *ice,
|
||||
const struct intel_device_info *devinfo = &screen->devinfo;
|
||||
struct iris_resource *res = (void *) pview->resource;
|
||||
|
||||
const unsigned level = res->base.b.target != PIPE_BUFFER ?
|
||||
pview->u.tex.level : 0;
|
||||
|
||||
enum isl_format view_format = iris_image_view_get_format(ice, pview);
|
||||
enum isl_aux_usage aux_usage =
|
||||
iris_resource_texture_aux_usage(ice, res, view_format);
|
||||
iris_resource_texture_aux_usage(ice, res, view_format, level, 1);
|
||||
|
||||
bool uses_atomic_load_store =
|
||||
ice->shaders.uncompiled[info->stage]->uses_atomic_load_store;
|
||||
@@ -1020,7 +1025,8 @@ iris_resource_prepare_texture(struct iris_context *ice,
|
||||
const struct intel_device_info *devinfo = &screen->devinfo;
|
||||
|
||||
enum isl_aux_usage aux_usage =
|
||||
iris_resource_texture_aux_usage(ice, res, view_format);
|
||||
iris_resource_texture_aux_usage(ice, res, view_format,
|
||||
start_level, num_levels);
|
||||
|
||||
bool clear_supported = isl_aux_usage_has_fast_clears(aux_usage);
|
||||
|
||||
|
||||
@@ -461,7 +461,9 @@ iris_resource_access_raw(struct iris_context *ice,
|
||||
|
||||
enum isl_aux_usage iris_resource_texture_aux_usage(struct iris_context *ice,
|
||||
const struct iris_resource *res,
|
||||
enum isl_format view_fmt);
|
||||
enum isl_format view_fmt,
|
||||
unsigned start_level,
|
||||
unsigned num_levels);
|
||||
void iris_resource_prepare_texture(struct iris_context *ice,
|
||||
struct iris_resource *res,
|
||||
enum isl_format view_format,
|
||||
|
||||
@@ -5001,7 +5001,8 @@ use_sampler_view(struct iris_context *ice,
|
||||
struct iris_sampler_view *isv)
|
||||
{
|
||||
enum isl_aux_usage aux_usage =
|
||||
iris_resource_texture_aux_usage(ice, isv->res, isv->view.format);
|
||||
iris_resource_texture_aux_usage(ice, isv->res, isv->view.format,
|
||||
isv->view.base_level, isv->view.levels);
|
||||
|
||||
if (!isv->surface_state.ref.res)
|
||||
upload_surface_states(ice->state.surface_uploader, &isv->surface_state);
|
||||
|
||||
Reference in New Issue
Block a user