shaders: Don't lose the param binding swizzle for single params.
authorEric Anholt <eric@anholt.net>
Wed, 2 Jun 2010 20:56:39 +0000 (13:56 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 2 Jun 2010 21:06:41 +0000 (14:06 -0700)
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
src/mesa/shader/program_parse.y

index 99c4b2baa5f0e3d4152edc5be59784c20bb799e2..7da7226c328a79fd6baa81b5a564d2761be98c45 100644 (file)
@@ -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;
           }
        ;}
index 06c2db7a07e4d4b69b99960731588ca68caa7c09..a2f34b863b5909346ef0be8bcef6eb4b4720e194 100644 (file)
@@ -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;
           }
        }