[Mesa-dev] [PATCH] mesa: handle numSamples=0 in _mesa_test_proxy_teximage()

Kenneth Graunke kenneth at whitecape.org
Sat Jul 16 03:45:42 UTC 2016


On Friday, July 15, 2016 9:22:53 PM PDT Brian Paul wrote:
> Should fix the regressions reported in bug 96949.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96949
> ---
>  src/mesa/main/teximage.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
> index 10232d6..d74a45f 100644
> --- a/src/mesa/main/teximage.c
> +++ b/src/mesa/main/teximage.c
> @@ -1271,8 +1271,6 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target,
>  {
>     uint64_t bytes, mbytes;
>  
> -   assert(numSamples > 0);
> -
>     if (numLevels > 0) {
>        /* Compute total memory for a whole mipmap.  This is the path
>         * taken for glTexStorage(GL_PROXY_TEXTURE_x).
> @@ -1306,7 +1304,7 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target,
>     }
>  
>     bytes *= _mesa_num_tex_faces(target);
> -   bytes *= numSamples;
> +   bytes *= MAX2(1, numSamples);
>  
>     mbytes = bytes / (1024 * 1024); /* convert to MB */

This looks good to me.  Thanks Brian!

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

I'm running it through our test lab now - if it works, I'll push it.

Have a great time next week!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160715/91f2dc8b/attachment.sig>


More information about the mesa-dev mailing list