d3d1x/sm4: save CUSTOMDATA
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>
Wed, 12 Oct 2011 17:37:02 +0000 (19:37 +0200)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Fri, 21 Oct 2011 21:00:36 +0000 (23:00 +0200)
This is the data for the immediate constant buffer.

src/gallium/state_trackers/d3d1x/d3d1xshader/src/sm4_parse.cpp

index 9d7392b9a2c3d88984db54109da57e6eab4c0cd0..e35f8f2be9b6bd7c63c4865ba4dd49095d7c20d4 100644 (file)
@@ -197,7 +197,18 @@ relative:
 
                        if(opcode == SM4_OPCODE_CUSTOMDATA)
                        {
+                               // immediate constant buffer data
                                unsigned customlen = read32() - 2;
+
+                               sm4_dcl& dcl = *new sm4_dcl;
+                               program.dcls.push_back(&dcl);
+
+                               dcl.opcode = SM4_OPCODE_CUSTOMDATA;
+                               dcl.num = customlen;
+                               dcl.data = malloc(customlen * sizeof(tokens[0]));
+
+                               memcpy(dcl.data, &tokens[0], customlen * sizeof(tokens[0]));
+
                                skip(customlen);
                                continue;
                        }