tree-wide: replace MAYBE_UNUSED with ASSERTED
[mesa.git] / src / intel / isl / isl_surface_state.c
index cf31b36ccbe1e2d748ccfc4443b272eb78f05ef2..c47b8e0e9dad301262b435be0b2c73ea1aefd4da 100644 (file)
@@ -261,9 +261,9 @@ isl_genX(surf_fill_state_s)(const struct isl_device *dev, void *state,
        * S3TC workaround that requires us to do reinterpretation.  So assert
        * that they're at least the same bpb and block size.
        */
-      MAYBE_UNUSED const struct isl_format_layout *surf_fmtl =
+      ASSERTED const struct isl_format_layout *surf_fmtl =
          isl_format_get_layout(info->surf->format);
-      MAYBE_UNUSED const struct isl_format_layout *view_fmtl =
+      ASSERTED const struct isl_format_layout *view_fmtl =
          isl_format_get_layout(info->surf->format);
       assert(surf_fmtl->bpb == view_fmtl->bpb);
       assert(surf_fmtl->bw == view_fmtl->bw);
@@ -618,6 +618,27 @@ isl_genX(surf_fill_state_s)(const struct isl_device *dev, void *state,
          unreachable("Gen9 and earlier do not support indirect clear colors");
 #endif
       }
+
+#if GEN_GEN == 11
+      /*
+       * From BXML > GT > Shared Functions > vol5c Shared Functions >
+       * [Structure] RENDER_SURFACE_STATE [BDW+] > ClearColorConversionEnable:
+       *
+       *   Project: Gen11
+       *
+       *   "Enables Pixel backend hw to convert clear values into native format
+       *    and write back to clear address, so that display and sampler can use
+       *    the converted value for resolving fast cleared RTs."
+       *
+       * Summary:
+       *   Clear color conversion must be enabled if the clear color is stored
+       *   indirectly and fast color clears are enabled.
+       */
+      if (info->use_clear_address) {
+         s.ClearColorConversionEnable = true;
+      }
+#endif
+
 #if GEN_GEN >= 9
       if (!info->use_clear_address) {
          s.RedClearColor = info->clear_color.u32[0];