On 24 August 2012 03:05, Kenneth Graunke <span dir="ltr"><<a href="mailto:kenneth@whitecape.org" target="_blank">kenneth@whitecape.org</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Previously, we left the swizzle key field as zero for unused texture<br>
units.  The precompile sets all of them to SWIZZLE_NOOP, which meant<br>
that we mismatched almost every time.<br>
<br>
Since either works equally well, change it to SWIZZLE_NOOP to match<br>
the precompiles.<br>
<br>
Signed-off-by: Kenneth Graunke <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>><br>
---<br>
 src/mesa/drivers/dri/i965/brw_wm.c | 5 ++---<br>
 1 file changed, 2 insertions(+), 3 deletions(-)<br>
<br>
At one point, I needed this patch to get things working.  But I think<br>
it was actually just papering over bugs.  I've fixed the bugs.<br>
<br>
Still, it helps precompiles and is pretty trivial, so why not?<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c<br>
index 6e5163b..ba6f874 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_wm.c<br>
+++ b/src/mesa/drivers/dri/i965/brw_wm.c<br>
@@ -437,6 +437,8 @@ brw_populate_sampler_prog_key_data(struct gl_context *ctx,<br>
                                   struct brw_sampler_prog_key_data *key)<br>
 {<br>
    for (int i = 0; i < BRW_MAX_TEX_UNIT; i++) {<br>
+      key->swizzles[i] = SWIZZLE_NOOP;<br>
+<br></blockquote><div><br>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:<br>
<br>Reviewed-by: Paul Berry <<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>><br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
       if (!prog->TexturesUsed[i])<br>
         continue;<br>
<br>
@@ -512,9 +514,6 @@ brw_populate_sampler_prog_key_data(struct gl_context *ctx,<br>
               key->gl_clamp_mask[2] |= 1 << i;<br>
         }<br>
       }<br>
-      else {<br>
-        key->swizzles[i] = SWIZZLE_NOOP;<br>
-      }<br>
    }<br>
 }<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
1.7.11.4<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br>