iris: Don't leak the surface if uncompressed re-interp fails

Fixes: a032a9665f "iris: Enable PIPE_CAP_SURFACE_REINTERPRET_BLOCKS"
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11647>
This commit is contained in:
Jason Ekstrand 2021-06-28 19:11:46 -05:00 committed by Marge Bot
parent 9946120d2b
commit 98faa09bb5
1 changed files with 3 additions and 1 deletions

View File

@ -2639,8 +2639,10 @@ iris_create_surface(struct pipe_context *ctx,
*
* Return NULL to force gallium frontends to take fallback paths.
*/
if (view->array_len > 1 || GFX_VER == 8)
if (view->array_len > 1 || GFX_VER == 8) {
free(surf);
return NULL;
}
const bool is_3d = res->surf.dim == ISL_SURF_DIM_3D;
isl_surf_get_image_surf(&screen->isl_dev, &res->surf,