[Mesa-dev] [PATCH] mesa: Add ARB_texture_view to Mesa core
Ian Romanick
idr at freedesktop.org
Tue Nov 5 08:40:56 PST 2013
On 11/04/2013 03:34 PM, Courtney Goeltzenleuchter wrote:
>
> On Fri, Nov 1, 2013 at 1:42 PM, Ian Romanick <idr at freedesktop.org
> <mailto:idr at freedesktop.org>> wrote:
>
> On 11/01/2013 09:54 AM, Courtney Goeltzenleuchter wrote:
> > @@ -1746,11 +1770,37 @@ _mesa_GetTexParameteriv( GLenum target,
> GLenum pname, GLint *params )
> > break;
> >
> > case GL_TEXTURE_IMMUTABLE_LEVELS:
> > - if (!_mesa_is_gles3(ctx))
> > + if (!_mesa_is_gles3(ctx)
> > + && !_mesa_is_desktop_gl(ctx)
> > + && !ctx->Extensions.ARB_texture_view)
>
> This if-statement will never evaluate to true because at least one of
> _mesa_is_gles3 or _mesa_is_desktop_gl will be false.
>
>
> The intent - as I understand it - is to only return
> GL_TEXTURE_IMMUTABLE_LEVELS if we are being called using a context that
> can support it. How about:
> if (_mesa_is_gles3(ctx) || ctx->Extensions.ARB_texture_view)
> *params = obj->ImmutableLevels;
> else
> goto invalid_pname;
>
> Does that protect GL_TEXTURE_IMMUTABLE_LEVELS properly?
No... it still lets it slip through in OpenGL ES 1.x. :)
if (!_mesa_is_gles3(ctx) &&
!(_mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_texture_view))
goto invalid_pname;
I'm also debating whether or not we should expose this compatibility
profiles. The extension spec doesn't mention anything about legacy
texture formats (luminance, etc.). I haven't looked at the OpenGL 4.3
Compatibility Profile spec yet. The only relevant text in the extension
spec is:
"The two textures' internal formats must be compatible according
to Table 3.X.2 (Compatible internal formats for TextureView) if
the internal format exists in that table and the internal
formats must be identical if not in that table, or else an
INVALID_OPERATION error is generated."
So, you can create a GL_LUMINANCE view of a GL_LUMINANCE texture. Hmm...
More information about the mesa-dev
mailing list