[3/6]: d3dx9: check for oCx register number.

Matteo Bruni matteo.mystral at gmail.com
Fri May 21 10:10:43 CDT 2010


Stefan had a point, adding more tests revealed that the register
number checks had some flaws: I missed some checks and other were too
strict (that happened to patches in my local tree, so that's not
visible here).
-------------- next part --------------
From d689b8c1ac900be9ffd03f602601babfbfc74bb6 Mon Sep 17 00:00:00 2001
From: Matteo Bruni <matteo.mystral at gmail.com>
Date: Fri, 21 May 2010 15:53:44 +0200
Subject: d3dx9: check for oCx register number.

---
 dlls/d3dx9_36/asmparser.c |    2 +-
 dlls/d3dx9_36/tests/asm.c |   11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/dlls/d3dx9_36/asmparser.c b/dlls/d3dx9_36/asmparser.c
index 3062639..dfd0936 100644
--- a/dlls/d3dx9_36/asmparser.c
+++ b/dlls/d3dx9_36/asmparser.c
@@ -259,7 +259,7 @@ static const struct allowed_reg_type ps_3_reg_allowed[] = {
     { BWRITERSPR_MISCTYPE,      2 }, /* vPos and vFace */
     { BWRITERSPR_LOOP,          1 },
     { BWRITERSPR_LABEL,      2048 },
-    { BWRITERSPR_COLOROUT,    ~0U },
+    { BWRITERSPR_COLOROUT,      4 },
     { BWRITERSPR_DEPTHOUT,      1 },
     { ~0U, 0 } /* End tag */
 };
diff --git a/dlls/d3dx9_36/tests/asm.c b/dlls/d3dx9_36/tests/asm.c
index 79c6c07..0b8cd3e 100644
--- a/dlls/d3dx9_36/tests/asm.c
+++ b/dlls/d3dx9_36/tests/asm.c
@@ -1146,6 +1146,11 @@ static void ps_3_0_test(void) {
             "texkill v0\n",
             {0xffff0300, 0x01000041, 0x900f0000, 0x0000ffff}
         },
+        {   /* shader 11 */
+            "ps_3_0\n"
+            "add oC3, r0, r1\n",
+            {0xffff0300, 0x03000002, 0x800f0803, 0x80e40000, 0x80e40001, 0x0000ffff}
+        },
     };
 
     exec_tests("ps_3_0", tests, sizeof(tests) / sizeof(tests[0]));
@@ -1236,6 +1241,12 @@ static void failure_test(void) {
         /* shader 25: _x4 instruction modified not allowed in > ps_1_x */
         "ps_3_0\n"
         "add_x4 r0, r0, r1\n",
+        /* shader 26: there aren't oCx registers in ps_1_x */
+        "ps_1_3\n"
+        "add oC0, r0, r1\n",
+        /* shader 27: oC3 is the max in >= ps_2_0 */
+        "ps_3_0\n"
+        "add oC4, r0, r1\n",
     };
     HRESULT hr;
     unsigned int i;
-- 
1.6.4.4


More information about the wine-patches mailing list