[Piglit] [Mesa-dev] [PATCH] meta: Avoid FBO resizing/reallocating in decompress_texture_image

Ian Romanick idr at freedesktop.org
Tue Feb 14 17:30:09 PST 2012


On 02/14/2012 12:45 PM, Anuj Phogat wrote:
> On Mon, Feb 13, 2012 at 11:40 AM, Patrick Baggett
> <baggett.patrick at gmail.com <mailto:baggett.patrick at gmail.com>> wrote:
>
>     Would it be more appropriate to compare the product of the width and
>     height? e.g.
>
>       if (width * height > decompress->Width* decompress->Height)
>
> Yes, this looks more appropriate. Tested it with piglit quick.tests. No
> regressions.
> Brian, do you have any comments on Patrick's suggestion?

I don't think that's correct.  For if you try to render to a 
renderbuffer that isn't as wide as the expected destination, the results 
will get clipped.  RBOs and textures are formatted data, so width and 
height are independent.

>     On Mon, Feb 13, 2012 at 1:34 PM, Anuj Phogat <anuj.phogat at gmail.com
>     <mailto:anuj.phogat at gmail.com>> wrote:
>
>         Reallocate/resize decompress FBO only if texture image
>         width/height is
>         greater than existing decompress FBO width/height.
>
>         Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com
>         <mailto:anuj.phogat at gmail.com>>
>         ---
>           src/mesa/drivers/common/meta.c |    2 +-
>           1 files changed, 1 insertions(+), 1 deletions(-)
>
>         diff --git a/src/mesa/drivers/common/meta.c
>         b/src/mesa/drivers/common/meta.c
>         index f3f5d85..c3b2367 100644
>         --- a/src/mesa/drivers/common/meta.c
>         +++ b/src/mesa/drivers/common/meta.c
>         @@ -3292,7 +3292,7 @@ decompress_texture_image(struct gl_context
>         *ctx,
>             }
>
>             /* alloc dest surface */
>         -   if (width != decompress->Width || height !=
>         decompress->Height) {
>         +   if (width > decompress->Width || height > decompress->Height) {
>                _mesa_RenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGBA,
>                                             width, height);
>                decompress->Width = width;
>         --
>         1.7.7.6
>
>         _______________________________________________
>         mesa-dev mailing list
>         mesa-dev at lists.freedesktop.org
>         <mailto:mesa-dev at lists.freedesktop.org>
>         http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
>
>
>
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit



More information about the Piglit mailing list