Zebediah Figura : wined3d: Remove stateblock handling from wined3d_device_multiply_transform().
Alexandre Julliard
julliard at winehq.org
Wed Jan 23 17:11:32 CST 2019
Module: wine
Branch: master
Commit: 7163fbba85b0f27f5bedb22291a6f53d2b507cdd
URL: https://source.winehq.org/git/wine.git/?a=commit;h=7163fbba85b0f27f5bedb22291a6f53d2b507cdd
Author: Zebediah Figura <z.figura12 at gmail.com>
Date: Tue Jan 22 19:50:24 2019 -0600
wined3d: Remove stateblock handling from wined3d_device_multiply_transform().
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/d3d8/tests/device.c | 1 -
dlls/d3d9/tests/device.c | 1 -
dlls/ddraw/tests/ddraw7.c | 1 -
dlls/wined3d/device.c | 17 ++++++-----------
4 files changed, 6 insertions(+), 14 deletions(-)
diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c
index 99f9ae1..5f8c0eb 100644
--- a/dlls/d3d8/tests/device.c
+++ b/dlls/d3d8/tests/device.c
@@ -9295,7 +9295,6 @@ static void test_multiply_transform(void)
hr = IDirect3DDevice8_GetTransform(device, tests[i], &ret_mat);
ok(hr == D3D_OK, "Test %u: Got unexpected hr %#x.\n", i, hr);
-todo_wine
ok(!memcmp(&ret_mat, &mat2, sizeof(mat2)), "Test %u: Got unexpected transform matrix.\n", i);
hr = IDirect3DDevice8_CaptureStateBlock(device, stateblock);
diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c
index 37cf8d9..896a730 100644
--- a/dlls/d3d9/tests/device.c
+++ b/dlls/d3d9/tests/device.c
@@ -13129,7 +13129,6 @@ static void test_multiply_transform(void)
hr = IDirect3DDevice9_GetTransform(device, tests[i], &ret_mat);
ok(hr == D3D_OK, "Test %u: Got unexpected hr %#x.\n", i, hr);
-todo_wine
ok(!memcmp(&ret_mat, &mat2, sizeof(mat2)), "Test %u: Got unexpected transform matrix.\n", i);
hr = IDirect3DStateBlock9_Capture(stateblock);
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c
index 3c81846..9374edb 100644
--- a/dlls/ddraw/tests/ddraw7.c
+++ b/dlls/ddraw/tests/ddraw7.c
@@ -15397,7 +15397,6 @@ static void test_multiply_transform(void)
hr = IDirect3DDevice7_GetTransform(device, tests[i], &ret_mat);
ok(hr == D3D_OK, "Test %u: Got unexpected hr %#x.\n", i, hr);
-todo_wine
ok(!memcmp(&ret_mat, &mat2, sizeof(mat2)), "Test %u: Got unexpected transform matrix.\n", i);
hr = IDirect3DDevice7_CaptureStateBlock(device, stateblock);
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index d03a982..b5460c9 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1529,26 +1529,21 @@ void CDECL wined3d_device_get_transform(const struct wined3d_device *device,
void CDECL wined3d_device_multiply_transform(struct wined3d_device *device,
enum wined3d_transform_state state, const struct wined3d_matrix *matrix)
{
- const struct wined3d_matrix *mat;
- struct wined3d_matrix temp;
+ struct wined3d_matrix *mat;
TRACE("device %p, state %s, matrix %p.\n", device, debug_d3dtstype(state), matrix);
- /* Note: Using 'updateStateBlock' rather than 'stateblock' in the code
- * below means it will be recorded in a state block change, but it
- * works regardless where it is recorded.
- * If this is found to be wrong, change to StateBlock. */
if (state > HIGHEST_TRANSFORMSTATE)
{
WARN("Unhandled transform state %#x.\n", state);
return;
}
- mat = &device->update_state->transforms[state];
- multiply_matrix(&temp, mat, matrix);
-
- /* Apply change via set transform - will reapply to eg. lights this way. */
- wined3d_device_set_transform(device, state, &temp);
+ /* Tests show that stateblock recording is ignored; the change goes directly
+ * into the primary stateblock. */
+ mat = &device->state.transforms[state];
+ multiply_matrix(mat, mat, matrix);
+ wined3d_cs_emit_set_transform(device->cs, state, matrix);
}
/* Note lights are real special cases. Although the device caps state only
More information about the wine-cvs
mailing list