Rob Clark <robdcl...@gmail.com> writes:

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

I think you want "(width < fb->Width) || (height < fb->Height)" since
_mesa_InvalidateFramebuffer passes MAX_VIEWPORT_WIDTH/HEIGHT.

The loop also looks a lot like the loop in the previous patch.  I think
you could just reuse invalidate_framebuffer_storage from
DiscardFramebufferEXT -- DFEXT doesn't explicitly specify the
INVALID_OPERATION for > MaxColorAttachments, but it seems reasonable and
then the new loop only appears once.

Attachment: signature.asc
Description: PGP signature

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to