[Mesa-dev] [PATCH 4/5] mesa: Fix a couple of TexEnv unit limits.

Ian Romanick idr at freedesktop.org
Wed Jul 6 13:03:35 PDT 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 07/03/2011 04:00 PM, Henri Verbeet wrote:
> ---
>  src/mesa/main/texenv.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/src/mesa/main/texenv.c b/src/mesa/main/texenv.c
> index 9228e35..c0d0f37 100644
> --- a/src/mesa/main/texenv.c
> +++ b/src/mesa/main/texenv.c
> @@ -419,7 +419,7 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param )
>     ASSERT_OUTSIDE_BEGIN_END(ctx);
>  
>     maxUnit = (target == GL_POINT_SPRITE_NV && pname == GL_COORD_REPLACE_NV)
> -      ? ctx->Const.MaxTextureCoordUnits : ctx->Const.MaxTextureImageUnits;
> +      ? ctx->Const.MaxTextureCoordUnits : ctx->Const.MaxCombinedTextureImageUnits;

I'm not 100% sure that this is correct.  Is there some spec language to
back this up?  A test case?

>     if (ctx->Texture.CurrentUnit >= maxUnit) {
>        _mesa_error(ctx, GL_INVALID_OPERATION, "glTexEnvfv(current unit)");
>        return;
> @@ -748,7 +748,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params )
>     ASSERT_OUTSIDE_BEGIN_END(ctx);
>  
>     maxUnit = (target == GL_POINT_SPRITE_NV && pname == GL_COORD_REPLACE_NV)
> -      ? ctx->Const.MaxTextureCoordUnits : ctx->Const.MaxTextureImageUnits;
> +      ? ctx->Const.MaxTextureCoordUnits : ctx->Const.MaxCombinedTextureImageUnits;
>     if (ctx->Texture.CurrentUnit >= maxUnit) {
>        _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexEnvfv(current unit)");
>        return;
> @@ -817,7 +817,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params )
>     ASSERT_OUTSIDE_BEGIN_END(ctx);
>  
>     maxUnit = (target == GL_POINT_SPRITE_NV && pname == GL_COORD_REPLACE_NV)
> -      ? ctx->Const.MaxTextureCoordUnits : ctx->Const.MaxTextureImageUnits;
> +      ? ctx->Const.MaxTextureCoordUnits : ctx->Const.MaxCombinedTextureImageUnits;
>     if (ctx->Texture.CurrentUnit >= maxUnit) {
>        _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexEnviv(current unit)");
>        return;

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEUEARECAAYFAk4Uv5cACgkQX1gOwKyEAw8q5gCgkgaj0bndmG7qtm+ZFTyy5iL9
N3YAmJdGd9yNNVWDluYOXKw+Hh3FHcc=
=R+vK
-----END PGP SIGNATURE-----


More information about the mesa-dev mailing list