diff options
author | Rafael Antognolli <[email protected]> | 2019-03-13 16:56:55 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2019-03-18 22:21:30 -0700 |
commit | 9c63ec26eaff563ae3583638ceb4bd43fa9c32ba (patch) | |
tree | fc35d9eddb76d42da6010b6aa404055b58960271 /src | |
parent | d0ba326f238f9f2130847696c6c64bbb381f7471 (diff) |
iris: Enable HiZ for multisampled depth surfaces.
Fix this check so that we can get a HiZ aux buffer for multisampled
surfaces as well. Also make sure we don't try to emit a sampler view
surface state for multisampled depth sufaces with HiZ enabled, as
the sampler can't HiZ for multisampled buffers and isl would assert.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/iris/iris_resource.c | 27 | ||||
-rw-r--r-- | src/gallium/drivers/iris/iris_state.c | 9 |
2 files changed, 19 insertions, 17 deletions
diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c index e0824723676..8bb0b3faa71 100644 --- a/src/gallium/drivers/iris/iris_resource.c +++ b/src/gallium/drivers/iris/iris_resource.c @@ -567,21 +567,18 @@ iris_resource_create_with_modifiers(struct pipe_screen *pscreen, if (res->mod_info) { res->aux.possible_usages |= 1 << res->mod_info->aux_usage; - } else if (res->surf.samples > 1) { - if (supports_mcs(&res->surf)) - res->aux.possible_usages |= 1 << ISL_AUX_USAGE_MCS; - } else { - if (has_depth) { - if (likely(!(INTEL_DEBUG & DEBUG_NO_HIZ))) - res->aux.possible_usages |= 1 << ISL_AUX_USAGE_HIZ; - } else if (likely(!(INTEL_DEBUG & DEBUG_NO_RBC)) && - supports_ccs(devinfo, &res->surf)) { - if (isl_format_supports_ccs_e(devinfo, res->surf.format)) - res->aux.possible_usages |= 1 << ISL_AUX_USAGE_CCS_E; - - if (isl_format_supports_ccs_d(devinfo, res->surf.format)) - res->aux.possible_usages |= 1 << ISL_AUX_USAGE_CCS_D; - } + } else if (supports_mcs(&res->surf)) { + res->aux.possible_usages |= 1 << ISL_AUX_USAGE_MCS; + } else if (has_depth) { + if (likely(!(INTEL_DEBUG & DEBUG_NO_HIZ))) + res->aux.possible_usages |= 1 << ISL_AUX_USAGE_HIZ; + } else if (likely(!(INTEL_DEBUG & DEBUG_NO_RBC)) && + supports_ccs(devinfo, &res->surf)) { + if (isl_format_supports_ccs_e(devinfo, res->surf.format)) + res->aux.possible_usages |= 1 << ISL_AUX_USAGE_CCS_E; + + if (isl_format_supports_ccs_d(devinfo, res->surf.format)) + res->aux.possible_usages |= 1 << ISL_AUX_USAGE_CCS_D; } res->aux.usage = util_last_bit(res->aux.possible_usages) - 1; diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index eaa40d33fdf..bd5ee14a5f0 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -1731,8 +1731,13 @@ iris_create_sampler_view(struct pipe_context *ctx, while (aux_modes) { enum isl_aux_usage aux_usage = u_bit_scan(&aux_modes); - fill_surface_state(&screen->isl_dev, map, isv->res, &isv->view, - aux_usage); + /* If we have a multisampled depth buffer, do not create a sampler + * surface state with HiZ. + */ + if (!(aux_usage == ISL_AUX_USAGE_HIZ && isv->res->surf.samples > 1)) { + fill_surface_state(&screen->isl_dev, map, isv->res, &isv->view, + aux_usage); + } map += SURFACE_STATE_ALIGNMENT; } |