[Mesa-dev] [PATCH] texobj: Check completeness with InternalFormat rather than Mesa format

Anuj Phogat anuj.phogat at gmail.com
Wed Jan 13 16:02:11 PST 2016


On Wed, Jan 13, 2016 at 11:28 AM, Neil Roberts <neil at linux.intel.com> wrote:
> The internal Mesa format used for a texture might not match the one
> requested in the internalFormat when the texture was created, for
> example if the driver is internally remapping RGB textures to RGBA.
> Otherwise it can cause false positives for completeness if one mipmap
> image is created as RGBA and the other as RGB because they would both
> have an RGBA Mesa format. If we check the InternalFormat instead then
> we are directly checking the API usage which I think better matches
> the intention of the check.
>
> https://bugs.freedesktop.org/show_bug.cgi?id=93700
> ---
>  src/mesa/main/texobj.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
> index 547055e..b107a8f 100644
> --- a/src/mesa/main/texobj.c
> +++ b/src/mesa/main/texobj.c
> @@ -835,7 +835,7 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx,
>                    incomplete(t, MIPMAP, "TexImage[%d] is missing", i);
>                    return;
>                 }
> -               if (img->TexFormat != baseImage->TexFormat) {
> +               if (img->InternalFormat != baseImage->InternalFormat) {
>                    incomplete(t, MIPMAP, "Format[i] != Format[baseLevel]");
>                    return;
>                 }
> --
> 2.5.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev

LGTM.
Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>


More information about the mesa-dev mailing list