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 <kenneth@whitecape.org>
This commit is contained in:
Rafael Antognolli 2019-03-13 16:56:55 -07:00 committed by Kenneth Graunke
parent d0ba326f23
commit 9c63ec26ea
2 changed files with 18 additions and 16 deletions

View file

@ -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;
} 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;
}
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;

View file

@ -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;
}