Zebediah Figura : d3dcompiler: Set the dimensions for array types.

Alexandre Julliard julliard at winehq.org
Thu Apr 30 15:24:09 CDT 2020


Module: wine
Branch: master
Commit: c6c060139627b9813c4f357cc278b89b729508ec
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=c6c060139627b9813c4f357cc278b89b729508ec

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Wed Apr 29 21:54:42 2020 -0500

d3dcompiler: Set the dimensions for array types.

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/d3dcompiler_43/tests/hlsl_d3d9.c | 6 +++---
 dlls/d3dcompiler_43/utils.c           | 2 ++
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/dlls/d3dcompiler_43/tests/hlsl_d3d9.c b/dlls/d3dcompiler_43/tests/hlsl_d3d9.c
index 9ebc42147e..093e6b3010 100644
--- a/dlls/d3dcompiler_43/tests/hlsl_d3d9.c
+++ b/dlls/d3dcompiler_43/tests/hlsl_d3d9.c
@@ -894,12 +894,12 @@ static void test_constant_table(void)
         "#pragma pack_matrix(row_major)\n"
         "    float2x2 d;\n"
         "} f;\n"
-        "uniform float g[5];\n"
+        "uniform float2 g[5];\n"
         "uniform matrix_t i;\n"
         "uniform struct matrix_record j;\n"
         "float4 main(uniform float4 h) : COLOR\n"
         "{\n"
-        "    return a + b + c._31 + d._31 + f.d._22 + g[e] + h + i._33 + j.a._33;\n"
+        "    return a + b + c._31 + d._31 + f.d._22 + g[e].x + h + i._33 + j.a._33;\n"
         "}";
 
     D3DXCONSTANTTABLE_DESC table_desc;
@@ -920,7 +920,7 @@ static void test_constant_table(void)
         {"d", D3DXRS_FLOAT4, 0, 3, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 1, 1, 0, 12},
         {"e", D3DXRS_FLOAT4, 0, 1, D3DXPC_SCALAR, D3DXPT_INT, 1, 1, 1, 0, 4},
         {"f", D3DXRS_FLOAT4, 0, 6, D3DXPC_STRUCT, D3DXPT_VOID, 1, 10, 1, 4, 40},
-        {"g", D3DXRS_FLOAT4, 0, 5, D3DXPC_SCALAR, D3DXPT_FLOAT, 1, 1, 5, 0, 20},
+        {"g", D3DXRS_FLOAT4, 0, 5, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 2, 5, 0, 40},
         {"i", D3DXRS_FLOAT4, 0, 3, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 3, 1, 0, 36},
         {"j", D3DXRS_FLOAT4, 0, 3, D3DXPC_STRUCT, D3DXPT_VOID, 1, 9, 1, 1, 36},
     };
diff --git a/dlls/d3dcompiler_43/utils.c b/dlls/d3dcompiler_43/utils.c
index d24341329d..f89db44858 100644
--- a/dlls/d3dcompiler_43/utils.c
+++ b/dlls/d3dcompiler_43/utils.c
@@ -841,6 +841,8 @@ struct hlsl_type *new_array_type(struct hlsl_type *basic_type, unsigned int arra
     type->e.array.elements_count = array_size;
     type->e.array.type = basic_type;
     type->reg_size = basic_type->reg_size * array_size;
+    type->dimx = basic_type->dimx;
+    type->dimy = basic_type->dimy;
     return type;
 }
 




More information about the wine-cvs mailing list