ARB prog parser: Revert part of previous change to constant parsing
authorIan Romanick <ian.d.romanick@intel.com>
Fri, 21 Aug 2009 01:29:41 +0000 (18:29 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 21 Aug 2009 01:29:41 +0000 (18:29 -0700)
The commit "ARP prog parser: Implement the spec, not what makes sense"
broke the parsing of scalar constants.  This commit reverts that part
of that commit.  Now vp_swizzle.c passes.

src/mesa/shader/program_parse.tab.c
src/mesa/shader/program_parse.y

index 856bcbe874a44a90a7b18ca9e43ef24242bbc3c7..dbed448113e9b59fb2cacafbd92785bcd985769d 100644 (file)
@@ -4092,11 +4092,11 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 1643 "program_parse.y"
     {
-          (yyval.vector).count = 4;
+          (yyval.vector).count = 1;
           (yyval.vector).data[0] = (yyvsp[(1) - (1)].real);
-          (yyval.vector).data[1] = 0.0f;
-          (yyval.vector).data[2] = 0.0f;
-          (yyval.vector).data[3] = 1.0f;
+          (yyval.vector).data[1] = (yyvsp[(1) - (1)].real);
+          (yyval.vector).data[2] = (yyvsp[(1) - (1)].real);
+          (yyval.vector).data[3] = (yyvsp[(1) - (1)].real);
        ;}
     break;
 
@@ -4105,11 +4105,11 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 1651 "program_parse.y"
     {
-          (yyval.vector).count = 4;
+          (yyval.vector).count = 1;
           (yyval.vector).data[0] = (float) (yyvsp[(1) - (1)].integer);
-          (yyval.vector).data[1] = 0.0f;
-          (yyval.vector).data[2] = 0.0f;
-          (yyval.vector).data[3] = 1.0f;
+          (yyval.vector).data[1] = (float) (yyvsp[(1) - (1)].integer);
+          (yyval.vector).data[2] = (float) (yyvsp[(1) - (1)].integer);
+          (yyval.vector).data[3] = (float) (yyvsp[(1) - (1)].integer);
        ;}
     break;
 
index b4ba5b03f0e6f5be7c1872f9beba36d092e40f58..89e885021218b605619ab7eadb9ededcc7bfdb7e 100644 (file)
@@ -1641,19 +1641,19 @@ paramConstScalarDecl: signedFloatConstant
 
 paramConstScalarUse: REAL
        {
-          $$.count = 4;
+          $$.count = 1;
           $$.data[0] = $1;
-          $$.data[1] = 0.0f;
-          $$.data[2] = 0.0f;
-          $$.data[3] = 1.0f;
+          $$.data[1] = $1;
+          $$.data[2] = $1;
+          $$.data[3] = $1;
        }
        | INTEGER
        {
-          $$.count = 4;
+          $$.count = 1;
           $$.data[0] = (float) $1;
-          $$.data[1] = 0.0f;
-          $$.data[2] = 0.0f;
-          $$.data[3] = 1.0f;
+          $$.data[1] = (float) $1;
+          $$.data[2] = (float) $1;
+          $$.data[3] = (float) $1;
        }
        ;