iris: Enable HIZ_CCS in depth buffer instructions
authorNanley Chery <nanley.g.chery@intel.com>
Fri, 9 Aug 2019 18:08:26 +0000 (11:08 -0700)
committerNanley Chery <nanley.g.chery@intel.com>
Mon, 28 Oct 2019 17:47:06 +0000 (10:47 -0700)
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/gallium/drivers/iris/iris_resource.c
src/gallium/drivers/iris/iris_state.c

index 85559d0f185c2c958e94f42dca6edb190fe2b367..1247ab8fd067b28068d4888ff98c476e214694ce 100644 (file)
@@ -478,7 +478,8 @@ iris_resource_configure_aux(struct iris_screen *screen,
    } else if (has_mcs) {
       res->aux.possible_usages |= 1 << ISL_AUX_USAGE_MCS;
    } else if (has_hiz) {
-      res->aux.possible_usages |= 1 << ISL_AUX_USAGE_HIZ;
+      res->aux.possible_usages |=
+         1 << (has_ccs ? ISL_AUX_USAGE_HIZ_CCS : ISL_AUX_USAGE_HIZ);
    } else if (has_ccs) {
       if (want_ccs_e_for_format(devinfo, res->surf.format))
          res->aux.possible_usages |= 1 << ISL_AUX_USAGE_CCS_E;
@@ -497,6 +498,9 @@ iris_resource_configure_aux(struct iris_screen *screen,
    if (!devinfo->has_sample_with_hiz || res->surf.samples > 1)
       res->aux.sampler_usages &= ~(1 << ISL_AUX_USAGE_HIZ);
 
+   /* We don't yet support sampling with HIZ_CCS. */
+   res->aux.sampler_usages &= ~(1 << ISL_AUX_USAGE_HIZ_CCS);
+
    enum isl_aux_state initial_state;
    *aux_size_B = 0;
    *alloc_flags = 0;
@@ -572,7 +576,7 @@ iris_resource_configure_aux(struct iris_screen *screen,
    size += iris_get_aux_clear_color_state_size(screen);
    *aux_size_B = size;
 
-   if (res->aux.usage == ISL_AUX_USAGE_HIZ) {
+   if (isl_aux_usage_has_hiz(res->aux.usage)) {
       for (unsigned level = 0; level < res->surf.levels; ++level) {
          uint32_t width = u_minify(res->surf.phys_level0_sa.width, level);
          uint32_t height = u_minify(res->surf.phys_level0_sa.height, level);
index e2c36152b97e50e11648e4699a01f701382369f4..5fe2b94b65a73d192402f97c9a14e82ebbb97921 100644 (file)
@@ -2985,7 +2985,7 @@ iris_set_framebuffer_state(struct pipe_context *ctx,
          view.format = zres->surf.format;
 
          if (iris_resource_level_has_hiz(zres, view.base_level)) {
-            info.hiz_usage = ISL_AUX_USAGE_HIZ;
+            info.hiz_usage = zres->aux.usage;
             info.hiz_surf = &zres->aux.surf;
             info.hiz_address = zres->aux.bo->gtt_offset + zres->aux.offset;
          }