iris: Move depth-format assertion out of iris_blit
authorNanley Chery <nanley.g.chery@intel.com>
Mon, 14 Dec 2020 19:19:29 +0000 (11:19 -0800)
committerMarge Bot <eric+marge@anholt.net>
Thu, 7 Jan 2021 23:00:31 +0000 (23:00 +0000)
Instead of having a depth-specific assertion in a generic portion of
iris_blit, move it into the depth-specific cases of
iris_resource_texture_aux_usage. Since iris_blit calls that function,
the test still occurs.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8340>

src/gallium/drivers/iris/iris_blit.c
src/gallium/drivers/iris/iris_resolve.c

index df212a5..1643e60 100644 (file)
@@ -410,9 +410,6 @@ iris_blit(struct pipe_context *ctx, const struct pipe_blit_info *info)
    enum isl_aux_usage src_aux_usage =
       iris_resource_texture_aux_usage(ice, src_res, src_fmt.fmt);
 
-   if (iris_resource_level_has_hiz(src_res, info->src.level))
-      assert(src_res->surf.format == src_fmt.fmt);
-
    bool src_clear_supported = isl_aux_usage_has_fast_clears(src_aux_usage) &&
                               src_res->surf.format == src_fmt.fmt;
 
index 9a9dea1..7c2f3ea 100644 (file)
@@ -812,15 +812,18 @@ iris_resource_texture_aux_usage(struct iris_context *ice,
 
    switch (res->aux.usage) {
    case ISL_AUX_USAGE_HIZ:
+      assert(res->surf.format == view_format);
       if (iris_sample_with_depth_aux(devinfo, res))
          return ISL_AUX_USAGE_HIZ;
       break;
 
    case ISL_AUX_USAGE_HIZ_CCS:
+      assert(res->surf.format == view_format);
       assert(!iris_sample_with_depth_aux(devinfo, res));
       return ISL_AUX_USAGE_NONE;
 
    case ISL_AUX_USAGE_HIZ_CCS_WT:
+      assert(res->surf.format == view_format);
       if (iris_sample_with_depth_aux(devinfo, res))
          return ISL_AUX_USAGE_HIZ_CCS_WT;
       break;