From: Michel Dänzer Date: Fri, 15 Jan 2016 06:46:31 +0000 (+0900) Subject: st/dri: Don't call invalidate_resource for NULL depth/stencil buffers X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0491dd1deb46ca77545322c53e90f86ae244cdae;p=mesa.git st/dri: Don't call invalidate_resource for NULL depth/stencil buffers Fixes crash in 4 EGL piglit tests with radeonsi. Reviewed-by: Nicolai Hähnle Reviewed-by: Marek Olšák --- diff --git a/src/gallium/state_trackers/dri/dri_drawable.c b/src/gallium/state_trackers/dri/dri_drawable.c index f0cc4a2a3ef..adc51284767 100644 --- a/src/gallium/state_trackers/dri/dri_drawable.c +++ b/src/gallium/state_trackers/dri/dri_drawable.c @@ -492,8 +492,10 @@ dri_flush(__DRIcontext *cPriv, if (pipe->invalidate_resource && (flags & __DRI2_FLUSH_INVALIDATE_ANCILLARY)) { - pipe->invalidate_resource(pipe, drawable->textures[ST_ATTACHMENT_DEPTH_STENCIL]); - pipe->invalidate_resource(pipe, drawable->msaa_textures[ST_ATTACHMENT_DEPTH_STENCIL]); + if (drawable->textures[ST_ATTACHMENT_DEPTH_STENCIL]) + pipe->invalidate_resource(pipe, drawable->textures[ST_ATTACHMENT_DEPTH_STENCIL]); + if (drawable->msaa_textures[ST_ATTACHMENT_DEPTH_STENCIL]) + pipe->invalidate_resource(pipe, drawable->msaa_textures[ST_ATTACHMENT_DEPTH_STENCIL]); } }