Mesa (master): i965: Enable attribute swizzling (repositioning) in the gen6 SF.

Eric Anholt anholt at kemper.freedesktop.org
Fri Oct 8 19:01:21 UTC 2010


Module: Mesa
Branch: master
Commit: 80c0077a6f7908b302e9fd03ab0d2e5c30dcbddd
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=80c0077a6f7908b302e9fd03ab0d2e5c30dcbddd

Author: Eric Anholt <eric at anholt.net>
Date:   Fri Oct  8 11:16:16 2010 -0700

i965: Enable attribute swizzling (repositioning) in the gen6 SF.

We were trying to remap a fully-filled array down to only handing the
WM the components it uses.  This is called attribute swizzling, and if
you don't enable it you just get 1:1 mappings of inputs to outputs.

This almost fixes glsl-routing, except for the highest gl_TexCoord[]
indices.

---

 src/mesa/drivers/dri/i965/gen6_sf_state.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/gen6_sf_state.c b/src/mesa/drivers/dri/i965/gen6_sf_state.c
index b2a6bd0..ba7f965 100644
--- a/src/mesa/drivers/dri/i965/gen6_sf_state.c
+++ b/src/mesa/drivers/dri/i965/gen6_sf_state.c
@@ -52,7 +52,7 @@ get_attr_override(struct brw_context *brw, int fs_attr)
     * for this output attribute.  attr is currently a VERT_RESULT_* but should
     * be FRAG_ATTRIB_*.
     */
-   for (i = 0; i < vs_attr; i++) {
+   for (i = 1; i < vs_attr; i++) {
       if (brw->vs.prog_data->outputs_written & BITFIELD64_BIT(i))
 	 attr_index++;
    }
@@ -75,6 +75,7 @@ upload_sf_state(struct brw_context *brw)
    int attr = 0;
 
    dw1 =
+      GEN6_SF_SWIZZLE_ENABLE |
       num_outputs << GEN6_SF_NUM_OUTPUTS_SHIFT |
       (num_inputs + 1) / 2 << GEN6_SF_URB_ENTRY_READ_LENGTH_SHIFT |
       1 << GEN6_SF_URB_ENTRY_READ_OFFSET_SHIFT;




More information about the mesa-commit mailing list