[Mesa-dev] [PATCH] st/dri: Don't call invalidate_resource for NULL depth/stencil buffers
Michel Dänzer
michel at daenzer.net
Thu Jan 14 23:22:15 PST 2016
From: Michel Dänzer <michel.daenzer at amd.com>
Fixes crash in 4 EGL piglit tests with radeonsi.
Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
src/gallium/state_trackers/dri/dri_drawable.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/gallium/state_trackers/dri/dri_drawable.c b/src/gallium/state_trackers/dri/dri_drawable.c
index f0cc4a2..adc5128 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]);
}
}
--
2.6.2
More information about the mesa-dev
mailing list