[Mesa-dev] [PATCH 2/2] i965/formats: Update the RGB_DXT1 mappings
Kenneth Graunke
kenneth at whitecape.org
Fri May 12 20:44:14 UTC 2017
On Friday, May 12, 2017 1:31:56 PM PDT Nanley Chery wrote:
> On Fri, May 12, 2017 at 08:39:40AM -0700, Kenneth Graunke wrote:
> > On Thursday, May 11, 2017 4:46:27 PM PDT Nanley Chery wrote:
> > > The DXT1_RGB* format does not provide the correct behavior for OpenGL in
> > > the case where color_0 <= color_1. BC1_RGB_UNORM with a alpha set to 1
> > > provides the behavior which matches the spec.
> > >
> > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100925
> > > Cc: <mesa-stable at lists.freedesktop.org>
> > > Signed-off-by: Nanley Chery <nanley.g.chery at intel.com>
> > > ---
> > > src/mesa/drivers/dri/i965/brw_surface_formats.c | 15 ++-------------
> > > 1 file changed, 2 insertions(+), 13 deletions(-)
> >
> > Two things I was worried about:
> >
> > 1. Where's the swizzling code in this patch?
> >
> > -> it turns out that we already swizzle A -> 1 when the mesa format
> > does not have alpha, but the hardware format does. So, it's
> > already there, we don't need any new code :)
> >
> > 2. Will it impact performance?
> >
> > -> Might be nice to check...but the compressed data is the same size
> > for both formats, so it's just how it interprets it...doubtful.
> >
> > This will cause recompiles on Ivybridge and older hardware, due
> > to the implicit texture swizzling. Sad, but not sure we can do
> > anything about it. Could change the default to RGB1 if that's
> > better...
> >
>
> Oh, I didn't know about about those recompiles. I'm not sure how they
> work.
Ivybridge and earlier don't have native support for texture swizzles
(aka the shader channel select / SCS fields). So, we recompile the
program and emit MOVs to do the swizzling. We guess XYZW for the
initial precompile.
Jason had an idea of how to do that without recompiles...perhaps
one of these days we'll finally bite the bullet and do that.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170512/b4e0266c/attachment-0001.sig>
More information about the mesa-dev
mailing list