[Mesa-dev] [PATCH 7/9] mesa: Fill out ARB_texture_view entry points
Brian Paul
brianp at vmware.com
Thu Dec 5 07:52:04 PST 2013
On 12/04/2013 03:46 PM, Courtney Goeltzenleuchter wrote:
> It's come to my attention that Mesa's handling of GL_TEXTURE_BASE_LEVEL
> and GL_TEXTURE_MAX_LEVEL in glTexParameter and glGetTexParameter may be
> incorrect. The issue happens with the following sequence:
>
> glTexStorage2D(GL_TEXTURE_2D, 4, GL_RGBA8, 128, 128);
>
> glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 5);
>
> glGetTexParameter(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, &n);
>
> The key question is: What is the value of n?
>
> Right now, the Mesa driver will clamp the glTexParameter call to the
> range 0 .. 3 (as specified by the TexStorage call) and n = 3 after the
> GetTexParameter call. However, the value returned on the Intel Windows
> driver and NVIDIA's Linux driver return 5. This has apparently been
> discussed among Kronos members in bug: 9342
> (https://cvs.khronos.org/bugzilla/show_bug.cgi?id=9342
> <https://urldefense.proofpoint.com/v1/url?u=https://cvs.khronos.org/bugzilla/show_bug.cgi?id%3D9342&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=lGQMzzTgII0I7jefp2FHq7WtZ%2BTLs8wadB%2BiIj9xpBY%3D%0A&m=SrPAWBW251dxCErQJNhB0m93E9Vb62KGHxK3yiRBRuU%3D%0A&s=a0c086b7a31a804e3e786118fd1771b53c85717a4cf0c8dea41b60e5acd0406b>)
> which I don't have visibility of.
>
> To match that behavior the texture object will likely need two BaseLevel
> and MaxLevel attributes. One that's clamped and used locally and the
> other that simply holds the set value as given by the application in the
> glTexParameter call.
>
> Thoughts?
From reading the bug report, it sounds like the ARB decided that
clamping should be done when the texture is used, not when
glTexParameter is called. In the GL 4.3 spec I don't see any language
about clamping in glTexParameter either.
We should be doing the use-time clamping already. So I think we just
have to remove the clamping step in glTexParameter.
-Brian
More information about the mesa-dev
mailing list