=?UTF-8?Q?Rico=20Sch=C3=BCller=20?=: d3dx9: Improve RegisterCount calculation for D3DXRS_INT4/BOOL.

Alexandre Julliard julliard at winehq.org
Wed Sep 26 14:06:50 CDT 2012


Module: wine
Branch: master
Commit: 82a800c128be2681633e6d4c9e62a1d2e0984b57
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=82a800c128be2681633e6d4c9e62a1d2e0984b57

Author: Rico Schüller <kgbricola at web.de>
Date:   Wed Sep 26 12:22:02 2012 +0200

d3dx9: Improve RegisterCount calculation for D3DXRS_INT4/BOOL.

---

 dlls/d3dx9_36/shader.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/dlls/d3dx9_36/shader.c b/dlls/d3dx9_36/shader.c
index dfa0488..3147d40 100644
--- a/dlls/d3dx9_36/shader.c
+++ b/dlls/d3dx9_36/shader.c
@@ -1644,6 +1644,27 @@ static HRESULT parse_ctab_constant_type(const char *ctab, DWORD typeoffset, stru
 
         /* offset in bytes => offsetdiff * components(4) * sizeof(DWORD) */
         if (offset) *offset += offsetdiff * 4 * 4;
+
+        /* int and bool registerset have different sizes */
+        if (regset == D3DXRS_INT4 || regset == D3DXRS_BOOL)
+        {
+            switch (type->Class)
+            {
+                case D3DXPC_SCALAR:
+                case D3DXPC_VECTOR:
+                    size = type->Columns;
+                    break;
+
+                case D3DXPC_MATRIX_ROWS:
+                case D3DXPC_MATRIX_COLUMNS:
+                    size = 4 * type->Columns;
+                    break;
+
+                default:
+                    FIXME("Unhandled type class %s\n", debug_d3dxparameter_class(type->Class));
+                    break;
+            }
+        }
     }
 
     constant->desc.RegisterCount = max(0, min(max - index, size));




More information about the wine-cvs mailing list