[Mesa-dev] [PATCH 03/10] i965: Set SWIZZLE_NOOP for unused texture units in the program keys.

Paul Berry stereotype441 at gmail.com
Fri Aug 24 11:49:03 PDT 2012


On 24 August 2012 03:05, Kenneth Graunke <kenneth at whitecape.org> wrote:

> Previously, we left the swizzle key field as zero for unused texture
> units.  The precompile sets all of them to SWIZZLE_NOOP, which meant
> that we mismatched almost every time.
>
> Since either works equally well, change it to SWIZZLE_NOOP to match
> the precompiles.
>
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  src/mesa/drivers/dri/i965/brw_wm.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> At one point, I needed this patch to get things working.  But I think
> it was actually just papering over bugs.  I've fixed the bugs.
>
> Still, it helps precompiles and is pretty trivial, so why not?
>
> diff --git a/src/mesa/drivers/dri/i965/brw_wm.c
> b/src/mesa/drivers/dri/i965/brw_wm.c
> index 6e5163b..ba6f874 100644
> --- a/src/mesa/drivers/dri/i965/brw_wm.c
> +++ b/src/mesa/drivers/dri/i965/brw_wm.c
> @@ -437,6 +437,8 @@ brw_populate_sampler_prog_key_data(struct gl_context
> *ctx,
>                                    struct brw_sampler_prog_key_data *key)
>  {
>     for (int i = 0; i < BRW_MAX_TEX_UNIT; i++) {
> +      key->swizzles[i] = SWIZZLE_NOOP;
> +
>

You might want to consider changing this to the equivalent SWIZZLE_XYZW,
since that's the constant that's used in brw_fs_precompile().  But I'm not
going to be picky about it.  Whether you do or not, this patch is:

Reviewed-by: Paul Berry <stereotype441 at gmail.com>


>        if (!prog->TexturesUsed[i])
>          continue;
>
> @@ -512,9 +514,6 @@ brw_populate_sampler_prog_key_data(struct gl_context
> *ctx,
>                key->gl_clamp_mask[2] |= 1 << i;
>          }
>        }
> -      else {
> -        key->swizzles[i] = SWIZZLE_NOOP;
> -      }
>     }
>  }
>
> --
> 1.7.11.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20120824/ee0d5daf/attachment.html>


More information about the mesa-dev mailing list