nv40: always copy 4 float immediates for now.
authorBen Skeggs <skeggsb@gmail.com>
Thu, 14 Feb 2008 13:14:15 +0000 (00:14 +1100)
committerBen Skeggs <skeggsb@gmail.com>
Fri, 15 Feb 2008 02:51:12 +0000 (13:51 +1100)
src/mesa/pipe/nv40/nv40_fragprog.c

index cb7b4a5e70ddad4d8fb8acb19299123e201360c9..cc637f5dae2f43b311ca6fe0ad732f39cd112e3a 100644 (file)
@@ -710,14 +710,15 @@ nv40_fragprog_translate(struct nv40_context *nv40,
                {
                        struct tgsi_full_immediate *imm;
                        float vals[4];
-                       int i;
                        
                        imm = &parse.FullToken.FullImmediate;
                        assert(imm->Immediate.DataType == TGSI_IMM_FLOAT32);
                        assert(fpc->nr_imm < MAX_IMM);
 
-                       for (i = 0; i < (imm->Immediate.Size - 1); i++)
-                               vals[i] = imm->u.ImmediateFloat32[i].Float;
+                       vals[0] = imm->u.ImmediateFloat32[0].Float;
+                       vals[1] = imm->u.ImmediateFloat32[1].Float;
+                       vals[2] = imm->u.ImmediateFloat32[2].Float;
+                       vals[3] = imm->u.ImmediateFloat32[3].Float;
                        fpc->imm[fpc->nr_imm++] = constant(fpc, -1, vals);
                }
                        break;