[Mesa-dev] [PATCH] main/base_tex_format: Properly handle STENCIL_INDEX1/4/16
Pohjolainen, Topi
topi.pohjolainen at intel.com
Wed Mar 4 00:17:15 PST 2015
On Tue, Mar 03, 2015 at 05:08:23PM +0000, Neil Roberts wrote:
> Jason Ekstrand <jason at jlekstrand.net> writes:
>
> > On Mon, Mar 2, 2015 at 11:33 AM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
> >
> >> On Mon, Mar 2, 2015 at 2:32 PM, Jason Ekstrand <jason at jlekstrand.net>
> >> wrote:
> >> >
> >> >
> >> > On Mon, Mar 2, 2015 at 11:18 AM, Ilia Mirkin <imirkin at alum.mit.edu>
> >> wrote:
> >> >>
> >> >> Hmmm... I was just looking at this code in connection to attepmting to
> >> >> enable ARB_texture_stencil8, and it _seems_ like that should be if
> >> >> (ARB_texture_stencil8) -- I didn't see what in ARB_stencil_texturing
> >> >> had to do with being able to have a GL_STENCIL_INDEX* internal
> >> >> format...
> >> >
> >> >
> >> > I just pushed it because it does fix a bug... However, you do raise a
> >> good
> >> > point. Maybe we should change the i965 driver to use GL_STENCIL_INDEX
> >> for
> >> > the internal format for our internal stencil buffers.
> >>
> >> How do you end up with a GL_STENCIL_INDEX internal format in the first
> >> place? Without ARB_texture_stencil8 that's not a thing, is it?
> >>
> >
> > We're using it internally for doing stencil blits. I'm going to Cc Neil
> > and he can explain what's going on there better than I can as he was the
> > one who wrote most of that code.
>
> Do you mean the code to do the meta stencil blit? I haven't touched
> that. Maybe I can pass the buck on to Topi :)
I may not be answering to the question but I'll explain what the meta path
does. It sets the texturing mode using:
_mesa_TexParameteri(target, GL_DEPTH_STENCIL_TEXTURE_MODE,
GL_STENCIL_INDEX);
This in order to follow the spec:
"Texture lookups involving texture objects with an internal format of
DEPTH_STENCIL can read the stencil value as described in section
3.10.18 by setting the DEPTH_STENCIL_TEXTURE_MODE to STENCIL_INDEX."
But this should be effecting only gl_texture_object::StencilSampling which
is considered by the surface state setup later on in i965. I don't believe
I have altered any internal format related logic for this.
More information about the mesa-dev
mailing list