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

Author: Eric Anholt <[email protected]>
Date:   Wed Jun  2 13:56:39 2010 -0700

shaders: Don't lose the param binding swizzle for single params.

Multiple item params are OK because we don't allow swizzles for them
(in case you do array access to hit their elements, for example).  For
singles, though, using the swizzle can cut down on storage, we do want
to allow a swizzled use of another param.

Fixes OGLC texRect.c.

---

 src/mesa/shader/program_parse.tab.c |    2 +-
 src/mesa/shader/program_parse.y     |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/shader/program_parse.tab.c 
b/src/mesa/shader/program_parse.tab.c
index 99c4b2b..7da7226 100644
--- a/src/mesa/shader/program_parse.tab.c
+++ b/src/mesa/shader/program_parse.tab.c
@@ -3366,7 +3366,7 @@ yyreduce:
              s->param_binding_type = (yyvsp[(3) - 
(3)].temp_sym).param_binding_type;
              s->param_binding_begin = (yyvsp[(3) - 
(3)].temp_sym).param_binding_begin;
              s->param_binding_length = (yyvsp[(3) - 
(3)].temp_sym).param_binding_length;
-              s->param_binding_swizzle = SWIZZLE_XYZW;
+              s->param_binding_swizzle = (yyvsp[(3) - 
(3)].temp_sym).param_binding_swizzle;
              s->param_is_array = 0;
           }
        ;}
diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y
index 06c2db7..a2f34b8 100644
--- a/src/mesa/shader/program_parse.y
+++ b/src/mesa/shader/program_parse.y
@@ -1219,7 +1219,7 @@ PARAM_singleStmt: PARAM IDENTIFIER paramSingleInit
              s->param_binding_type = $3.param_binding_type;
              s->param_binding_begin = $3.param_binding_begin;
              s->param_binding_length = $3.param_binding_length;
-              s->param_binding_swizzle = SWIZZLE_XYZW;
+              s->param_binding_swizzle = $3.param_binding_swizzle;
              s->param_is_array = 0;
           }
        }

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to