aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2019-09-20 14:33:51 -0700
committerKenneth Graunke <[email protected]>2019-09-22 21:03:16 -0700
commitec81f19b44951fbc0e6a8b381afe6d85834132b8 (patch)
treed759d6aea7a39fe74b03d0bcf454e51daabcd31a
parentd2147787534de87cd11015266293211b5188442f (diff)
st/mesa: Bail on incomplete attachments in discard_framebuffer
Incomplete attachments don't have an associated pipe_surface, so this would crash. Fixes a WebGL conformance test that uses incomplete attachments: https://www.khronos.org/registry/webgl/sdk/tests/conformance2/renderbuffers/invalidate-framebuffer.html?webglVersion=2&quiet=0&quick=1 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111756 Reviewed-By: Tapani Pälli <[email protected]>
-rw-r--r--src/mesa/state_tracker/st_cb_fbo.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index bf23f4f3a8d..55546f9fab3 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -778,7 +778,7 @@ st_discard_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb,
struct st_context *st = st_context(ctx);
struct pipe_resource *prsc;
- if (!att->Renderbuffer)
+ if (!att->Renderbuffer || !att->Complete)
return;
prsc = st_renderbuffer(att->Renderbuffer)->surface->texture;