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 <tapani.palli@intel.com>
This commit is contained in:
Kenneth Graunke 2019-09-20 14:33:51 -07:00
parent d214778753
commit ec81f19b44
1 changed files with 1 additions and 1 deletions

View File

@ -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;