r600 : fix draw_prim bug: vertex fetcher setting.
authorRichard Li <richardradeon@gmail.com>
Thu, 24 Sep 2009 15:26:15 +0000 (11:26 -0400)
committerRichard Li <richardradeon@gmail.com>
Thu, 24 Sep 2009 15:29:44 +0000 (11:29 -0400)
src/mesa/drivers/dri/r600/r700_chip.c

index 783427a94c9d82fb0fc0dab10fb7250d32a12b25..e3b8a4081a5a1fe6fd0e4336e79689e264503e73 100644 (file)
@@ -254,9 +254,22 @@ static void r700SetupVTXConstants2(GLcontext  * ctx,
     SETfield(uSQ_VTX_CONSTANT_WORD2_0, GetSurfaceFormat(pStreamDesc->type, pStreamDesc->size, NULL),
             SQ_VTX_CONSTANT_WORD2_0__DATA_FORMAT_shift,
             SQ_VTX_CONSTANT_WORD2_0__DATA_FORMAT_mask); /* TODO : trace back api for initial data type, not only GL_FLOAT */
-    SETfield(uSQ_VTX_CONSTANT_WORD2_0, SQ_NUM_FORMAT_SCALED,
-            SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_shift, SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_mask);
-    SETbit(uSQ_VTX_CONSTANT_WORD2_0, SQ_VTX_CONSTANT_WORD2_0__FORMAT_COMP_ALL_bit);
+    
+    if(GL_TRUE == pStreamDesc->normalize)\r
+    {\r
+        SETfield(uSQ_VTX_CONSTANT_WORD2_0, SQ_NUM_FORMAT_NORM,\r
+                    SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_shift, SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_mask);\r
+    }\r
+    //else\r
+    //{\r
+    //    SETfield(uSQ_VTX_CONSTANT_WORD2_0, SQ_NUM_FORMAT_INT,\r
+       //             SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_shift, SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_mask);\r
+    //}\r
+\r
+    if(1 == pStreamDesc->_signed)\r
+    {\r
+        SETbit(uSQ_VTX_CONSTANT_WORD2_0, SQ_VTX_CONSTANT_WORD2_0__FORMAT_COMP_ALL_bit);\r
+    }
 
     SETfield(uSQ_VTX_CONSTANT_WORD3_0, 1, MEM_REQUEST_SIZE_shift, MEM_REQUEST_SIZE_mask);
     SETfield(uSQ_VTX_CONSTANT_WORD6_0, SQ_TEX_VTX_VALID_BUFFER,