summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
diff options
context:
space:
mode:
authorNanley Chery <nanley.g.chery@intel.com>2019-04-24 13:34:15 -0700
committerNanley Chery <nanleychery@gmail.com>2019-05-14 16:23:12 +0000
commitcf758c41827d959e62953284c520807e2d281e86 (patch)
tree5bbb2c8e501da5a8064468f5b685612ea0f1dafc /src/mesa/drivers/dri/i965/intel_mipmap_tree.c
parentfc455797c1b20d989e705d05bb165fa32bc360d0 (diff)
i965/miptree: Fall back to no aux if creation fails
No surface requires an auxiliary surface to operate correctly. Fall back to an uncompressed surface if mesa fails to create and allocate an auxiliary surface. This enables adding more restrictions to ISL without having to update i965. Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/intel_mipmap_tree.c')
-rw-r--r--src/mesa/drivers/dri/i965/intel_mipmap_tree.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index 426782c5883..28f32facd2a 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -766,8 +766,8 @@ intel_miptree_create(struct brw_context *brw,
*/
if (mt->aux_usage != ISL_AUX_USAGE_CCS_D &&
!intel_miptree_alloc_aux(brw, mt)) {
- intel_miptree_release(&mt);
- return NULL;
+ mt->aux_usage = ISL_AUX_USAGE_NONE;
+ mt->supports_fast_clear = false;
}
return mt;
@@ -854,8 +854,8 @@ intel_miptree_create_for_bo(struct brw_context *brw,
*/
if (mt->aux_usage != ISL_AUX_USAGE_CCS_D &&
!intel_miptree_alloc_aux(brw, mt)) {
- intel_miptree_release(&mt);
- return NULL;
+ mt->aux_usage = ISL_AUX_USAGE_NONE;
+ mt->supports_fast_clear = false;
}
}
@@ -1830,7 +1830,8 @@ intel_miptree_alloc_aux(struct brw_context *brw,
}
/* We should have a valid aux_surf. */
- assert(aux_surf_ok);
+ if (!aux_surf_ok)
+ return false;
/* No work is needed for a zero-sized auxiliary buffer. */
if (aux_surf.size_B == 0)