iris: Disable auxiliary buffer if MSRT is bound as texture

This change introduce the full resolve of MCS data by copying compressed
surface to uncompressed surface and also disables the auxiliary buffer
if MSRT is bound as texture on ACM platform.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26043>
This commit is contained in:
Sagar Ghuge 2023-11-03 11:15:38 -07:00 committed by Marge Bot
parent ba5c4da5da
commit e71a9e14f7

View file

@ -250,6 +250,14 @@ iris_predraw_resolve_framebuffer(struct iris_context *ice,
struct iris_resource *res = (void *) surf->base.texture;
/* Undocumented workaround:
*
* Disable auxiliary buffer if MSRT is bound as texture.
*/
if (intel_device_info_is_dg2(devinfo) && res->surf.samples > 1 &&
nir->info.outputs_read != 0)
draw_aux_buffer_disabled[i] = true;
enum isl_aux_usage aux_usage =
iris_resource_render_aux_usage(ice, res, surf->view.format,
surf->view.base_level,
@ -583,6 +591,19 @@ iris_mcs_exec(struct iris_context *ice,
if (op == ISL_AUX_OP_PARTIAL_RESOLVE) {
blorp_mcs_partial_resolve(&blorp_batch, &surf, res->surf.format,
start_layer, num_layers);
} else if (op == ISL_AUX_OP_FULL_RESOLVE) {
/* Simply copy compressed surface to uncompressed surface in order to do
* the full resolve.
*/
struct blorp_surf src_surf, dst_surf;
iris_blorp_surf_for_resource(&batch->screen->isl_dev, &src_surf,
&res->base.b, res->aux.usage, 0, false);
iris_blorp_surf_for_resource(&batch->screen->isl_dev, &dst_surf,
&res->base.b, ISL_AUX_USAGE_NONE, 0, true);
blorp_copy(&blorp_batch, &src_surf, 0, 0, &dst_surf, 0, 0,
0, 0, 0, 0, surf.surf->logical_level0_px.width,
surf.surf->logical_level0_px.height);
} else {
assert(op == ISL_AUX_OP_AMBIGUATE);
blorp_mcs_ambiguate(&blorp_batch, &surf, start_layer, num_layers);