From: Rob Clark <robcl...@freedesktop.org> We can use same Driver hook for these, in addition to DiscardFramebufferEXT()
Signed-off-by: Rob Clark <robcl...@freedesktop.org> --- src/mesa/main/fbobject.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 42eec89..bac10e6 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -4003,9 +4003,28 @@ invalidate_framebuffer_storage(struct gl_context *ctx, } } - /* We don't actually do anything for this yet. Just return after - * validating the parameters and generating the required errors. - */ + if ((x != 0) || (y != 0)) + return; + + if ((width != fb->Width) || (height != fb->Height)) + return; + + if (ctx->Driver.DiscardTexture) { + for (i = 0; i < numAttachments; i++) { + struct gl_renderbuffer_attachment *att; + + if (_mesa_is_user_fbo(fb)) + att = get_attachment(ctx, fb, attachments[i]); + else /* winsys_fbo */ + att = _mesa_get_fb0_attachment(ctx, fb, attachments[i]); + + if (!att) + continue; + + ctx->Driver.DiscardTexture(ctx, fb, att); + } + } + return; invalid_enum: -- 2.4.3 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev