aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/iris/iris_resource.c
diff options
context:
space:
mode:
authorNanley Chery <[email protected]>2019-05-01 14:42:58 -0700
committerNanley Chery <[email protected]>2019-05-14 16:23:12 +0000
commit75a3947af468ce39b7c9e3ba92a705b21546ea02 (patch)
treeed439a573e13079e03950bac7e74370eabf09425 /src/gallium/drivers/iris/iris_resource.c
parent1423b786336b52df01b02e87d9221e82fc71b3a3 (diff)
iris/resource: 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 iris. Reviewed-by: Rafael Antognolli <[email protected]>
Diffstat (limited to 'src/gallium/drivers/iris/iris_resource.c')
-rw-r--r--src/gallium/drivers/iris/iris_resource.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c
index 971e7adda7e..ba7d9d62beb 100644
--- a/src/gallium/drivers/iris/iris_resource.c
+++ b/src/gallium/drivers/iris/iris_resource.c
@@ -351,6 +351,7 @@ iris_resource_alloc_aux(struct iris_screen *screen, struct iris_resource *res)
switch (res->aux.usage) {
case ISL_AUX_USAGE_NONE:
res->aux.surf.size_B = 0;
+ ok = true;
break;
case ISL_AUX_USAGE_HIZ:
initial_state = ISL_AUX_STATE_AUX_INVALID;
@@ -392,13 +393,14 @@ iris_resource_alloc_aux(struct iris_screen *screen, struct iris_resource *res)
break;
}
+ /* We should have a valid aux_surf. */
+ if (!ok)
+ return false;
+
/* No work is needed for a zero-sized auxiliary buffer. */
if (res->aux.surf.size_B == 0)
return true;
- /* Assert that ISL gave us a valid aux surf */
- assert(ok);
-
/* Create the aux_state for the auxiliary buffer. */
res->aux.state = create_aux_state_map(res, initial_state);
if (!res->aux.state)
@@ -684,7 +686,7 @@ iris_resource_create_with_modifiers(struct pipe_screen *pscreen,
goto fail;
if (!iris_resource_alloc_aux(screen, res))
- goto fail;
+ iris_resource_disable_aux(res);
return &res->base;