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