https://git.reactos.org/?p=reactos.git;a=commitdiff;h=db6d1a41d0a36b83d82c3…
commit db6d1a41d0a36b83d82c31312f66b2d18602d6fd
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Mon Sep 21 23:01:50 2020 +0200
Commit: Jérôme Gardou <jerome.gardou(a)reactos.org>
CommitDate: Thu Feb 4 16:37:04 2021 +0100
[WINESYNC] d3dx9/tests: Test ApplyParameterBlock() while recording.
Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
wine commit id 85d3ad879d5b13f7fce378009aaf80b419ad6185 by Matteo Bruni
<mbruni(a)codeweavers.com>
---
modules/rostests/winetests/d3dx9_36/effect.c | 84 +++++++++++++++++++++++++++-
sdk/tools/winesync/d3dx9.cfg | 2 +-
2 files changed, 84 insertions(+), 2 deletions(-)
diff --git a/modules/rostests/winetests/d3dx9_36/effect.c
b/modules/rostests/winetests/d3dx9_36/effect.c
index d821f990b20..47237d7aef6 100644
--- a/modules/rostests/winetests/d3dx9_36/effect.c
+++ b/modules/rostests/winetests/d3dx9_36/effect.c
@@ -8033,8 +8033,8 @@ static void test_effect_parameter_block(void)
D3DPRESENT_PARAMETERS present_parameters = {0};
static const float float_array_zero[4];
IDirect3DTexture9 *texture, *tex_test;
+ D3DXHANDLE block, block2, handle;
ID3DXEffect *effect, *effect2;
- D3DXHANDLE block, handle;
IDirect3DDevice9 *device;
ID3DXEffectPool *pool;
float float_array[4];
@@ -8231,6 +8231,86 @@ static void test_effect_parameter_block(void)
hr = effect->lpVtbl->GetFloat(effect, "ts1[0].fv",
&float_value);
todo_wine ok(hr == D3D_OK && float_value == 28.0f, "Got unexpected hr
%#x, float_value %g.\n", hr, float_value);
+ hr = effect->lpVtbl->GetFloatArray(effect, "ts1[0].v2", float_array,
4);
+ todo_wine ok(hr == D3D_OK && float_array[0] == -29.0f
+ && !memcmp(float_array + 1, float_array_zero, 3 *
sizeof(*float_array)),
+ "Got unexpected hr %#x, ts1[0].v2 (%g, %g, %g, %g).\n", hr,
+ float_array[0], float_array[1], float_array[2], float_array[3]);
+
+ /* Test applying a parameter block while recording a new one. */
+ hr = effect->lpVtbl->SetFloat(effect, "arr2[0]", 0.0f);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = effect->lpVtbl->SetFloat(effect, "arr2[1]", 0.0f);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = effect->lpVtbl->SetFloatArray(effect, "ts1[0].v1",
float_array_zero, 3);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = effect->lpVtbl->SetFloat(effect, "ts1[0].fv", 0.0f);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = effect->lpVtbl->SetFloatArray(effect, "ts1[0].v2",
float_array_zero, 4);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ memset(&mat, 0, sizeof(mat));
+ hr = effect->lpVtbl->SetMatrix(effect, "m3x2row",
&effect_orig_mat);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = effect->lpVtbl->SetMatrix(effect, "m3x2column",
&effect_orig_mat);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+
+ hr = effect->lpVtbl->BeginParameterBlock(effect);
+ todo_wine ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = effect->lpVtbl->ApplyParameterBlock(effect, block);
+ todo_wine ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+
+ hr = effect->lpVtbl->GetFloat(effect, "arr2[0]", &float_value);
+ ok(hr == D3D_OK && float_value == 0.0f, "Got unexpected hr %#x,
float_value %g.\n", hr, float_value);
+ hr = effect->lpVtbl->GetFloat(effect, "arr2[1]", &float_value);
+ ok(hr == D3D_OK && float_value == 0.0f, "Got unexpected hr %#x,
float_value %g.\n", hr, float_value);
+
+ hr = effect->lpVtbl->GetFloatArray(effect, "ts1[0].v1", float_array,
3);
+ ok(hr == D3D_OK && !memcmp(float_array, float_array_zero, 3 *
sizeof(*float_array)),
+ "Got unexpected hr %#x, ts1[0].v1 (%g, %g, %g).\n", hr,
+ float_array[0], float_array[1], float_array[2]);
+
+ hr = effect->lpVtbl->GetMatrix(effect, "m3x2row", &mat);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ ok(!memcmp(&mat, &effect_orig_mat, sizeof(mat)), "Got unexpected
matrix.\n");
+ hr = effect->lpVtbl->GetMatrix(effect, "m3x2column", &mat);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ ok(!memcmp(&mat, &effect_orig_mat, sizeof(mat)), "Got unexpected
matrix.\n");
+
+ hr = effect->lpVtbl->GetFloat(effect, "ts1[0].fv",
&float_value);
+ ok(hr == D3D_OK && float_value == 0.0f, "Got unexpected hr %#x,
float_value %g.\n", hr, float_value);
+
+ hr = effect->lpVtbl->GetFloatArray(effect, "ts1[0].v2", float_array,
4);
+ ok(hr == D3D_OK && float_array[0] == 0.0f
+ && !memcmp(float_array + 1, float_array_zero, 3 *
sizeof(*float_array)),
+ "Got unexpected hr %#x, ts1[0].v2 (%g, %g, %g, %g).\n", hr,
+ float_array[0], float_array[1], float_array[2], float_array[3]);
+
+ block2 = effect->lpVtbl->EndParameterBlock(effect);
+ todo_wine ok(!!block2, "Got unexpected block %p.\n", block2);
+
+ hr = effect->lpVtbl->ApplyParameterBlock(effect, block2);
+ todo_wine ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+
+ hr = effect->lpVtbl->GetFloat(effect, "arr2[0]", &float_value);
+ todo_wine ok(hr == D3D_OK && float_value == 92.0f, "Got unexpected hr
%#x, float_value %g.\n", hr, float_value);
+ hr = effect->lpVtbl->GetFloat(effect, "arr2[1]", &float_value);
+ ok(hr == D3D_OK && float_value == 0.0f, "Got unexpected hr %#x,
float_value %g.\n", hr, float_value);
+
+ hr = effect->lpVtbl->GetFloatArray(effect, "ts1[0].v1", float_array,
3);
+ ok(hr == D3D_OK && !memcmp(float_array, float_array_zero, 3 *
sizeof(*float_array)),
+ "Got unexpected hr %#x, ts1[0].v1 (%g, %g, %g).\n", hr,
+ float_array[0], float_array[1], float_array[2]);
+
+ hr = effect->lpVtbl->GetMatrix(effect, "m3x2row", &mat);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ todo_wine ok(!memcmp(&mat, &test_mat, sizeof(mat)), "Got unexpected
matrix.\n");
+ hr = effect->lpVtbl->GetMatrix(effect, "m3x2column", &mat);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ todo_wine ok(!memcmp(&mat, &test_mat, sizeof(mat)), "Got unexpected
matrix.\n");
+
+ hr = effect->lpVtbl->GetFloat(effect, "ts1[0].fv",
&float_value);
+ todo_wine ok(hr == D3D_OK && float_value == 28.0f, "Got unexpected hr
%#x, float_value %g.\n", hr, float_value);
+
hr = effect->lpVtbl->GetFloatArray(effect, "ts1[0].v2", float_array,
4);
todo_wine ok(hr == D3D_OK && float_array[0] == -29.0f
&& !memcmp(float_array + 1, float_array_zero, 3 *
sizeof(*float_array)),
@@ -8239,6 +8319,8 @@ static void test_effect_parameter_block(void)
hr = effect->lpVtbl->DeleteParameterBlock(effect, block);
todo_wine ok(hr == D3D_OK, "Got result %#x.\n", hr);
+ hr = effect->lpVtbl->DeleteParameterBlock(effect, block2);
+ todo_wine ok(hr == D3D_OK, "Got result %#x.\n", hr);
hr = effect->lpVtbl->SetTexture(effect, "tex1", NULL);
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
diff --git a/sdk/tools/winesync/d3dx9.cfg b/sdk/tools/winesync/d3dx9.cfg
index a633fad4487..118bbd5df78 100644
--- a/sdk/tools/winesync/d3dx9.cfg
+++ b/sdk/tools/winesync/d3dx9.cfg
@@ -15,4 +15,4 @@ files: {include/d3dx9.h: sdk/include/dxsdk/d3dx9.h, include/d3dx9anim.h:
sdk/inc
include/d3dx9mesh.h: sdk/include/dxsdk/d3dx9mesh.h, include/d3dx9of.h:
sdk/include/dxsdk/d3dx9of.h,
include/d3dx9shader.h: sdk/include/dxsdk/d3dx9shader.h, include/d3dx9shape.h:
sdk/include/dxsdk/d3dx9shape.h,
include/d3dx9tex.h: sdk/include/dxsdk/d3dx9tex.h, include/d3dx9xof.h:
sdk/include/dxsdk/d3dx9xof.h}
-tags: {wine: 61ee765aa0ec0d0e478a9f82d73e602ea71419c2}
+tags: {wine: 85d3ad879d5b13f7fce378009aaf80b419ad6185}