From: Nikolay Sivov nsivov@codeweavers.com
--- dlls/d3d10/tests/Makefile.in | 2 +- dlls/d3d10/tests/effect.c | 29 +++++++++++++---------------- 2 files changed, 14 insertions(+), 17 deletions(-)
diff --git a/dlls/d3d10/tests/Makefile.in b/dlls/d3d10/tests/Makefile.in index ba2e27097f7..4150c27973c 100644 --- a/dlls/d3d10/tests/Makefile.in +++ b/dlls/d3d10/tests/Makefile.in @@ -1,5 +1,5 @@ TESTDLL = d3d10.dll -IMPORTS = d3d10 +IMPORTS = d3d10 d3dcompiler EXTRADEFS = -DD3D_COMPILER_VERSION=0 PARENTSRC = ../../d3dcompiler_43/tests
diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index 12d54b8f053..774aa641ff3 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -19,6 +19,7 @@
#define COBJMACROS #include "d3d10.h" +#include "d3dcompiler.h" #include "wine/test.h"
#include <float.h> @@ -9794,25 +9795,16 @@ static void test_effect_value_expression(void) ok(!refcount, "Device has %lu references left.\n", refcount); }
-#if 0 -technique10 tech0 -{ - pass pass0 {} -}; -#endif -static DWORD fx_test_fx_4_1[] = -{ - 0x43425844, 0x228fcf4d, 0x9396b2f5, 0xd817b31f, 0xab6dd460, 0x00000001, 0x000000a0, 0x00000001, - 0x00000024, 0x30315846, 0x00000074, 0xfeff1011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000001, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x68636574, - 0x61700030, 0x00307373, 0x00000004, 0x00000001, 0x00000000, 0x0000000a, 0x00000000, 0x00000000, -}; - static void test_effect_fx_4_1(void) { + static const char source[] = + "technique10 tech0\n" + "{\n" + " pass pass0 {}\n" + "};"; ID3D10Effect *effect; ID3D10Device *device; + ID3D10Blob *blob; ULONG refcount; HRESULT hr;
@@ -9822,11 +9814,16 @@ static void test_effect_fx_4_1(void) return; }
- hr = create_effect(fx_test_fx_4_1, 0, device, NULL, &effect); + hr = D3DCompile(source, sizeof(source), NULL, NULL, NULL, "main", "fx_4_1", 0, 0, &blob, NULL); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + hr = create_effect(ID3D10Blob_GetBufferPointer(blob), 0, device, NULL, &effect); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
effect->lpVtbl->Release(effect);
+ ID3D10Blob_Release(blob); + refcount = ID3D10Device_Release(device); ok(!refcount, "Device has %lu references left.\n", refcount); }
From: Nikolay Sivov nsivov@codeweavers.com
--- dlls/d3d10/tests/effect.c | 44 +++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 16 deletions(-)
diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index 774aa641ff3..7a661e23f95 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -6029,18 +6029,15 @@ static void test_effect_matrix_variable(void) static const struct { const char *name; - D3D_SHADER_VARIABLE_TYPE type; - unsigned int rows; - unsigned int columns; - unsigned int elements; + D3D10_EFFECT_TYPE_DESC type; } tests[] = { - {"m_f0", D3D10_SVT_FLOAT, 4, 4, 1}, - {"m_i0", D3D10_SVT_INT, 2, 3, 1}, - {"m_b0", D3D10_SVT_BOOL, 3, 2, 1}, - {"m_f_a", D3D10_SVT_FLOAT, 4, 4, 2}, - {"m_b_a", D3D10_SVT_BOOL, 3, 2, 2}, + { "m_f0", { "float4x4", D3D10_SVC_MATRIX_COLUMNS, D3D10_SVT_FLOAT, 0, 0, 4, 4, 64, 64, 64 } }, + { "m_i0", { "int2x3", D3D10_SVC_MATRIX_ROWS, D3D10_SVT_INT, 0, 0, 2, 3, 24, 28, 32 } }, + { "m_b0", { "bool3x2", D3D10_SVC_MATRIX_COLUMNS, D3D10_SVT_BOOL, 0, 0, 3, 2, 24, 28, 32 } }, + { "m_f_a", { "float4x4", D3D10_SVC_MATRIX_COLUMNS, D3D10_SVT_FLOAT, 2, 0, 4, 4, 128, 128, 64 } }, + { "m_b_a", { "bool3x2", D3D10_SVC_MATRIX_COLUMNS, D3D10_SVT_BOOL, 2, 0, 3, 2, 48, 60, 32 } }, }; ID3D10EffectMatrixVariable *m_var; D3D10_EFFECT_TYPE_DESC type_desc; @@ -6077,17 +6074,32 @@ static void test_effect_matrix_variable(void)
for (i = 0; i < ARRAY_SIZE(tests); ++i) { + const D3D10_EFFECT_TYPE_DESC *t = &tests[i].type; + + winetest_push_context("Variable %s", tests[i].name); + var = effect->lpVtbl->GetVariableByName(effect, tests[i].name); type = var->lpVtbl->GetType(var); hr = type->lpVtbl->GetDesc(type, &type_desc); - ok(hr == S_OK, "Variable %s, got unexpected hr %#lx.\n", tests[i].name, hr); - ok(type_desc.Type == tests[i].type, "Variable %s, got unexpected type %#x.\n", - tests[i].name, type_desc.Type); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + ok(!strcmp(type_desc.TypeName, t->TypeName), "Unexpected type name %s.\n", type_desc.TypeName); + ok(type_desc.Class == t->Class, "Unexpected type class %u.\n", type_desc.Class); + ok(type_desc.Type == t->Type, "Unexpected type %u.\n", type_desc.Type); + ok(type_desc.Elements == t->Elements, "Unexpected elements count %u.\n", type_desc.Elements); + ok(type_desc.Members == t->Members, "Unexpected members count %u.\n", type_desc.Members); + ok(type_desc.Rows == t->Rows, "Unexpected rows count %u.\n", type_desc.Rows); + ok(type_desc.Columns == t->Columns, "Unexpected columns count %u.\n", type_desc.Columns); + ok(type_desc.PackedSize == t->PackedSize, "Unexpected packed size %u.\n", type_desc.PackedSize); + ok(type_desc.UnpackedSize == t->UnpackedSize, "Unexpected unpacked size %u.\n", type_desc.UnpackedSize); + ok(type_desc.Stride == t->Stride, "Unexpected stride %u.\n", type_desc.Stride); + m_var = var->lpVtbl->AsMatrix(var); - test_matrix_methods(m_var, tests[i].type, tests[i].name, tests[i].rows, tests[i].columns); - if (tests[i].elements > 1) - test_matrix_array_methods(m_var, tests[i].type, tests[i].name, tests[i].rows, tests[i].columns, - tests[i].elements); + test_matrix_methods(m_var, t->Type, tests[i].name, t->Rows, t->Columns); + if (t->Elements) + test_matrix_array_methods(m_var, t->Type, tests[i].name, t->Rows, t->Columns, t->Elements); + + winetest_pop_context(); }
effect->lpVtbl->Release(effect);
This merge request was approved by Matteo Bruni.