*We* know that these enums are equivalent, but Clang doesn't.
The remaining warnings are due to a bug in Clang around unions with enum types.
Signed-off-by: Chip Davis cdavis@codeweavers.com --- v2: Hide the casts behind functions. Reduce duplicated code. --- dlls/ddraw/device.c | 124 +++++++++++++++++--------------------------- 1 file changed, 47 insertions(+), 77 deletions(-)
diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index 048ba7fba66..a03b531f5bc 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -72,6 +72,40 @@ static inline WORD d3d_fpu_setup(void) return oldcw; }
+static inline enum wined3d_render_state wined3d_render_state_from_d3d(D3DRENDERSTATETYPE state) +{ + if (state == D3DRENDERSTATE_ZBIAS) + return WINED3D_RS_DEPTHBIAS; + return (enum wined3d_render_state)state; +} + +static inline enum wined3d_transform_state wined3d_transform_state_from_d3d(D3DTRANSFORMSTATETYPE state) +{ + switch (state) + { + case D3DTRANSFORMSTATE_WORLD: + return WINED3D_TS_WORLD_MATRIX(0); + case D3DTRANSFORMSTATE_WORLD1: + return WINED3D_TS_WORLD_MATRIX(1); + case D3DTRANSFORMSTATE_WORLD2: + return WINED3D_TS_WORLD_MATRIX(2); + case D3DTRANSFORMSTATE_WORLD3: + return WINED3D_TS_WORLD_MATRIX(3); + default: + return (enum wined3d_transform_state)state; + } +} + +static inline enum wined3d_primitive_type wined3d_primitive_type_from_d3d(D3DPRIMITIVETYPE type) +{ + return (enum wined3d_primitive_type)type; +} + +static inline enum wined3d_stateblock_type wined3d_stateblock_type_from_d3d(D3DSTATEBLOCKTYPE type) +{ + return (enum wined3d_stateblock_type)type; +} + static inline struct d3d_device *impl_from_IUnknown(IUnknown *iface) { return CONTAINING_RECORD(iface, struct d3d_device, IUnknown_inner); @@ -2396,10 +2430,6 @@ static HRESULT d3d_device7_GetRenderState(IDirect3DDevice7 *iface, hr = DDERR_INVALIDPARAMS; break;
- case D3DRENDERSTATE_ZBIAS: - *value = device_state->rs[WINED3D_RS_DEPTHBIAS]; - break; - default: if (state >= D3DRENDERSTATE_STIPPLEPATTERN00 && state <= D3DRENDERSTATE_STIPPLEPATTERN31) @@ -2408,7 +2438,7 @@ static HRESULT d3d_device7_GetRenderState(IDirect3DDevice7 *iface, hr = E_NOTIMPL; break; } - *value = device_state->rs[state]; + *value = device_state->rs[wined3d_render_state_from_d3d(state)]; } wined3d_mutex_unlock();
@@ -2622,10 +2652,6 @@ static HRESULT d3d_device7_SetRenderState(IDirect3DDevice7 *iface, hr = DDERR_INVALIDPARAMS; break;
- case D3DRENDERSTATE_ZBIAS: - wined3d_stateblock_set_render_state(device->update_state, WINED3D_RS_DEPTHBIAS, value); - break; - default: if (state >= D3DRENDERSTATE_STIPPLEPATTERN00 && state <= D3DRENDERSTATE_STIPPLEPATTERN31) @@ -2635,7 +2661,7 @@ static HRESULT d3d_device7_SetRenderState(IDirect3DDevice7 *iface, break; }
- wined3d_stateblock_set_render_state(device->update_state, state, value); + wined3d_stateblock_set_render_state(device->update_state, wined3d_render_state_from_d3d(state), value); break; } wined3d_mutex_unlock(); @@ -3097,34 +3123,16 @@ static HRESULT d3d_device7_SetTransform(IDirect3DDevice7 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix) { struct d3d_device *device = impl_from_IDirect3DDevice7(iface); - enum wined3d_transform_state wined3d_state;
TRACE("iface %p, state %#x, matrix %p.\n", iface, state, matrix);
- switch (state) - { - case D3DTRANSFORMSTATE_WORLD: - wined3d_state = WINED3D_TS_WORLD_MATRIX(0); - break; - case D3DTRANSFORMSTATE_WORLD1: - wined3d_state = WINED3D_TS_WORLD_MATRIX(1); - break; - case D3DTRANSFORMSTATE_WORLD2: - wined3d_state = WINED3D_TS_WORLD_MATRIX(2); - break; - case D3DTRANSFORMSTATE_WORLD3: - wined3d_state = WINED3D_TS_WORLD_MATRIX(3); - break; - default: - wined3d_state = state; - } - if (!matrix) return DDERR_INVALIDPARAMS;
/* Note: D3DMATRIX is compatible with struct wined3d_matrix. */ wined3d_mutex_lock(); - wined3d_stateblock_set_transform(device->update_state, wined3d_state, (const struct wined3d_matrix *)matrix); + wined3d_stateblock_set_transform(device->update_state, wined3d_transform_state_from_d3d(state), + (const struct wined3d_matrix *)matrix); wined3d_mutex_unlock();
return D3D_OK; @@ -3206,34 +3214,15 @@ static HRESULT d3d_device7_GetTransform(IDirect3DDevice7 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix) { struct d3d_device *device = impl_from_IDirect3DDevice7(iface); - enum wined3d_transform_state wined3d_state;
TRACE("iface %p, state %#x, matrix %p.\n", iface, state, matrix);
- switch (state) - { - case D3DTRANSFORMSTATE_WORLD: - wined3d_state = WINED3D_TS_WORLD_MATRIX(0); - break; - case D3DTRANSFORMSTATE_WORLD1: - wined3d_state = WINED3D_TS_WORLD_MATRIX(1); - break; - case D3DTRANSFORMSTATE_WORLD2: - wined3d_state = WINED3D_TS_WORLD_MATRIX(2); - break; - case D3DTRANSFORMSTATE_WORLD3: - wined3d_state = WINED3D_TS_WORLD_MATRIX(3); - break; - default: - wined3d_state = state; - } - if (!matrix) return DDERR_INVALIDPARAMS;
/* Note: D3DMATRIX is compatible with struct wined3d_matrix. */ wined3d_mutex_lock(); - memcpy(matrix, &device->stateblock_state->transforms[wined3d_state], sizeof(*matrix)); + memcpy(matrix, &device->stateblock_state->transforms[wined3d_transform_state_from_d3d(state)], sizeof(*matrix)); wined3d_mutex_unlock();
return D3D_OK; @@ -3310,32 +3299,13 @@ static HRESULT d3d_device7_MultiplyTransform(IDirect3DDevice7 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix) { struct d3d_device *device = impl_from_IDirect3DDevice7(iface); - enum wined3d_transform_state wined3d_state;
TRACE("iface %p, state %#x, matrix %p.\n", iface, state, matrix);
- switch (state) - { - case D3DTRANSFORMSTATE_WORLD: - wined3d_state = WINED3D_TS_WORLD_MATRIX(0); - break; - case D3DTRANSFORMSTATE_WORLD1: - wined3d_state = WINED3D_TS_WORLD_MATRIX(1); - break; - case D3DTRANSFORMSTATE_WORLD2: - wined3d_state = WINED3D_TS_WORLD_MATRIX(2); - break; - case D3DTRANSFORMSTATE_WORLD3: - wined3d_state = WINED3D_TS_WORLD_MATRIX(3); - break; - default: - wined3d_state = state; - } - /* Note: D3DMATRIX is compatible with struct wined3d_matrix. */ wined3d_mutex_lock(); wined3d_stateblock_multiply_transform(device->state, - wined3d_state, (struct wined3d_matrix *)matrix); + wined3d_transform_state_from_d3d(state), (struct wined3d_matrix *)matrix); wined3d_mutex_unlock();
return D3D_OK; @@ -3504,7 +3474,7 @@ static HRESULT d3d_device7_DrawPrimitive(IDirect3DDevice7 *iface, goto done;
wined3d_stateblock_set_vertex_declaration(device->state, ddraw_find_decl(device->ddraw, fvf)); - wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0); + wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_d3d(primitive_type), 0); wined3d_device_apply_stateblock(device->wined3d_device, device->state); hr = wined3d_device_draw_primitive(device->wined3d_device, vb_pos / stride, vertex_count);
@@ -3715,7 +3685,7 @@ static HRESULT d3d_device7_DrawIndexedPrimitive(IDirect3DDevice7 *iface, wined3d_stateblock_set_index_buffer(device->state, device->index_buffer, WINED3DFMT_R16_UINT);
wined3d_stateblock_set_vertex_declaration(device->state, ddraw_find_decl(device->ddraw, fvf)); - wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0); + wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_d3d(primitive_type), 0); wined3d_stateblock_set_base_vertex_index(device->state, vb_pos / stride); wined3d_device_apply_stateblock(device->wined3d_device, device->state); hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, ib_pos / sizeof(*indices), index_count); @@ -4042,7 +4012,7 @@ static HRESULT d3d_device7_DrawPrimitiveStrided(IDirect3DDevice7 *iface, D3DPRIM goto done; wined3d_stateblock_set_vertex_declaration(device->state, ddraw_find_decl(device->ddraw, fvf));
- wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0); + wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_d3d(primitive_type), 0); wined3d_device_apply_stateblock(device->wined3d_device, device->state); hr = wined3d_device_draw_primitive(device->wined3d_device, vb_pos / dst_stride, vertex_count);
@@ -4178,7 +4148,7 @@ static HRESULT d3d_device7_DrawIndexedPrimitiveStrided(IDirect3DDevice7 *iface, wined3d_stateblock_set_base_vertex_index(device->state, vb_pos / vtx_dst_stride);
wined3d_stateblock_set_vertex_declaration(device->state, ddraw_find_decl(device->ddraw, fvf)); - wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0); + wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_d3d(primitive_type), 0); wined3d_device_apply_stateblock(device->wined3d_device, device->state); hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, ib_pos / sizeof(WORD), index_count);
@@ -4300,7 +4270,7 @@ static HRESULT d3d_device7_DrawPrimitiveVB(IDirect3DDevice7 *iface, D3DPRIMITIVE }
/* Now draw the primitives */ - wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0); + wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_d3d(primitive_type), 0); wined3d_device_apply_stateblock(device->wined3d_device, device->state); hr = wined3d_device_draw_primitive(device->wined3d_device, start_vertex, vertex_count);
@@ -4454,7 +4424,7 @@ static HRESULT d3d_device7_DrawIndexedPrimitiveVB(IDirect3DDevice7 *iface, return hr; }
- wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0); + wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_d3d(primitive_type), 0); wined3d_device_apply_stateblock(device->wined3d_device, device->state); hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, ib_pos / sizeof(WORD), index_count);
@@ -6005,7 +5975,7 @@ static HRESULT d3d_device7_CreateStateBlock(IDirect3DDevice7 *iface, }
/* The D3DSTATEBLOCKTYPE enum is fine here. */ - hr = wined3d_stateblock_create(device->wined3d_device, device->state, type, &wined3d_sb); + hr = wined3d_stateblock_create(device->wined3d_device, device->state, wined3d_stateblock_type_from_d3d(type), &wined3d_sb); if (FAILED(hr)) { WARN("Failed to create stateblock, hr %#x.\n", hr);
Signed-off-by: Chip Davis cdavis@codeweavers.com --- I wanted to teach Clang not to emit these warnings, but they insisted that yes, Clang really should warn on absolute values of differences. So I gave up on that.
v2: Fold absdiff() into a compare_uint() helper. --- dlls/ddraw/tests/ddraw1.c | 17 ++++++++++++----- dlls/ddraw/tests/ddraw2.c | 19 +++++++++++++------ dlls/ddraw/tests/ddraw4.c | 19 +++++++++++++------ dlls/ddraw/tests/ddraw7.c | 19 +++++++++++++------ dlls/ddraw/tests/visual.c | 15 +++++++++++---- 5 files changed, 62 insertions(+), 27 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index ff100c64aa0..7157592c705 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -49,15 +49,22 @@ struct create_window_thread_param HANDLE thread; };
+static BOOL compare_uint(unsigned int x, unsigned int y, unsigned int max_diff) +{ + unsigned int diff = x > y ? x - y : y - x; + + return diff <= max_diff; +} + static BOOL compare_color(D3DCOLOR c1, D3DCOLOR c2, BYTE max_diff) { - if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff) return FALSE; + if (!compare_uint(c1 & 0xff, c2 & 0xff, max_diff)) return FALSE; c1 >>= 8; c2 >>= 8; - if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff) return FALSE; + if (!compare_uint(c1 & 0xff, c2 & 0xff, max_diff)) return FALSE; c1 >>= 8; c2 >>= 8; - if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff) return FALSE; + if (!compare_uint(c1 & 0xff, c2 & 0xff, max_diff)) return FALSE; c1 >>= 8; c2 >>= 8; - if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff) return FALSE; + if (!compare_uint(c1 & 0xff, c2 & 0xff, max_diff)) return FALSE; return TRUE; }
@@ -11770,7 +11777,7 @@ static void test_depth_readback(void) depth = *((DWORD *)ptr) & z_mask; expected_depth = (x * (0.9 / 640.0) + y * (0.1 / 480.0)) * z_mask; max_diff = ((0.5f * 0.9f) / 640.0f) * z_mask; - ok(abs(expected_depth - depth) <= max_diff, + ok(compare_uint(expected_depth, depth, max_diff), "z_depth %u: Got depth 0x%08x (diff %d), expected 0x%08x+/-%u, at %u, %u.\n", z_depth, depth, expected_depth - depth, expected_depth, max_diff, x, y); } diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index 5bb5b1baadf..c089713d7bc 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -50,15 +50,22 @@ struct create_window_thread_param HANDLE thread; };
+static BOOL compare_uint(unsigned int x, unsigned int y, unsigned int max_diff) +{ + unsigned int diff = x > y ? x - y : y - x; + + return diff <= max_diff; +} + static BOOL compare_color(D3DCOLOR c1, D3DCOLOR c2, BYTE max_diff) { - if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff) return FALSE; + if (!compare_uint(c1 & 0xff, c2 & 0xff, max_diff)) return FALSE; c1 >>= 8; c2 >>= 8; - if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff) return FALSE; + if (!compare_uint(c1 & 0xff, c2 & 0xff, max_diff)) return FALSE; c1 >>= 8; c2 >>= 8; - if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff) return FALSE; + if (!compare_uint(c1 & 0xff, c2 & 0xff, max_diff)) return FALSE; c1 >>= 8; c2 >>= 8; - if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff) return FALSE; + if (!compare_uint(c1 & 0xff, c2 & 0xff, max_diff)) return FALSE; return TRUE; }
@@ -12749,10 +12756,10 @@ static void test_depth_readback(void) /* The ddraw2 version of this test behaves similarly to the ddraw7 version on Nvidia GPUs, * except that we only have D16 (broken on geforce 9) and D24X8 (broken on geforce 7) available. * Accept all nvidia GPUs as broken here, but still expect one of the formats to pass. */ - ok(abs(expected_depth - depth) <= max_diff || ddraw_is_nvidia(ddraw), + ok(compare_uint(expected_depth, depth, max_diff) || ddraw_is_nvidia(ddraw), "Test %u: Got depth 0x%08x (diff %d), expected 0x%08x+/-%u, at %u, %u.\n", i, depth, expected_depth - depth, expected_depth, max_diff, x, y); - if (abs(expected_depth - depth) > max_diff) + if (!compare_uint(expected_depth, depth, max_diff)) all_pass = FALSE; } } diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index fc3a415433d..ae616ed68c5 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -80,15 +80,22 @@ static BOOL compare_vec4(const struct vec4 *vec, float x, float y, float z, floa && compare_float(vec->w, w, ulps); }
+static BOOL compare_uint(unsigned int x, unsigned int y, unsigned int max_diff) +{ + unsigned int diff = x > y ? x - y : y - x; + + return diff <= max_diff; +} + static BOOL compare_color(D3DCOLOR c1, D3DCOLOR c2, BYTE max_diff) { - if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff) return FALSE; + if (!compare_uint(c1 & 0xff, c2 & 0xff, max_diff)) return FALSE; c1 >>= 8; c2 >>= 8; - if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff) return FALSE; + if (!compare_uint(c1 & 0xff, c2 & 0xff, max_diff)) return FALSE; c1 >>= 8; c2 >>= 8; - if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff) return FALSE; + if (!compare_uint(c1 & 0xff, c2 & 0xff, max_diff)) return FALSE; c1 >>= 8; c2 >>= 8; - if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff) return FALSE; + if (!compare_uint(c1 & 0xff, c2 & 0xff, max_diff)) return FALSE; return TRUE; }
@@ -15282,10 +15289,10 @@ static void test_depth_readback(void) * returns 0 for that format. Give up on pre-filtering formats, accept Nvidia as generally * broken here, but still expect at least one format (D16 or D24X8 in practise) to pass. */ todo_wine_if(tests[i].todo) - ok(abs(expected_depth - depth) <= max_diff || ddraw_is_nvidia(ddraw), + ok(compare_uint(expected_depth, depth, max_diff) || ddraw_is_nvidia(ddraw), "Test %u: Got depth 0x%08x (diff %d), expected 0x%08x+/-%u, at %u, %u.\n", i, depth, expected_depth - depth, expected_depth, max_diff, x, y); - if (abs(expected_depth - depth) > max_diff) + if (!compare_uint(expected_depth, depth, max_diff)) all_pass = FALSE;
hr = IDirectDrawSurface4_Unlock(ds, &r); diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index abe5249cc06..578745271aa 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -87,15 +87,22 @@ static BOOL compare_vec4(const struct vec4 *vec, float x, float y, float z, floa && compare_float(vec->w, w, ulps); }
+static BOOL compare_uint(unsigned int x, unsigned int y, unsigned int max_diff) +{ + unsigned int diff = x > y ? x - y : y - x; + + return diff <= max_diff; +} + static BOOL compare_color(D3DCOLOR c1, D3DCOLOR c2, BYTE max_diff) { - if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff) return FALSE; + if (!compare_uint(c1 & 0xff, c2 & 0xff, max_diff)) return FALSE; c1 >>= 8; c2 >>= 8; - if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff) return FALSE; + if (!compare_uint(c1 & 0xff, c2 & 0xff, max_diff)) return FALSE; c1 >>= 8; c2 >>= 8; - if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff) return FALSE; + if (!compare_uint(c1 & 0xff, c2 & 0xff, max_diff)) return FALSE; c1 >>= 8; c2 >>= 8; - if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff) return FALSE; + if (!compare_uint(c1 & 0xff, c2 & 0xff, max_diff)) return FALSE; return TRUE; }
@@ -14726,11 +14733,11 @@ static void test_depth_readback(void) * Arx Fatalis is broken on the Geforce 9 in the same way it was broken in Wine (bug 43654). * The !tests[i].s_depth is supposed to rule out D16 on GF9 and D24X8 on GF7. */ todo_wine_if(tests[i].todo) - ok(abs(expected_depth - depth) <= max_diff + ok(compare_uint(expected_depth, depth, max_diff) || (ddraw_is_nvidia(ddraw) && (all_zero || all_one || !tests[i].s_depth)), "Test %u: Got depth 0x%08x (diff %d), expected 0x%08x+/-%u, at %u, %u.\n", i, depth, expected_depth - depth, expected_depth, max_diff, x, y); - if (abs(expected_depth - depth) > max_diff) + if (!compare_uint(expected_depth, depth, max_diff)) all_pass = FALSE;
hr = IDirectDrawSurface7_Unlock(ds, &r); diff --git a/dlls/ddraw/tests/visual.c b/dlls/ddraw/tests/visual.c index 2cb1c892314..a2f2f3cb04e 100644 --- a/dlls/ddraw/tests/visual.c +++ b/dlls/ddraw/tests/visual.c @@ -45,15 +45,22 @@ static BOOL refdevice = FALSE; static HRESULT (WINAPI *pDirectDrawCreateEx)(GUID *driver_guid, void **ddraw, REFIID interface_iid, IUnknown *outer);
+static BOOL compare_uint(unsigned int x, unsigned int y, unsigned int max_diff) +{ + unsigned int diff = x > y ? x - y : y - x; + + return diff <= max_diff; +} + static BOOL color_match(D3DCOLOR c1, D3DCOLOR c2, BYTE max_diff) { - if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff) return FALSE; + if (!compare_uint(c1 & 0xff, c2 & 0xff, max_diff)) return FALSE; c1 >>= 8; c2 >>= 8; - if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff) return FALSE; + if (!compare_uint(c1 & 0xff, c2 & 0xff, max_diff)) return FALSE; c1 >>= 8; c2 >>= 8; - if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff) return FALSE; + if (!compare_uint(c1 & 0xff, c2 & 0xff, max_diff)) return FALSE; c1 >>= 8; c2 >>= 8; - if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff) return FALSE; + if (!compare_uint(c1 & 0xff, c2 & 0xff, max_diff)) return FALSE; return TRUE; }
Signed-off-by: Chip Davis cdavis@codeweavers.com --- v2: Hide the casts behind functions. Reduce duplicated code. --- dlls/d3d8/d3d8_private.h | 10 +++++++ dlls/d3d8/device.c | 56 ++++++++++++++++++++++++++++------------ dlls/d3d8/directx.c | 12 ++++----- dlls/d3d8/surface.c | 2 +- dlls/d3d8/texture.c | 4 +-- 5 files changed, 58 insertions(+), 26 deletions(-)
diff --git a/dlls/d3d8/d3d8_private.h b/dlls/d3d8/d3d8_private.h index 93526411767..04bca7ddfa0 100644 --- a/dlls/d3d8/d3d8_private.h +++ b/dlls/d3d8/d3d8_private.h @@ -369,4 +369,14 @@ static inline unsigned int wined3d_bind_flags_from_d3d8_usage(DWORD usage) return bind_flags; }
+static inline D3DMULTISAMPLE_TYPE d3dmultisample_type_from_wined3d(enum wined3d_multisample_type type) +{ + return (D3DMULTISAMPLE_TYPE)type; +} + +static inline enum wined3d_device_type wined3d_device_type_from_d3d(D3DDEVTYPE type) +{ + return (enum wined3d_device_type)type; +} + #endif /* __WINE_D3DX8_PRIVATE_H */ diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 23e93df0616..7d0d7a05706 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -35,7 +35,7 @@ D3DFORMAT d3dformat_from_wined3dformat(enum wined3d_format_id format) BYTE *c = (BYTE *)&format;
/* Don't translate FOURCC formats */ - if (isprint(c[0]) && isprint(c[1]) && isprint(c[2]) && isprint(c[3])) return format; + if (isprint(c[0]) && isprint(c[1]) && isprint(c[2]) && isprint(c[3])) return (D3DFORMAT)format;
switch(format) { @@ -85,7 +85,7 @@ enum wined3d_format_id wined3dformat_from_d3dformat(D3DFORMAT format) BYTE *c = (BYTE *)&format;
/* Don't translate FOURCC formats */ - if (isprint(c[0]) && isprint(c[1]) && isprint(c[2]) && isprint(c[3])) return format; + if (isprint(c[0]) && isprint(c[1]) && isprint(c[2]) && isprint(c[3])) return (enum wined3d_format_id)format;
switch(format) { @@ -204,7 +204,7 @@ static void present_parameters_from_wined3d_swapchain_desc(D3DPRESENT_PARAMETERS present_parameters->BackBufferHeight = swapchain_desc->backbuffer_height; present_parameters->BackBufferFormat = d3dformat_from_wined3dformat(swapchain_desc->backbuffer_format); present_parameters->BackBufferCount = swapchain_desc->backbuffer_count; - present_parameters->MultiSampleType = swapchain_desc->multisample_type; + present_parameters->MultiSampleType = d3dmultisample_type_from_wined3d(swapchain_desc->multisample_type); present_parameters->SwapEffect = d3dswapeffect_from_wined3dswapeffect(swapchain_desc->swap_effect); present_parameters->hDeviceWindow = swapchain_desc->device_window; present_parameters->Windowed = swapchain_desc->windowed; @@ -255,6 +255,11 @@ static enum wined3d_swap_interval wined3dswapinterval_from_d3d(DWORD interval) } }
+static enum wined3d_multisample_type wined3d_multisample_type_from_d3d(D3DMULTISAMPLE_TYPE type) +{ + return (enum wined3d_multisample_type)type; +} + static BOOL wined3d_swapchain_desc_from_present_parameters(struct wined3d_swapchain_desc *swapchain_desc, const D3DPRESENT_PARAMETERS *present_parameters) { @@ -291,7 +296,7 @@ static BOOL wined3d_swapchain_desc_from_present_parameters(struct wined3d_swapch swapchain_desc->backbuffer_format = wined3dformat_from_d3dformat(present_parameters->BackBufferFormat); swapchain_desc->backbuffer_count = max(1, present_parameters->BackBufferCount); swapchain_desc->backbuffer_bind_flags = WINED3D_BIND_RENDER_TARGET; - swapchain_desc->multisample_type = present_parameters->MultiSampleType; + swapchain_desc->multisample_type = wined3d_multisample_type_from_d3d(present_parameters->MultiSampleType); swapchain_desc->multisample_quality = 0; /* d3d9 only */ swapchain_desc->swap_effect = wined3dswapeffect_from_d3dswapeffect(present_parameters->SwapEffect); swapchain_desc->device_window = present_parameters->hDeviceWindow; @@ -432,6 +437,23 @@ void d3dcaps_from_wined3dcaps(D3DCAPS8 *caps, const struct wined3d_caps *wined3d caps->MaxVertexShaderConst = min(D3D8_MAX_VERTEX_SHADER_CONSTANTF, caps->MaxVertexShaderConst); }
+static enum wined3d_transform_state wined3d_transform_state_from_d3d(D3DTRANSFORMSTATETYPE state) +{ + return (enum wined3d_transform_state)state; +} + +static enum wined3d_render_state wined3d_render_state_from_d3d(D3DRENDERSTATETYPE state) +{ + if (state == D3DRS_ZBIAS) + return WINED3D_RS_DEPTHBIAS; + return (enum wined3d_render_state)state; +} + +static enum wined3d_primitive_type wined3d_primitive_type_from_d3d(D3DPRIMITIVETYPE type) +{ + return (enum wined3d_primitive_type)type; +} + /* Handle table functions */ static DWORD d3d8_allocate_handle(struct d3d8_handle_table *t, void *object, enum d3d8_handle_type type) { @@ -1241,7 +1263,8 @@ static HRESULT WINAPI d3d8_device_CreateRenderTarget(IDirect3DDevice8 *iface, UI access |= WINED3D_RESOURCE_ACCESS_MAP_R | WINED3D_RESOURCE_ACCESS_MAP_W;
return d3d8_device_create_surface(device, wined3dformat_from_d3dformat(format), - multisample_type, WINED3D_BIND_RENDER_TARGET, access, width, height, surface); + wined3d_multisample_type_from_d3d(multisample_type), WINED3D_BIND_RENDER_TARGET, access, + width, height, surface); }
static HRESULT WINAPI d3d8_device_CreateDepthStencilSurface(IDirect3DDevice8 *iface, @@ -1259,7 +1282,7 @@ static HRESULT WINAPI d3d8_device_CreateDepthStencilSurface(IDirect3DDevice8 *if *surface = NULL;
return d3d8_device_create_surface(device, wined3dformat_from_d3dformat(format), - multisample_type, WINED3D_BIND_DEPTH_STENCIL, + wined3d_multisample_type_from_d3d(multisample_type), WINED3D_BIND_DEPTH_STENCIL, WINED3D_RESOURCE_ACCESS_GPU, width, height, surface); }
@@ -1621,7 +1644,7 @@ static HRESULT WINAPI d3d8_device_SetTransform(IDirect3DDevice8 *iface,
/* Note: D3DMATRIX is compatible with struct wined3d_matrix. */ wined3d_mutex_lock(); - wined3d_stateblock_set_transform(device->update_state, state, (const struct wined3d_matrix *)matrix); + wined3d_stateblock_set_transform(device->update_state, wined3d_transform_state_from_d3d(state), (const struct wined3d_matrix *)matrix); wined3d_mutex_unlock();
return D3D_OK; @@ -1651,7 +1674,8 @@ static HRESULT WINAPI d3d8_device_MultiplyTransform(IDirect3DDevice8 *iface,
/* Note: D3DMATRIX is compatible with struct wined3d_matrix. */ wined3d_mutex_lock(); - wined3d_stateblock_multiply_transform(device->state, state, (const struct wined3d_matrix *)matrix); + wined3d_stateblock_multiply_transform(device->state, wined3d_transform_state_from_d3d(state), + (const struct wined3d_matrix *)matrix); wined3d_mutex_unlock();
return D3D_OK; @@ -1875,9 +1899,7 @@ static HRESULT WINAPI d3d8_device_SetRenderState(IDirect3DDevice8 *iface, TRACE("iface %p, state %#x, value %#x.\n", iface, state, value);
wined3d_mutex_lock(); - if (state == D3DRS_ZBIAS) - state = WINED3D_RS_DEPTHBIAS; - wined3d_stateblock_set_render_state(device->update_state, state, value); + wined3d_stateblock_set_render_state(device->update_state, wined3d_render_state_from_d3d(state), value); if (state == D3DRS_POINTSIZE && value == D3D8_RESZ_CODE) resolve_depth_buffer(device); wined3d_mutex_unlock(); @@ -2439,7 +2461,7 @@ static HRESULT WINAPI d3d8_device_DrawPrimitive(IDirect3DDevice8 *iface, vertex_count = vertex_count_from_primitive_count(primitive_type, primitive_count); wined3d_mutex_lock(); d3d8_device_upload_sysmem_vertex_buffers(device, start_vertex, vertex_count); - wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0); + wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_d3d(primitive_type), 0); wined3d_device_apply_stateblock(device->wined3d_device, device->state); hr = wined3d_device_draw_primitive(device->wined3d_device, start_vertex, vertex_count); wined3d_mutex_unlock(); @@ -2464,7 +2486,7 @@ static HRESULT WINAPI d3d8_device_DrawIndexedPrimitive(IDirect3DDevice8 *iface, base_vertex_index = device->stateblock_state->base_vertex_index; d3d8_device_upload_sysmem_vertex_buffers(device, base_vertex_index + min_vertex_idx, vertex_count); d3d8_device_upload_sysmem_index_buffer(device, start_idx, index_count); - wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0); + wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_d3d(primitive_type), 0); wined3d_device_apply_stateblock(device->wined3d_device, device->state); hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, start_idx, index_count); wined3d_mutex_unlock(); @@ -2558,7 +2580,7 @@ static HRESULT WINAPI d3d8_device_DrawPrimitiveUP(IDirect3DDevice8 *iface, if (FAILED(hr)) goto done;
- wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0); + wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_d3d(primitive_type), 0); wined3d_device_apply_stateblock(device->wined3d_device, device->state); hr = wined3d_device_draw_primitive(device->wined3d_device, vb_pos / stride, vtx_count); wined3d_stateblock_set_stream_source(device->state, 0, NULL, 0, 0); @@ -2686,7 +2708,7 @@ static HRESULT WINAPI d3d8_device_DrawIndexedPrimitiveUP(IDirect3DDevice8 *iface wined3dformat_from_d3dformat(index_format)); wined3d_stateblock_set_base_vertex_index(device->state, vb_pos / vertex_stride - min_vertex_idx);
- wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0); + wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_d3d(primitive_type), 0); wined3d_device_apply_stateblock(device->wined3d_device, device->state); hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, ib_pos / idx_fmt_size, idx_count);
@@ -3694,7 +3716,7 @@ HRESULT device_init(struct d3d8_device *device, struct d3d8 *parent, struct wine
wined3d_mutex_lock(); wined3d_adapter = wined3d_output_get_adapter(parent->wined3d_outputs[output_idx]); - if (FAILED(hr = wined3d_device_create(wined3d, wined3d_adapter, device_type, + if (FAILED(hr = wined3d_device_create(wined3d, wined3d_adapter, wined3d_device_type_from_d3d(device_type), focus_window, flags, 4, feature_levels, ARRAY_SIZE(feature_levels), &device->device_parent, &device->wined3d_device))) { @@ -3704,7 +3726,7 @@ HRESULT device_init(struct d3d8_device *device, struct d3d8 *parent, struct wine return hr; }
- wined3d_get_device_caps(wined3d_adapter, device_type, &caps); + wined3d_get_device_caps(wined3d_adapter, wined3d_device_type_from_d3d(device_type), &caps); device->max_user_clip_planes = caps.MaxUserClipPlanes; device->vs_uniform_count = caps.MaxVertexShaderConst;
diff --git a/dlls/d3d8/directx.c b/dlls/d3d8/directx.c index 874f9ea047b..d09cfb5ef9b 100644 --- a/dlls/d3d8/directx.c +++ b/dlls/d3d8/directx.c @@ -232,7 +232,7 @@ static HRESULT WINAPI d3d8_CheckDeviceType(IDirect3D8 *iface, UINT adapter, D3DD return WINED3DERR_NOTAVAILABLE;
wined3d_mutex_lock(); - hr = wined3d_check_device_type(d3d8->wined3d, d3d8->wined3d_outputs[output_idx], device_type, + hr = wined3d_check_device_type(d3d8->wined3d, d3d8->wined3d_outputs[output_idx], wined3d_device_type_from_d3d(device_type), wined3dformat_from_d3dformat(display_format), wined3dformat_from_d3dformat(backbuffer_format), windowed); wined3d_mutex_unlock(); @@ -298,13 +298,13 @@ static HRESULT WINAPI d3d8_CheckDeviceFormat(IDirect3D8 *iface, UINT adapter, D3 { DWORD levels;
- hr = wined3d_check_device_multisample_type(wined3d_adapter, device_type, + hr = wined3d_check_device_multisample_type(wined3d_adapter, wined3d_device_type_from_d3d(device_type), WINED3DFMT_D24_UNORM_S8_UINT, FALSE, WINED3D_MULTISAMPLE_NON_MASKABLE, &levels); if (SUCCEEDED(hr) && !levels) hr = D3DERR_NOTAVAILABLE; } else - hr = wined3d_check_device_format(d3d8->wined3d, wined3d_adapter, device_type, + hr = wined3d_check_device_format(d3d8->wined3d, wined3d_adapter, wined3d_device_type_from_d3d(device_type), wined3dformat_from_d3dformat(adapter_format), usage, bind_flags, wined3d_rtype, wined3dformat_from_d3dformat(format)); wined3d_mutex_unlock(); @@ -332,7 +332,7 @@ static HRESULT WINAPI d3d8_CheckDeviceMultiSampleType(IDirect3D8 *iface, UINT ad
wined3d_mutex_lock(); wined3d_adapter = wined3d_output_get_adapter(d3d8->wined3d_outputs[output_idx]); - hr = wined3d_check_device_multisample_type(wined3d_adapter, device_type, + hr = wined3d_check_device_multisample_type(wined3d_adapter, wined3d_device_type_from_d3d(device_type), wined3dformat_from_d3dformat(format), windowed, (enum wined3d_multisample_type)multisample_type, NULL); wined3d_mutex_unlock(); @@ -357,7 +357,7 @@ static HRESULT WINAPI d3d8_CheckDepthStencilMatch(IDirect3D8 *iface, UINT adapte
wined3d_mutex_lock(); wined3d_adapter = wined3d_output_get_adapter(d3d8->wined3d_outputs[output_idx]); - hr = wined3d_check_depth_stencil_match(wined3d_adapter, device_type, + hr = wined3d_check_depth_stencil_match(wined3d_adapter, wined3d_device_type_from_d3d(device_type), wined3dformat_from_d3dformat(adapter_format), wined3dformat_from_d3dformat(rt_format), wined3dformat_from_d3dformat(ds_format)); wined3d_mutex_unlock(); @@ -384,7 +384,7 @@ static HRESULT WINAPI d3d8_GetDeviceCaps(IDirect3D8 *iface, UINT adapter, D3DDEV
wined3d_mutex_lock(); wined3d_adapter = wined3d_output_get_adapter(d3d8->wined3d_outputs[output_idx]); - hr = wined3d_get_device_caps(wined3d_adapter, device_type, &wined3d_caps); + hr = wined3d_get_device_caps(wined3d_adapter, wined3d_device_type_from_d3d(device_type), &wined3d_caps); wined3d_mutex_unlock();
d3dcaps_from_wined3dcaps(caps, &wined3d_caps, adapter); diff --git a/dlls/d3d8/surface.c b/dlls/d3d8/surface.c index bbd7e38338b..c3d28efba20 100644 --- a/dlls/d3d8/surface.c +++ b/dlls/d3d8/surface.c @@ -193,7 +193,7 @@ static HRESULT WINAPI d3d8_surface_GetDesc(IDirect3DSurface8 *iface, D3DSURFACE_ desc->Usage = d3dusage_from_wined3dusage(wined3d_desc.usage, wined3d_desc.bind_flags); desc->Pool = d3dpool_from_wined3daccess(wined3d_desc.access, wined3d_desc.usage); desc->Size = wined3d_desc.size; - desc->MultiSampleType = wined3d_desc.multisample_type; + desc->MultiSampleType = d3dmultisample_type_from_wined3d(wined3d_desc.multisample_type); desc->Width = wined3d_desc.width; desc->Height = wined3d_desc.height;
diff --git a/dlls/d3d8/texture.c b/dlls/d3d8/texture.c index c82a75d87a4..f383b374bde 100644 --- a/dlls/d3d8/texture.c +++ b/dlls/d3d8/texture.c @@ -255,7 +255,7 @@ static HRESULT WINAPI d3d8_texture_2d_GetLevelDesc(IDirect3DTexture8 *iface, UIN desc->Usage = d3dusage_from_wined3dusage(wined3d_desc.usage, wined3d_desc.bind_flags); desc->Pool = d3dpool_from_wined3daccess(wined3d_desc.access, wined3d_desc.usage); desc->Size = wined3d_desc.size; - desc->MultiSampleType = wined3d_desc.multisample_type; + desc->MultiSampleType = d3dmultisample_type_from_wined3d(wined3d_desc.multisample_type); desc->Width = wined3d_desc.width; desc->Height = wined3d_desc.height; } @@ -602,7 +602,7 @@ static HRESULT WINAPI d3d8_texture_cube_GetLevelDesc(IDirect3DCubeTexture8 *ifac desc->Usage = d3dusage_from_wined3dusage(wined3d_desc.usage, wined3d_desc.bind_flags); desc->Pool = d3dpool_from_wined3daccess(wined3d_desc.access, wined3d_desc.usage); desc->Size = wined3d_desc.size; - desc->MultiSampleType = wined3d_desc.multisample_type; + desc->MultiSampleType = d3dmultisample_type_from_wined3d(wined3d_desc.multisample_type); desc->Width = wined3d_desc.width; desc->Height = wined3d_desc.height; }
Signed-off-by: Chip Davis cdavis@codeweavers.com --- v2: Fold absdiff() into a compare_uint() helper. --- dlls/d3d8/tests/device.c | 4 ++-- dlls/d3d8/tests/visual.c | 15 +++++++++++---- 2 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c index d87832b716d..26687af5f15 100644 --- a/dlls/d3d8/tests/device.c +++ b/dlls/d3d8/tests/device.c @@ -1294,8 +1294,8 @@ static int compare_mode(const void *a, const void *b) { const struct mode *mode_a = a; const struct mode *mode_b = b; - unsigned int w = mode_a->w - mode_b->w; - unsigned int h = mode_a->h - mode_b->h; + int w = mode_a->w - mode_b->w; + int h = mode_a->h - mode_b->h; return abs(w) >= abs(h) ? -w : -h; }
diff --git a/dlls/d3d8/tests/visual.c b/dlls/d3d8/tests/visual.c index ab194b9cedf..033c92e6276 100644 --- a/dlls/d3d8/tests/visual.c +++ b/dlls/d3d8/tests/visual.c @@ -51,15 +51,22 @@ static HWND create_window(void) 0, 0, rect.right - rect.left, rect.bottom - rect.top, 0, 0, 0, 0); }
+static BOOL compare_uint(unsigned int x, unsigned int y, unsigned int max_diff) +{ + unsigned int diff = x > y ? x - y : y - x; + + return diff <= max_diff; +} + static BOOL color_match(D3DCOLOR c1, D3DCOLOR c2, BYTE max_diff) { - if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff) return FALSE; + if (!compare_uint(c1 & 0xff, c2 & 0xff, max_diff)) return FALSE; c1 >>= 8; c2 >>= 8; - if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff) return FALSE; + if (!compare_uint(c1 & 0xff, c2 & 0xff, max_diff)) return FALSE; c1 >>= 8; c2 >>= 8; - if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff) return FALSE; + if (!compare_uint(c1 & 0xff, c2 & 0xff, max_diff)) return FALSE; c1 >>= 8; c2 >>= 8; - if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff) return FALSE; + if (!compare_uint(c1 & 0xff, c2 & 0xff, max_diff)) return FALSE; return TRUE; }
Signed-off-by: Chip Davis cdavis@codeweavers.com --- v2: Hide the casts behind functions. --- dlls/d3d9/d3d9_private.h | 25 +++++++++++++ dlls/d3d9/device.c | 77 +++++++++++++++++++++++++++------------- dlls/d3d9/directx.c | 29 +++++++-------- dlls/d3d9/query.c | 14 ++++++-- dlls/d3d9/surface.c | 2 +- dlls/d3d9/swapchain.c | 2 +- dlls/d3d9/texture.c | 4 +-- 7 files changed, 109 insertions(+), 44 deletions(-)
diff --git a/dlls/d3d9/d3d9_private.h b/dlls/d3d9/d3d9_private.h index ff9a8fec0b0..e78ce75a2f0 100644 --- a/dlls/d3d9/d3d9_private.h +++ b/dlls/d3d9/d3d9_private.h @@ -336,6 +336,16 @@ static inline D3DPOOL d3dpool_from_wined3daccess(unsigned int access, unsigned i } }
+static inline D3DMULTISAMPLE_TYPE d3dmultisample_type_from_wined3d(enum wined3d_multisample_type type) +{ + return (D3DMULTISAMPLE_TYPE)type; +} + +static inline D3DSCANLINEORDERING d3dscanlineordering_from_wined3d(enum wined3d_scanline_ordering ordering) +{ + return (D3DSCANLINEORDERING)ordering; +} + static inline unsigned int map_access_from_usage(unsigned int usage) { if (usage & D3DUSAGE_WRITEONLY) @@ -384,4 +394,19 @@ static inline DWORD wined3dusage_from_d3dusage(unsigned int usage) return usage & WINED3DUSAGE_MASK; }
+static inline enum wined3d_multisample_type wined3d_multisample_type_from_d3d(D3DMULTISAMPLE_TYPE type) +{ + return (enum wined3d_multisample_type)type; +} + +static inline enum wined3d_device_type wined3d_device_type_from_d3d(D3DDEVTYPE type) +{ + return (enum wined3d_device_type)type; +} + +static inline enum wined3d_scanline_ordering wined3d_scanline_ordering_from_d3d(D3DSCANLINEORDERING ordering) +{ + return (enum wined3d_scanline_ordering)ordering; +} + #endif /* __WINE_D3D9_PRIVATE_H */ diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 61cb505d77a..b74dcd48f82 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -44,7 +44,7 @@ D3DFORMAT d3dformat_from_wined3dformat(enum wined3d_format_id format) BYTE *c = (BYTE *)&format;
/* Don't translate FOURCC formats */ - if (isprint(c[0]) && isprint(c[1]) && isprint(c[2]) && isprint(c[3])) return format; + if (isprint(c[0]) && isprint(c[1]) && isprint(c[2]) && isprint(c[3])) return (D3DFORMAT)format;
switch(format) { @@ -108,7 +108,7 @@ enum wined3d_format_id wined3dformat_from_d3dformat(D3DFORMAT format) BYTE *c = (BYTE *)&format;
/* Don't translate FOURCC formats */ - if (isprint(c[0]) && isprint(c[1]) && isprint(c[2]) && isprint(c[3])) return format; + if (isprint(c[0]) && isprint(c[1]) && isprint(c[2]) && isprint(c[3])) return (enum wined3d_format_id)format;
switch(format) { @@ -244,7 +244,7 @@ void present_parameters_from_wined3d_swapchain_desc(D3DPRESENT_PARAMETERS *prese present_parameters->BackBufferHeight = swapchain_desc->backbuffer_height; present_parameters->BackBufferFormat = d3dformat_from_wined3dformat(swapchain_desc->backbuffer_format); present_parameters->BackBufferCount = swapchain_desc->backbuffer_count; - present_parameters->MultiSampleType = swapchain_desc->multisample_type; + present_parameters->MultiSampleType = d3dmultisample_type_from_wined3d(swapchain_desc->multisample_type); present_parameters->MultiSampleQuality = swapchain_desc->multisample_quality; present_parameters->SwapEffect = d3dswapeffect_from_wined3dswapeffect(swapchain_desc->swap_effect); present_parameters->hDeviceWindow = swapchain_desc->device_window; @@ -335,7 +335,7 @@ static BOOL wined3d_swapchain_desc_from_present_parameters(struct wined3d_swapch swapchain_desc->backbuffer_format = wined3dformat_from_d3dformat(present_parameters->BackBufferFormat); swapchain_desc->backbuffer_count = max(1, present_parameters->BackBufferCount); swapchain_desc->backbuffer_bind_flags = WINED3D_BIND_RENDER_TARGET; - swapchain_desc->multisample_type = present_parameters->MultiSampleType; + swapchain_desc->multisample_type = wined3d_multisample_type_from_d3d(present_parameters->MultiSampleType); swapchain_desc->multisample_quality = present_parameters->MultiSampleQuality; swapchain_desc->swap_effect = wined3dswapeffect_from_d3dswapeffect(present_parameters->SwapEffect); swapchain_desc->device_window = present_parameters->hDeviceWindow; @@ -551,6 +551,31 @@ void d3d9_caps_from_wined3dcaps(const struct d3d9 *d3d9, unsigned int adapter_or } }
+static enum wined3d_texture_filter_type wined3d_texture_filter_type_from_d3d(D3DTEXTUREFILTERTYPE type) +{ + return (enum wined3d_texture_filter_type)type; +} + +static enum wined3d_transform_state wined3d_transform_state_from_d3d(D3DTRANSFORMSTATETYPE type) +{ + return (enum wined3d_transform_state)type; +} + +static enum wined3d_render_state wined3d_render_state_from_d3d(D3DRENDERSTATETYPE type) +{ + return (enum wined3d_render_state)type; +} + +static enum wined3d_sampler_state wined3d_sampler_state_from_d3d(D3DSAMPLERSTATETYPE type) +{ + return (enum wined3d_sampler_state)type; +} + +static enum wined3d_primitive_type wined3d_primitive_type_from_d3d(D3DPRIMITIVETYPE type) +{ + return (enum wined3d_primitive_type)type; +} + static void device_reset_viewport_state(struct d3d9_device *device) { struct wined3d_viewport vp; @@ -1008,7 +1033,7 @@ static HRESULT d3d9_device_reset(struct d3d9_device *device, wined3d_mode.height = mode->Height; wined3d_mode.refresh_rate = mode->RefreshRate; wined3d_mode.format_id = wined3dformat_from_d3dformat(mode->Format); - wined3d_mode.scanline_ordering = mode->ScanLineOrdering; + wined3d_mode.scanline_ordering = wined3d_scanline_ordering_from_d3d(mode->ScanLineOrdering); }
if (!wined3d_swapchain_desc_from_present_parameters(&swapchain_desc, present_parameters, extended)) @@ -1522,7 +1547,8 @@ static HRESULT d3d9_device_create_surface(struct d3d9_device *device, unsigned i
if (user_mem) wined3d_texture_update_desc(texture, width, height, - desc.format, multisample_type, multisample_quality, user_mem, 0); + desc.format, wined3d_multisample_type_from_d3d(multisample_type), multisample_quality, + user_mem, 0);
wined3d_texture_decref(texture);
@@ -1574,8 +1600,9 @@ static HRESULT WINAPI d3d9_device_CreateRenderTarget(IDirect3DDevice9Ex *iface, if (lockable) access |= WINED3D_RESOURCE_ACCESS_MAP_R | WINED3D_RESOURCE_ACCESS_MAP_W;
- return d3d9_device_create_surface(device, 0, wined3dformat_from_d3dformat(format), multisample_type, - multisample_quality, 0, WINED3D_BIND_RENDER_TARGET, access, width, height, NULL, surface); + return d3d9_device_create_surface(device, 0, wined3dformat_from_d3dformat(format), + wined3d_multisample_type_from_d3d(multisample_type), multisample_quality, 0, WINED3D_BIND_RENDER_TARGET, + access, width, height, NULL, surface); }
static HRESULT WINAPI d3d9_device_CreateDepthStencilSurface(IDirect3DDevice9Ex *iface, UINT width, UINT height, @@ -1606,7 +1633,7 @@ static HRESULT WINAPI d3d9_device_CreateDepthStencilSurface(IDirect3DDevice9Ex * flags |= WINED3D_TEXTURE_CREATE_DISCARD;
return d3d9_device_create_surface(device, flags, wined3dformat_from_d3dformat(format), - multisample_type, multisample_quality, 0, WINED3D_BIND_DEPTH_STENCIL, + wined3d_multisample_type_from_d3d(multisample_type), multisample_quality, 0, WINED3D_BIND_DEPTH_STENCIL, WINED3D_RESOURCE_ACCESS_GPU, width, height, NULL, surface); }
@@ -1807,7 +1834,8 @@ static HRESULT WINAPI d3d9_device_StretchRect(IDirect3DDevice9Ex *iface, IDirect }
hr = wined3d_texture_blt(dst->wined3d_texture, dst->sub_resource_idx, dst_rect, - src->wined3d_texture, src->sub_resource_idx, src_rect, 0, NULL, filter); + src->wined3d_texture, src->sub_resource_idx, src_rect, 0, NULL, + wined3d_texture_filter_type_from_d3d(filter)); if (hr == WINEDDERR_INVALIDRECT) hr = D3DERR_INVALIDCALL; if (SUCCEEDED(hr) && dst->texture) @@ -2136,7 +2164,8 @@ static HRESULT WINAPI d3d9_device_SetTransform(IDirect3DDevice9Ex *iface,
/* Note: D3DMATRIX is compatible with struct wined3d_matrix. */ wined3d_mutex_lock(); - wined3d_stateblock_set_transform(device->update_state, state, (const struct wined3d_matrix *)matrix); + wined3d_stateblock_set_transform(device->update_state, wined3d_transform_state_from_d3d(state), + (const struct wined3d_matrix *)matrix); wined3d_mutex_unlock();
return D3D_OK; @@ -2166,7 +2195,7 @@ static HRESULT WINAPI d3d9_device_MultiplyTransform(IDirect3DDevice9Ex *iface,
/* Note: D3DMATRIX is compatible with struct wined3d_matrix. */ wined3d_mutex_lock(); - wined3d_stateblock_multiply_transform(device->state, state, (const struct wined3d_matrix *)matrix); + wined3d_stateblock_multiply_transform(device->state, wined3d_transform_state_from_d3d(state), (const struct wined3d_matrix *)matrix); wined3d_mutex_unlock();
return D3D_OK; @@ -2369,7 +2398,7 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_SetRenderState(IDirect3DDevi TRACE("iface %p, state %#x, value %#x.\n", iface, state, value);
wined3d_mutex_lock(); - wined3d_stateblock_set_render_state(device->update_state, state, value); + wined3d_stateblock_set_render_state(device->update_state, wined3d_render_state_from_d3d(state), value); if (state == D3DRS_POINTSIZE && value == D3D9_RESZ_CODE) resolve_depth_buffer(device); wined3d_mutex_unlock(); @@ -2715,7 +2744,7 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_SetSamplerState(IDirect3DDev sampler -= D3DVERTEXTEXTURESAMPLER0 - WINED3D_VERTEX_SAMPLER_OFFSET;
wined3d_mutex_lock(); - wined3d_stateblock_set_sampler_state(device->update_state, sampler, state, value); + wined3d_stateblock_set_sampler_state(device->update_state, sampler, wined3d_sampler_state_from_d3d(state), value); wined3d_mutex_unlock();
return D3D_OK; @@ -2965,7 +2994,7 @@ static HRESULT WINAPI d3d9_device_DrawPrimitive(IDirect3DDevice9Ex *iface, vertex_count = vertex_count_from_primitive_count(primitive_type, primitive_count); d3d9_device_upload_sysmem_vertex_buffers(device, 0, start_vertex, vertex_count); d3d9_generate_auto_mipmaps(device); - wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0); + wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_d3d(primitive_type), 0); hr = wined3d_device_draw_primitive(device->wined3d_device, start_vertex, vertex_count); if (SUCCEEDED(hr)) d3d9_rts_flag_auto_gen_mipmap(device); @@ -2999,7 +3028,7 @@ static HRESULT WINAPI d3d9_device_DrawIndexedPrimitive(IDirect3DDevice9Ex *iface d3d9_device_upload_sysmem_index_buffer(device, start_idx, index_count); d3d9_generate_auto_mipmaps(device); wined3d_stateblock_set_base_vertex_index(device->state, base_vertex_idx); - wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0); + wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_d3d(primitive_type), 0); wined3d_device_apply_stateblock(device->wined3d_device, device->state); hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, start_idx, index_count); if (SUCCEEDED(hr)) @@ -3108,7 +3137,7 @@ static HRESULT WINAPI d3d9_device_DrawPrimitiveUP(IDirect3DDevice9Ex *iface, goto done;
d3d9_generate_auto_mipmaps(device); - wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0); + wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_d3d(primitive_type), 0); wined3d_device_apply_stateblock(device->wined3d_device, device->state); hr = wined3d_device_draw_primitive(device->wined3d_device, vb_pos / stride, vtx_count); wined3d_stateblock_set_stream_source(device->state, 0, NULL, 0, 0); @@ -3252,7 +3281,7 @@ static HRESULT WINAPI d3d9_device_DrawIndexedPrimitiveUP(IDirect3DDevice9Ex *ifa wined3d_stateblock_set_base_vertex_index(device->state, vb_pos / vertex_stride - min_vertex_idx);
wined3d_device_apply_stateblock(device->wined3d_device, device->state); - wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0); + wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_d3d(primitive_type), 0); hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, ib_pos / idx_fmt_size, idx_count);
wined3d_stateblock_set_stream_source(device->state, 0, NULL, 0, 0); @@ -4254,7 +4283,7 @@ static HRESULT WINAPI d3d9_device_CreateRenderTargetEx(IDirect3DDevice9Ex *iface access |= WINED3D_RESOURCE_ACCESS_MAP_R | WINED3D_RESOURCE_ACCESS_MAP_W;
return d3d9_device_create_surface(device, 0, wined3dformat_from_d3dformat(format), - multisample_type, multisample_quality, usage & WINED3DUSAGE_MASK, + wined3d_multisample_type_from_d3d(multisample_type), multisample_quality, usage & WINED3DUSAGE_MASK, WINED3D_BIND_RENDER_TARGET, access, width, height, NULL, surface); }
@@ -4294,8 +4323,8 @@ static HRESULT WINAPI d3d9_device_CreateDepthStencilSurfaceEx(IDirect3DDevice9Ex
*surface = NULL; return d3d9_device_create_surface(device, flags, wined3dformat_from_d3dformat(format), - multisample_type, multisample_quality, usage & WINED3DUSAGE_MASK, WINED3D_BIND_DEPTH_STENCIL, - WINED3D_RESOURCE_ACCESS_GPU, width, height, NULL, surface); + wined3d_multisample_type_from_d3d(multisample_type), multisample_quality, usage & WINED3DUSAGE_MASK, + WINED3D_BIND_DEPTH_STENCIL, WINED3D_RESOURCE_ACCESS_GPU, width, height, NULL, surface); }
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_ResetEx(IDirect3DDevice9Ex *iface, @@ -4347,7 +4376,7 @@ static HRESULT WINAPI d3d9_device_GetDisplayModeEx(IDirect3DDevice9Ex *iface, mode->Height = wined3d_mode.height; mode->RefreshRate = wined3d_mode.refresh_rate; mode->Format = d3dformat_from_wined3dformat(wined3d_mode.format_id); - mode->ScanLineOrdering = wined3d_mode.scanline_ordering; + mode->ScanLineOrdering = d3dscanlineordering_from_wined3d(wined3d_mode.scanline_ordering); }
return hr; @@ -4658,7 +4687,7 @@ HRESULT device_init(struct d3d9_device *device, struct d3d9 *parent, struct wine
wined3d_mutex_lock(); wined3d_adapter = wined3d_output_get_adapter(parent->wined3d_outputs[output_idx]); - if (FAILED(hr = wined3d_device_create(wined3d, wined3d_adapter, device_type, + if (FAILED(hr = wined3d_device_create(wined3d, wined3d_adapter, wined3d_device_type_from_d3d(device_type), focus_window, flags, 4, feature_levels, ARRAY_SIZE(feature_levels), &device->device_parent, &device->wined3d_device))) { @@ -4667,7 +4696,7 @@ HRESULT device_init(struct d3d9_device *device, struct d3d9 *parent, struct wine return hr; }
- wined3d_get_device_caps(wined3d_adapter, device_type, &wined3d_caps); + wined3d_get_device_caps(wined3d_adapter, wined3d_device_type_from_d3d(device_type), &wined3d_caps); d3d9_caps_from_wined3dcaps(parent, adapter, &caps, &wined3d_caps); device->max_user_clip_planes = caps.MaxUserClipPlanes; device->vs_uniform_count = caps.MaxVertexShaderConst; diff --git a/dlls/d3d9/directx.c b/dlls/d3d9/directx.c index 6c67be31b45..37adfb7a68c 100644 --- a/dlls/d3d9/directx.c +++ b/dlls/d3d9/directx.c @@ -268,8 +268,8 @@ static HRESULT WINAPI d3d9_CheckDeviceType(IDirect3D9Ex *iface, UINT adapter, D3 return WINED3DERR_NOTAVAILABLE;
wined3d_mutex_lock(); - hr = wined3d_check_device_type(d3d9->wined3d, d3d9->wined3d_outputs[output_idx], device_type, - wined3dformat_from_d3dformat(display_format), + hr = wined3d_check_device_type(d3d9->wined3d, d3d9->wined3d_outputs[output_idx], + wined3d_device_type_from_d3d(device_type), wined3dformat_from_d3dformat(display_format), wined3dformat_from_d3dformat(backbuffer_format), windowed); wined3d_mutex_unlock();
@@ -334,13 +334,13 @@ static HRESULT WINAPI d3d9_CheckDeviceFormat(IDirect3D9Ex *iface, UINT adapter, { DWORD levels;
- hr = wined3d_check_device_multisample_type(wined3d_adapter, device_type, + hr = wined3d_check_device_multisample_type(wined3d_adapter, wined3d_device_type_from_d3d(device_type), WINED3DFMT_D24_UNORM_S8_UINT, FALSE, WINED3D_MULTISAMPLE_NON_MASKABLE, &levels); if (SUCCEEDED(hr) && !levels) hr = D3DERR_NOTAVAILABLE; } else - hr = wined3d_check_device_format(d3d9->wined3d, wined3d_adapter, device_type, + hr = wined3d_check_device_format(d3d9->wined3d, wined3d_adapter, wined3d_device_type_from_d3d(device_type), wined3dformat_from_d3dformat(adapter_format), usage, bind_flags, wined3d_rtype, wined3dformat_from_d3dformat(format)); wined3d_mutex_unlock(); @@ -368,8 +368,9 @@ static HRESULT WINAPI d3d9_CheckDeviceMultiSampleType(IDirect3D9Ex *iface, UINT
wined3d_mutex_lock(); wined3d_adapter = wined3d_output_get_adapter(d3d9->wined3d_outputs[output_idx]); - hr = wined3d_check_device_multisample_type(wined3d_adapter, device_type, - wined3dformat_from_d3dformat(format), windowed, multisample_type, levels); + hr = wined3d_check_device_multisample_type(wined3d_adapter, wined3d_device_type_from_d3d(device_type), + wined3dformat_from_d3dformat(format), windowed, wined3d_multisample_type_from_d3d(multisample_type), + levels); wined3d_mutex_unlock(); if (hr == WINED3DERR_NOTAVAILABLE && levels) *levels = 1; @@ -394,7 +395,7 @@ static HRESULT WINAPI d3d9_CheckDepthStencilMatch(IDirect3D9Ex *iface, UINT adap
wined3d_mutex_lock(); wined3d_adapter = wined3d_output_get_adapter(d3d9->wined3d_outputs[output_idx]); - hr = wined3d_check_depth_stencil_match(wined3d_adapter, device_type, + hr = wined3d_check_depth_stencil_match(wined3d_adapter, wined3d_device_type_from_d3d(device_type), wined3dformat_from_d3dformat(adapter_format), wined3dformat_from_d3dformat(rt_format), wined3dformat_from_d3dformat(ds_format)); wined3d_mutex_unlock(); @@ -418,7 +419,7 @@ static HRESULT WINAPI d3d9_CheckDeviceFormatConversion(IDirect3D9Ex *iface, UINT
wined3d_mutex_lock(); hr = wined3d_check_device_format_conversion(d3d9->wined3d_outputs[output_idx], - device_type, wined3dformat_from_d3dformat(src_format), + wined3d_device_type_from_d3d(device_type), wined3dformat_from_d3dformat(src_format), wined3dformat_from_d3dformat(dst_format)); wined3d_mutex_unlock();
@@ -446,7 +447,7 @@ static HRESULT WINAPI d3d9_GetDeviceCaps(IDirect3D9Ex *iface, UINT adapter, D3DD
wined3d_mutex_lock(); wined3d_adapter = wined3d_output_get_adapter(d3d9->wined3d_outputs[output_idx]); - hr = wined3d_get_device_caps(wined3d_adapter, device_type, &wined3d_caps); + hr = wined3d_get_device_caps(wined3d_adapter, wined3d_device_type_from_d3d(device_type), &wined3d_caps); wined3d_mutex_unlock();
d3d9_caps_from_wined3dcaps(d3d9, adapter, caps, &wined3d_caps); @@ -525,7 +526,7 @@ static UINT WINAPI d3d9_GetAdapterModeCountEx(IDirect3D9Ex *iface,
wined3d_mutex_lock(); count = wined3d_output_get_mode_count(d3d9->wined3d_outputs[output_idx], - wined3dformat_from_d3dformat(filter->Format), filter->ScanLineOrdering); + wined3dformat_from_d3dformat(filter->Format), wined3d_scanline_ordering_from_d3d(filter->ScanLineOrdering)); wined3d_mutex_unlock();
return count; @@ -551,8 +552,8 @@ static HRESULT WINAPI d3d9_EnumAdapterModesEx(IDirect3D9Ex *iface,
wined3d_mutex_lock(); hr = wined3d_output_get_mode(d3d9->wined3d_outputs[output_idx], - wined3dformat_from_d3dformat(filter->Format), filter->ScanLineOrdering, mode_idx, - &wined3d_mode); + wined3dformat_from_d3dformat(filter->Format), wined3d_scanline_ordering_from_d3d(filter->ScanLineOrdering), + mode_idx, &wined3d_mode); wined3d_mutex_unlock();
if (SUCCEEDED(hr)) @@ -561,7 +562,7 @@ static HRESULT WINAPI d3d9_EnumAdapterModesEx(IDirect3D9Ex *iface, mode->Height = wined3d_mode.height; mode->RefreshRate = wined3d_mode.refresh_rate; mode->Format = d3dformat_from_wined3dformat(wined3d_mode.format_id); - mode->ScanLineOrdering = wined3d_mode.scanline_ordering; + mode->ScanLineOrdering = d3dscanlineordering_from_wined3d(wined3d_mode.scanline_ordering); }
return hr; @@ -596,7 +597,7 @@ static HRESULT WINAPI d3d9_GetAdapterDisplayModeEx(IDirect3D9Ex *iface, mode->Height = wined3d_mode.height; mode->RefreshRate = wined3d_mode.refresh_rate; mode->Format = d3dformat_from_wined3dformat(wined3d_mode.format_id); - mode->ScanLineOrdering = wined3d_mode.scanline_ordering; + mode->ScanLineOrdering = d3dscanlineordering_from_wined3d(wined3d_mode.scanline_ordering); }
return hr; diff --git a/dlls/d3d9/query.c b/dlls/d3d9/query.c index e9180fb481f..207ad55e5a1 100644 --- a/dlls/d3d9/query.c +++ b/dlls/d3d9/query.c @@ -24,6 +24,16 @@
WINE_DEFAULT_DEBUG_CHANNEL(d3d9);
+static D3DQUERYTYPE d3dquerytype_from_wined3d(enum wined3d_query_type type) +{ + return (D3DQUERYTYPE)type; +} + +static enum wined3d_query_type wined3d_query_type_from_d3d(D3DQUERYTYPE type) +{ + return (enum wined3d_query_type)type; +} + static inline struct d3d9_query *impl_from_IDirect3DQuery9(IDirect3DQuery9 *iface) { return CONTAINING_RECORD(iface, struct d3d9_query, IDirect3DQuery9_iface); @@ -98,7 +108,7 @@ static D3DQUERYTYPE WINAPI d3d9_query_GetType(IDirect3DQuery9 *iface) TRACE("iface %p.\n", iface);
wined3d_mutex_lock(); - type = wined3d_query_get_type(query->wined3d_query); + type = d3dquerytype_from_wined3d(wined3d_query_get_type(query->wined3d_query)); wined3d_mutex_unlock();
return type; @@ -198,7 +208,7 @@ HRESULT query_init(struct d3d9_query *query, struct d3d9_device *device, D3DQUER query->refcount = 1;
wined3d_mutex_lock(); - if (FAILED(hr = wined3d_query_create(device->wined3d_device, type, + if (FAILED(hr = wined3d_query_create(device->wined3d_device, wined3d_query_type_from_d3d(type), query, &d3d9_null_wined3d_parent_ops, &query->wined3d_query))) { wined3d_mutex_unlock(); diff --git a/dlls/d3d9/surface.c b/dlls/d3d9/surface.c index b74f6cacf7e..3d1fbf12f99 100644 --- a/dlls/d3d9/surface.c +++ b/dlls/d3d9/surface.c @@ -224,7 +224,7 @@ static HRESULT WINAPI d3d9_surface_GetDesc(IDirect3DSurface9 *iface, D3DSURFACE_ desc->Type = D3DRTYPE_SURFACE; desc->Usage = d3dusage_from_wined3dusage(wined3d_desc.usage, wined3d_desc.bind_flags); desc->Pool = d3dpool_from_wined3daccess(wined3d_desc.access, wined3d_desc.usage); - desc->MultiSampleType = wined3d_desc.multisample_type; + desc->MultiSampleType = d3dmultisample_type_from_wined3d(wined3d_desc.multisample_type); desc->MultiSampleQuality = wined3d_desc.multisample_quality; desc->Width = wined3d_desc.width; desc->Height = wined3d_desc.height; diff --git a/dlls/d3d9/swapchain.c b/dlls/d3d9/swapchain.c index be9c55ac3ef..8d6cff982d3 100644 --- a/dlls/d3d9/swapchain.c +++ b/dlls/d3d9/swapchain.c @@ -320,7 +320,7 @@ static HRESULT WINAPI d3d9_swapchain_GetDisplayModeEx(IDirect3DSwapChain9Ex *ifa mode->Height = wined3d_mode.height; mode->RefreshRate = wined3d_mode.refresh_rate; mode->Format = d3dformat_from_wined3dformat(wined3d_mode.format_id); - mode->ScanLineOrdering = wined3d_mode.scanline_ordering; + mode->ScanLineOrdering = d3dscanlineordering_from_wined3d(wined3d_mode.scanline_ordering); }
return hr; diff --git a/dlls/d3d9/texture.c b/dlls/d3d9/texture.c index 9be9d450ba0..a8c2985c4ea 100644 --- a/dlls/d3d9/texture.c +++ b/dlls/d3d9/texture.c @@ -367,7 +367,7 @@ static HRESULT WINAPI d3d9_texture_2d_GetLevelDesc(IDirect3DTexture9 *iface, UIN desc->Type = D3DRTYPE_SURFACE; desc->Usage = texture->usage; desc->Pool = d3dpool_from_wined3daccess(wined3d_desc.access, wined3d_desc.usage); - desc->MultiSampleType = wined3d_desc.multisample_type; + desc->MultiSampleType = d3dmultisample_type_from_wined3d(wined3d_desc.multisample_type); desc->MultiSampleQuality = wined3d_desc.multisample_quality; desc->Width = wined3d_desc.width; desc->Height = wined3d_desc.height; @@ -774,7 +774,7 @@ static HRESULT WINAPI d3d9_texture_cube_GetLevelDesc(IDirect3DCubeTexture9 *ifac desc->Type = D3DRTYPE_SURFACE; desc->Usage = texture->usage; desc->Pool = d3dpool_from_wined3daccess(wined3d_desc.access, wined3d_desc.usage); - desc->MultiSampleType = wined3d_desc.multisample_type; + desc->MultiSampleType = d3dmultisample_type_from_wined3d(wined3d_desc.multisample_type); desc->MultiSampleQuality = wined3d_desc.multisample_quality; desc->Width = wined3d_desc.width; desc->Height = wined3d_desc.height;
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=68426
Your paranoid android.
=== debiant (build log) ===
The task timed out
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=68423
Your paranoid android.
=== w1064v1809_he (32 bit report) ===
ddraw: ddraw1.c:11175: Test failed: Got unexpected color 0x00ffffff.
=== w8adm (32 bit report) ===
ddraw: ddraw2.c:3281: Test failed: Got unexpected hr 0x887601c2.
=== w1064v1507 (32 bit report) ===
ddraw: 0c98:ddraw2: unhandled exception c0000005 at 730B7F2E