iris: Update clear color initializations for FCV

There were a couple issues in iris_resource_prepare_render():

* It previously assumed that the sampler would always look at the raw
  dwords for 32bpc formats. However, the sampler only does this on
  gfx12.0 for R32 formats (not RG32 formats for example). Update the
  comments to reflect this.

* It only initialized the clear color if the render_format was
  non-32bpc. However, initialization is still needed outside of this
  case because a subsequent sampling operation may use a view format
  which looks at the sampler field. Check for the FCV aux-usage instead
  of the render format's number of bits-per-channel to fix this.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35329>
This commit is contained in:
Nanley Chery
2025-06-05 10:22:06 -04:00
committed by Marge Bot
parent a5bc71dc56
commit a0bb9cb6d8

View File

@@ -1306,13 +1306,12 @@ iris_resource_prepare_render(struct iris_context *ice,
* blocks generated as a result of the render will be recoverable.
*
* - The clear color struct is uninitialized and potentially inconsistent
* with itself. For non-32-bpc formats, the struct consists of different
* fields for rendering and sampling. If rendering can generate
* fast-cleared blocks, we want these to agree so that we can avoid
* partially resolving prior to sampling. Images with modifiers can be
* ignored. Either we will have already initialized their structs to
* zero, or they will have already been consistent at the time of import
* (as defined by drm_fourcc.h)
* with itself. The struct consists of different fields for rendering and
* sampling. If rendering can generate fast-cleared blocks, we want these
* to agree so that we can avoid partially resolving prior to sampling.
* Images with modifiers can be ignored. Either we will have already
* initialized their structs to zero, or they will have already been
* consistent at the time of import (as defined by drm_fourcc.h)
*
* The only aux usage which requires this process is FCV_CCS_E. Other aux
* usages share a subset of these restrictions and benefit from only some
@@ -1324,7 +1323,7 @@ iris_resource_prepare_render(struct iris_context *ice,
res->aux.clear_color,
res->aux.clear_color_unknown) ||
(res->aux.clear_color_unknown && !res->mod_info &&
isl_format_get_layout(render_format)->channels.r.bits != 32)) {
aux_usage == ISL_AUX_USAGE_FCV_CCS_E)) {
/* Remove references to the clear color with resolves. */
iris_resource_prepare_access(ice, res, 0, INTEL_REMAINING_LEVELS, 0,