[Mesa-dev] [PATCH] mesa: Only mark textures as mipmap incomplete on MAX_LEVEL issues.

Ian Romanick idr at freedesktop.org
Thu Jan 17 11:37:47 PST 2013


On 01/17/2013 09:58 AM, Kenneth Graunke wrote:
> According to the OpenGL 3.2 Core Profile specification, section 3.8.12:
>
> "For one-, two-, and three-dimensional and one-and two-dimensional array
>   textures, a texture is mipmap complete if all of the following
>   conditions hold true:
>   - [...]
>   - levelbase <= levelmax [...]
>
>   Using the preceding definitions, a texture is complete unless any of
>   the following conditions hold true:
>   - [...]
>   - The minification filter requires a mipmap (is neither NEAREST nor
>     LINEAR), and the texture is not mipmap complete."
>
> (This text also appears in all GL >= 3.2 specs and the ES 3.0 spec.)
>
>  From this, we see that levelbase <= levelmax should only affect mipmap
> completeness, not base-level completeness.
>
> Prior versions of GL did not have the notion of mipmap completeness,
> simply calling the texture incomplete in this case.  But I don't think
> we really care.
>
> Fixes es3conform's sgis_texture_lod_basic_completeness test.
>
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>

I poked around a bit in _mesa_test_texobj_completeness, and I think this 
is right.  I had some concerns about other possible behavior changes, 
but I don't think there will be any incorrect changes.

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

> ---
>   src/mesa/main/texobj.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
> index 799ce31..f40ab1a 100644
> --- a/src/mesa/main/texobj.c
> +++ b/src/mesa/main/texobj.c
> @@ -469,7 +469,7 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx,
>      }
>
>      if (t->MaxLevel < baseLevel) {
> -      incomplete(t, BASE, "MAX_LEVEL (%d) < BASE_LEVEL (%d)",
> +      incomplete(t, MIPMAP, "MAX_LEVEL (%d) < BASE_LEVEL (%d)",
>   		 t->MaxLevel, baseLevel);
>         return;
>      }
> @@ -577,7 +577,7 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx,
>         GLuint width, height, depth, face;
>
>         if (minLevel > maxLevel) {
> -         incomplete(t, BASE, "minLevel > maxLevel");
> +         incomplete(t, MIPMAP, "minLevel > maxLevel");
>            return;
>         }
>
>



More information about the mesa-dev mailing list