[Mesa-dev] [PATCH] mesa: default DepthMode to GL_RED on ES 3.0

Ilia Mirkin imirkin at alum.mit.edu
Wed Feb 17 11:21:27 UTC 2016


On Feb 17, 2016 2:14 AM, "Kenneth Graunke" <kenneth at whitecape.org> wrote:
>
> On Tuesday, February 16, 2016 6:29:39 PM PST Ilia Mirkin wrote:
> > See commit 9db2098d which did it internally to the i965 driver. No
> > reason not to have this more globally set though.
> >
> > This fixes depth in a bunch of dEQP EXT_texture_border_clamp tests. And
> > probably other items as well.
> >
> > Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
> > Cc: Ian Romanick <idr at freedesktop.org>
> > Cc: mesa-stable at lists.freedesktop.org
> > ---
> >  src/mesa/main/texobj.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
> > index d8407f0..2b9c80a 100644
> > --- a/src/mesa/main/texobj.c
> > +++ b/src/mesa/main/texobj.c
> > @@ -320,7 +320,8 @@ _mesa_initialize_texture_object( struct gl_context
*ctx,
> >     obj->Sampler.MaxAnisotropy = 1.0;
> >     obj->Sampler.CompareMode = GL_NONE;         /* ARB_shadow */
> >     obj->Sampler.CompareFunc = GL_LEQUAL;       /* ARB_shadow */
> > -   obj->DepthMode = ctx->API == API_OPENGL_CORE ? GL_RED :
GL_LUMINANCE;
> > +   obj->DepthMode = (ctx->API == API_OPENGL_CORE ||
_mesa_is_gles3(ctx)) ?
> > +      GL_RED : GL_LUMINANCE;
> >     obj->StencilSampling = false;
> >     obj->Sampler.CubeMapSeamless = GL_FALSE;
> >     obj->Swizzle[0] = GL_RED;
> >
>
> Now I'm a bit weirded out - three years later I can't recall why I wrote
> an i965 specific patch for this.  Fixing it in core Mesa seems way
> better.  I wonder why I didn't do that in the first place.
>
> I don't think this is quite right, though...won't this default depth
> mode to GL_RED for *all* formats?  The commit you and Ian cited explains
> that we should default to GL_RED (X, 0, 0, 1) for *sized* formats, but
> leave it as GL_LUMINANCE (X, X, X, 1) for the *unsized* ones.

That'd be why you did it in the driver then, since you don't have the
format at texobj creation time. I missed that little detail, will redo with
the fixup in the st.

>
> We were sort of painted into a corner here...GLES 2 can be silently
> promoted to GLES 3...and GLES 2 already specified this as GL_LUMINANCE,
> but GLES 3 specified things as GL_RED...so there was a compromise.
>
> Incidentally, we should figure out the GL 4.2 interaction I decided to
> put off in 2013, since we're finally there :)

Not 100% sure what the interaction is, but probably beyond the scope of
this change :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160217/5fb1dce9/attachment.html>


More information about the mesa-dev mailing list