summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mesa/drivers/dri/i965/intel_mipmap_tree.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index abdaa6a753f..c61042e14be 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -2679,34 +2679,36 @@ intel_miptree_render_aux_usage(struct brw_context *brw,
enum isl_format render_format,
bool blend_enabled)
{
+ struct gen_device_info *devinfo = &brw->screen->devinfo;
+
switch (mt->aux_usage) {
case ISL_AUX_USAGE_MCS:
assert(mt->mcs_buf);
return ISL_AUX_USAGE_MCS;
case ISL_AUX_USAGE_CCS_D:
- return mt->mcs_buf ? ISL_AUX_USAGE_CCS_D : ISL_AUX_USAGE_NONE;
-
- case ISL_AUX_USAGE_CCS_E: {
- /* If the format supports CCS_E and is compatible with the miptree,
- * then we can use it.
- */
- if (format_ccs_e_compat_with_miptree(&brw->screen->devinfo,
- mt, render_format))
- return ISL_AUX_USAGE_CCS_E;
-
- /* Otherwise, we have to fall back to CCS_D */
+ case ISL_AUX_USAGE_CCS_E:
+ if (!mt->mcs_buf) {
+ assert(mt->aux_usage == ISL_AUX_USAGE_CCS_D);
+ return ISL_AUX_USAGE_NONE;
+ }
/* gen9 hardware technically supports non-0/1 clear colors with sRGB
* formats. However, there are issues with blending where it doesn't
* properly apply the sRGB curve to the clear color when blending.
*/
- if (blend_enabled && isl_format_is_srgb(render_format) &&
+ if (devinfo->gen == 9 && blend_enabled &&
+ isl_format_is_srgb(render_format) &&
!isl_color_value_is_zero_one(mt->fast_clear_color, render_format))
return ISL_AUX_USAGE_NONE;
+ if (mt->aux_usage == ISL_AUX_USAGE_CCS_E &&
+ format_ccs_e_compat_with_miptree(&brw->screen->devinfo,
+ mt, render_format))
+ return ISL_AUX_USAGE_CCS_E;
+
+ /* Otherwise, we have to fall back to CCS_D */
return ISL_AUX_USAGE_CCS_D;
- }
default:
return ISL_AUX_USAGE_NONE;