And hold it locally in d3d[789].
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d8/d3d8_private.h | 5 +++-- dlls/d3d8/device.c | 14 +++++++++----- dlls/d3d9/d3d9_private.h | 5 +++-- dlls/d3d9/device.c | 21 +++++++++++++-------- dlls/ddraw/ddraw_private.h | 2 +- dlls/ddraw/device.c | 10 ++++++---- dlls/wined3d/device.c | 30 ++++++++++++++++-------------- dlls/wined3d/wined3d.spec | 4 ++-- include/wine/wined3d.h | 4 ++-- 9 files changed, 55 insertions(+), 40 deletions(-)
diff --git a/dlls/d3d8/d3d8_private.h b/dlls/d3d8/d3d8_private.h index 1669ff74315..0d4d4faf898 100644 --- a/dlls/d3d8/d3d8_private.h +++ b/dlls/d3d8/d3d8_private.h @@ -126,12 +126,13 @@ struct d3d8_device DWORD sysmem_vb : 16; /* D3D8_MAX_STREAMS */ DWORD sysmem_ib : 1; DWORD in_destruction : 1; - DWORD recording : 1; - DWORD padding : 13; + DWORD padding : 14;
/* The d3d8 API supports only one implicit swapchain (no D3DCREATE_ADAPTERGROUP_DEVICE, * no GetSwapchain, GetBackBuffer doesn't accept a swapchain number). */ struct wined3d_swapchain *implicit_swapchain; + + struct wined3d_stateblock *recording; };
HRESULT device_init(struct d3d8_device *device, struct d3d8 *parent, struct wined3d *wined3d, UINT adapter, diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index e57e01e42ba..efea4708fda 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -911,7 +911,9 @@ static HRESULT WINAPI d3d8_device_Reset(IDirect3DDevice8 *iface, if (SUCCEEDED(hr = wined3d_device_reset(device->wined3d_device, &swapchain_desc, NULL, reset_enum_callback, TRUE))) { - device->recording = FALSE; + if (device->recording) + wined3d_stateblock_decref(device->recording); + device->recording = NULL; present_parameters->BackBufferCount = swapchain_desc.backbuffer_count; implicit_swapchain = wined3d_swapchain_get_parent(device->implicit_swapchain); implicit_swapchain->swap_interval @@ -1862,13 +1864,14 @@ static HRESULT WINAPI d3d8_device_GetRenderState(IDirect3DDevice8 *iface, static HRESULT WINAPI d3d8_device_BeginStateBlock(IDirect3DDevice8 *iface) { struct d3d8_device *device = impl_from_IDirect3DDevice8(iface); + struct wined3d_stateblock *stateblock; HRESULT hr;
TRACE("iface %p.\n", iface);
wined3d_mutex_lock(); - if (SUCCEEDED(hr = wined3d_device_begin_stateblock(device->wined3d_device))) - device->recording = TRUE; + if (SUCCEEDED(hr = wined3d_device_begin_stateblock(device->wined3d_device, &stateblock))) + device->recording = stateblock; wined3d_mutex_unlock();
return hr; @@ -1886,14 +1889,15 @@ static HRESULT WINAPI d3d8_device_EndStateBlock(IDirect3DDevice8 *iface, DWORD * * of memory later and cause locking problems) */ wined3d_mutex_lock(); - hr = wined3d_device_end_stateblock(device->wined3d_device, &stateblock); + hr = wined3d_device_end_stateblock(device->wined3d_device); if (FAILED(hr)) { WARN("Failed to end the state block, %#x.\n", hr); wined3d_mutex_unlock(); return hr; } - device->recording = FALSE; + stateblock = device->recording; + device->recording = NULL;
*token = d3d8_allocate_handle(&device->handle_table, stateblock, D3D8_HANDLE_SB); wined3d_mutex_unlock(); diff --git a/dlls/d3d9/d3d9_private.h b/dlls/d3d9/d3d9_private.h index 8ee521b14b0..c01e3997808 100644 --- a/dlls/d3d9/d3d9_private.h +++ b/dlls/d3d9/d3d9_private.h @@ -108,8 +108,7 @@ struct d3d9_device DWORD in_destruction : 1; DWORD in_scene : 1; DWORD has_vertex_declaration : 1; - DWORD recording : 1; - DWORD padding : 11; + DWORD padding : 12;
DWORD auto_mipmaps; /* D3D9_MAX_TEXTURE_UNITS */
@@ -117,6 +116,8 @@ struct d3d9_device
UINT implicit_swapchain_count; struct wined3d_swapchain **implicit_swapchains; + + struct wined3d_stateblock *recording; };
HRESULT device_init(struct d3d9_device *device, struct d3d9 *parent, struct wined3d *wined3d, diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 9fbdcebf075..9d05771c5d1 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -995,7 +995,9 @@ static HRESULT d3d9_device_reset(struct d3d9_device *device,
if (!extended) { - device->recording = FALSE; + if (device->recording) + wined3d_stateblock_decref(device->recording); + device->recording = NULL; device->auto_mipmaps = 0; wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_ZENABLE, !!swapchain_desc.enable_auto_depth_stencil); @@ -2350,13 +2352,14 @@ static HRESULT WINAPI d3d9_device_CreateStateBlock(IDirect3DDevice9Ex *iface, static HRESULT WINAPI d3d9_device_BeginStateBlock(IDirect3DDevice9Ex *iface) { struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); + struct wined3d_stateblock *stateblock; HRESULT hr;
TRACE("iface %p.\n", iface);
wined3d_mutex_lock(); - if (SUCCEEDED(hr = wined3d_device_begin_stateblock(device->wined3d_device))) - device->recording = TRUE; + if (SUCCEEDED(hr = wined3d_device_begin_stateblock(device->wined3d_device, &stateblock))) + device->recording = stateblock; wined3d_mutex_unlock();
return hr; @@ -2372,14 +2375,16 @@ static HRESULT WINAPI d3d9_device_EndStateBlock(IDirect3DDevice9Ex *iface, IDire TRACE("iface %p, stateblock %p.\n", iface, stateblock);
wined3d_mutex_lock(); - hr = wined3d_device_end_stateblock(device->wined3d_device, &wined3d_stateblock); - wined3d_mutex_unlock(); + hr = wined3d_device_end_stateblock(device->wined3d_device); if (FAILED(hr)) { - WARN("Failed to end the state block, hr %#x.\n", hr); - return hr; + wined3d_mutex_unlock(); + WARN("Failed to end the stateblock, hr %#x.\n", hr); + return hr; } - device->recording = FALSE; + wined3d_stateblock = device->recording; + device->recording = NULL; + wined3d_mutex_unlock();
if (!(object = heap_alloc_zero(sizeof(*object)))) { diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h index b228f3ec355..6bdc7c789fa 100644 --- a/dlls/ddraw/ddraw_private.h +++ b/dlls/ddraw/ddraw_private.h @@ -350,7 +350,7 @@ struct d3d_device
struct wined3d_vec4 user_clip_planes[D3DMAXUSERCLIPPLANES];
- BOOL recording; + struct wined3d_stateblock *recording; };
HRESULT d3d_device_create(struct ddraw *ddraw, struct ddraw_surface *target, IUnknown *rt_iface, diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index cdf4de8f95d..2c0b85d9a47 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -5625,6 +5625,7 @@ static HRESULT WINAPI d3d_device7_GetLight_FPUPreserve(IDirect3DDevice7 *iface, static HRESULT d3d_device7_BeginStateBlock(IDirect3DDevice7 *iface) { struct d3d_device *device = impl_from_IDirect3DDevice7(iface); + struct wined3d_stateblock *stateblock; HRESULT hr;
TRACE("iface %p.\n", iface); @@ -5636,8 +5637,8 @@ static HRESULT d3d_device7_BeginStateBlock(IDirect3DDevice7 *iface) WARN("Trying to begin a stateblock while recording, returning D3DERR_INBEGINSTATEBLOCK.\n"); return D3DERR_INBEGINSTATEBLOCK; } - if (SUCCEEDED(hr = wined3d_device_begin_stateblock(device->wined3d_device))) - device->recording = TRUE; + if (SUCCEEDED(hr = wined3d_device_begin_stateblock(device->wined3d_device, &stateblock))) + device->recording = stateblock; wined3d_mutex_unlock();
return hr_ddraw_from_wined3d(hr); @@ -5695,7 +5696,7 @@ static HRESULT d3d_device7_EndStateBlock(IDirect3DDevice7 *iface, DWORD *statebl WARN("Trying to end a stateblock, but no stateblock is being recorded.\n"); return D3DERR_NOTINBEGINSTATEBLOCK; } - hr = wined3d_device_end_stateblock(device->wined3d_device, &wined3d_sb); + hr = wined3d_device_end_stateblock(device->wined3d_device); if (FAILED(hr)) { WARN("Failed to end stateblock, hr %#x.\n", hr); @@ -5703,7 +5704,8 @@ static HRESULT d3d_device7_EndStateBlock(IDirect3DDevice7 *iface, DWORD *statebl *stateblock = 0; return hr_ddraw_from_wined3d(hr); } - device->recording = FALSE; + wined3d_sb = device->recording; + device->recording = NULL;
h = ddraw_allocate_handle(&device->handle_table, wined3d_sb, DDRAW_HANDLE_STATEBLOCK); if (h == DDRAW_INVALID_HANDLE) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index d35a0648c9c..612278d5d56 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4178,49 +4178,51 @@ HRESULT CDECL wined3d_device_get_display_mode(const struct wined3d_device *devic return wined3d_swapchain_get_display_mode(swapchain, mode, rotation); }
-HRESULT CDECL wined3d_device_begin_stateblock(struct wined3d_device *device) +HRESULT CDECL wined3d_device_begin_stateblock(struct wined3d_device *device, + struct wined3d_stateblock **stateblock) { - struct wined3d_stateblock *stateblock; + struct wined3d_stateblock *object; HRESULT hr;
TRACE("device %p.\n", device);
if (device->recording) + { + *stateblock = NULL; return WINED3DERR_INVALIDCALL; + }
- hr = wined3d_stateblock_create(device, WINED3D_SBT_RECORDED, &stateblock); + hr = wined3d_stateblock_create(device, WINED3D_SBT_RECORDED, &object); if (FAILED(hr)) return hr;
- device->recording = stateblock; - device->update_stateblock_state = &stateblock->stateblock_state; + device->recording = object; + device->update_stateblock_state = &object->stateblock_state; + *stateblock = object;
- TRACE("Recording stateblock %p.\n", stateblock); + TRACE("Recording stateblock %p.\n", *stateblock);
return WINED3D_OK; }
-HRESULT CDECL wined3d_device_end_stateblock(struct wined3d_device *device, - struct wined3d_stateblock **stateblock) +HRESULT CDECL wined3d_device_end_stateblock(struct wined3d_device *device) { - struct wined3d_stateblock *object = device->recording; + struct wined3d_stateblock *stateblock = device->recording;
- TRACE("device %p, stateblock %p.\n", device, stateblock); + TRACE("device %p.\n", device);
if (!device->recording) { WARN("Not recording.\n"); - *stateblock = NULL; return WINED3DERR_INVALIDCALL; }
- stateblock_init_contained_states(object); + stateblock_init_contained_states(stateblock);
- *stateblock = object; device->recording = NULL; device->update_stateblock_state = &device->stateblock_state;
- TRACE("Returning stateblock %p.\n", *stateblock); + TRACE("Ending stateblock %p.\n", stateblock);
return WINED3D_OK; } diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 59f99c91e07..9b4f4792f5d 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -37,7 +37,7 @@
@ cdecl wined3d_device_acquire_focus_window(ptr ptr) @ cdecl wined3d_device_begin_scene(ptr) -@ cdecl wined3d_device_begin_stateblock(ptr) +@ cdecl wined3d_device_begin_stateblock(ptr ptr) @ cdecl wined3d_device_clear(ptr long ptr long ptr float long) @ cdecl wined3d_device_clear_rendertarget_view(ptr ptr ptr long ptr float long) @ cdecl wined3d_device_clear_unordered_access_view_uint(ptr ptr ptr) @@ -55,7 +55,7 @@ @ cdecl wined3d_device_draw_primitive_instanced(ptr long long long long) @ cdecl wined3d_device_draw_primitive_instanced_indirect(ptr ptr long) @ cdecl wined3d_device_end_scene(ptr) -@ cdecl wined3d_device_end_stateblock(ptr ptr) +@ cdecl wined3d_device_end_stateblock(ptr) @ cdecl wined3d_device_evict_managed_resources(ptr) @ cdecl wined3d_device_get_available_texture_mem(ptr) @ cdecl wined3d_device_get_base_vertex_index(ptr) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index abef3f0ad02..27776385313 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2231,7 +2231,7 @@ ULONG __cdecl wined3d_buffer_incref(struct wined3d_buffer *buffer);
HRESULT __cdecl wined3d_device_acquire_focus_window(struct wined3d_device *device, HWND window); HRESULT __cdecl wined3d_device_begin_scene(struct wined3d_device *device); -HRESULT __cdecl wined3d_device_begin_stateblock(struct wined3d_device *device); +HRESULT __cdecl wined3d_device_begin_stateblock(struct wined3d_device *device, struct wined3d_stateblock **stateblock); HRESULT __cdecl wined3d_device_clear(struct wined3d_device *device, DWORD rect_count, const RECT *rects, DWORD flags, const struct wined3d_color *color, float z, DWORD stencil); HRESULT __cdecl wined3d_device_clear_rendertarget_view(struct wined3d_device *device, @@ -2267,7 +2267,7 @@ void __cdecl wined3d_device_draw_primitive_instanced(struct wined3d_device *devi void __cdecl wined3d_device_draw_primitive_instanced_indirect(struct wined3d_device *device, struct wined3d_buffer *buffer, unsigned int offset); HRESULT __cdecl wined3d_device_end_scene(struct wined3d_device *device); -HRESULT __cdecl wined3d_device_end_stateblock(struct wined3d_device *device, struct wined3d_stateblock **stateblock); +HRESULT __cdecl wined3d_device_end_stateblock(struct wined3d_device *device); void __cdecl wined3d_device_evict_managed_resources(struct wined3d_device *device); UINT __cdecl wined3d_device_get_available_texture_mem(const struct wined3d_device *device); INT __cdecl wined3d_device_get_base_vertex_index(const struct wined3d_device *device);
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/wined3d/stateblock.c | 12 ++++++++++++ dlls/wined3d/wined3d.spec | 1 + include/wine/wined3d.h | 1 + 3 files changed, 14 insertions(+)
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 80e58114c10..72affacfca6 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -1274,6 +1274,18 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock) TRACE("Applied stateblock %p.\n", stateblock); }
+void CDECL wined3d_stateblock_set_vertex_shader(struct wined3d_stateblock *stateblock, struct wined3d_shader *shader) +{ + TRACE("stateblock %p, shader %p.\n", stateblock, shader); + + if (shader) + wined3d_shader_incref(shader); + if (stateblock->stateblock_state.vs) + wined3d_shader_decref(stateblock->stateblock_state.vs); + stateblock->stateblock_state.vs = shader; + stateblock->changed.vertexShader = TRUE; +} + static void init_default_render_states(DWORD rs[WINEHIGHEST_RENDER_STATE + 1], const struct wined3d_d3d_info *d3d_info) { union diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 9b4f4792f5d..a01a9991737 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -260,6 +260,7 @@ @ cdecl wined3d_stateblock_create(ptr long ptr) @ cdecl wined3d_stateblock_decref(ptr) @ cdecl wined3d_stateblock_incref(ptr) +@ cdecl wined3d_stateblock_set_vertex_shader(ptr ptr)
@ cdecl wined3d_swapchain_create(ptr ptr ptr ptr ptr) @ cdecl wined3d_swapchain_decref(ptr) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 27776385313..de41b19ee7d 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2666,6 +2666,7 @@ HRESULT __cdecl wined3d_stateblock_create(struct wined3d_device *device, enum wined3d_stateblock_type type, struct wined3d_stateblock **stateblock); ULONG __cdecl wined3d_stateblock_decref(struct wined3d_stateblock *stateblock); ULONG __cdecl wined3d_stateblock_incref(struct wined3d_stateblock *stateblock); +void __cdecl wined3d_stateblock_set_vertex_shader(struct wined3d_stateblock *stateblock, struct wined3d_shader *shader);
HRESULT __cdecl wined3d_swapchain_create(struct wined3d_device *device, struct wined3d_swapchain_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_swapchain **swapchain);
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=54028
Your paranoid android.
=== debian9 (32 bit report) ===
d3d8: device.c:3165: Test failed: Expected message 0x1c for window 0x1, but didn't receive it
=== debian9 (64 bit WoW report) ===
d3d9: d3d9ex.c:3133: Test failed: Expected message 0x46 for window 0x1, but didn't receive it, i=0.
ddraw: ddraw7.c:2597: Test failed: Expected message 0x46, but didn't receive it. ddraw7.c:2599: Test failed: Expected screen size 1920x1200, got 0x0. ddraw7.c:2604: Test failed: Expected (0,0)-(1920,1200), got (0,0)-(1920,1080).
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d9/device.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 9d05771c5d1..dcdd2a55468 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -3414,12 +3414,15 @@ static HRESULT WINAPI d3d9_device_SetVertexShader(IDirect3DDevice9Ex *iface, IDi { struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); struct d3d9_vertexshader *shader_obj = unsafe_impl_from_IDirect3DVertexShader9(shader); + struct wined3d_shader *wined3d_shader = shader_obj ? shader_obj->wined3d_shader : NULL;
TRACE("iface %p, shader %p.\n", iface, shader);
wined3d_mutex_lock(); - wined3d_device_set_vertex_shader(device->wined3d_device, - shader_obj ? shader_obj->wined3d_shader : NULL); + if (device->recording) + wined3d_stateblock_set_vertex_shader(device->recording, wined3d_shader); + else + wined3d_device_set_vertex_shader(device->wined3d_device, wined3d_shader); wined3d_mutex_unlock();
return D3D_OK;
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=54029
Your paranoid android.
=== debian9 (32 bit report) ===
d3d8: device.c:3165: Test failed: Expected message 0x1c for window 0x1, but didn't receive it
ddraw: ddraw7.c:2597: Test failed: Expected message 0x46, but didn't receive it. ddraw7.c:2599: Test failed: Expected screen size 1920x1200, got 0x0. ddraw7.c:2604: Test failed: Expected (0,0)-(1920,1200), got (0,0)-(1920,1080).
=== debian9 (32 bit Chinese:China report) ===
d3d9: d3d9ex.c:3133: Test failed: Expected message 0x46 for window 0x1, but didn't receive it, i=0.
=== debian9 (32 bit WoW report) ===
d3d9: d3d9ex.c:3133: Test failed: Expected message 0x46 for window 0x1, but didn't receive it, i=0.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/wined3d/stateblock.c | 13 +++++++++++++ dlls/wined3d/wined3d.spec | 1 + include/wine/wined3d.h | 2 ++ 3 files changed, 16 insertions(+)
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 72affacfca6..1c666da2136 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -1286,6 +1286,19 @@ void CDECL wined3d_stateblock_set_vertex_shader(struct wined3d_stateblock *state stateblock->changed.vertexShader = TRUE; }
+void CDECL wined3d_stateblock_set_vertex_declaration(struct wined3d_stateblock *stateblock, + struct wined3d_vertex_declaration *declaration) +{ + TRACE("stateblock %p, declaration %p.\n", stateblock, declaration); + + if (declaration) + wined3d_vertex_declaration_incref(declaration); + if (stateblock->stateblock_state.vertex_declaration) + wined3d_vertex_declaration_decref(stateblock->stateblock_state.vertex_declaration); + stateblock->stateblock_state.vertex_declaration = declaration; + stateblock->changed.vertexDecl = TRUE; +} + static void init_default_render_states(DWORD rs[WINEHIGHEST_RENDER_STATE + 1], const struct wined3d_d3d_info *d3d_info) { union diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index a01a9991737..b09fb81533c 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -260,6 +260,7 @@ @ cdecl wined3d_stateblock_create(ptr long ptr) @ cdecl wined3d_stateblock_decref(ptr) @ cdecl wined3d_stateblock_incref(ptr) +@ cdecl wined3d_stateblock_set_vertex_declaration(ptr ptr) @ cdecl wined3d_stateblock_set_vertex_shader(ptr ptr)
@ cdecl wined3d_swapchain_create(ptr ptr ptr ptr ptr) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index de41b19ee7d..8d6558974ab 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2666,6 +2666,8 @@ HRESULT __cdecl wined3d_stateblock_create(struct wined3d_device *device, enum wined3d_stateblock_type type, struct wined3d_stateblock **stateblock); ULONG __cdecl wined3d_stateblock_decref(struct wined3d_stateblock *stateblock); ULONG __cdecl wined3d_stateblock_incref(struct wined3d_stateblock *stateblock); +void __cdecl wined3d_stateblock_set_vertex_declaration(struct wined3d_stateblock *stateblock, + struct wined3d_vertex_declaration *declaration); void __cdecl wined3d_stateblock_set_vertex_shader(struct wined3d_stateblock *stateblock, struct wined3d_shader *shader);
HRESULT __cdecl wined3d_swapchain_create(struct wined3d_device *device, struct wined3d_swapchain_desc *desc,
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=54030
Your paranoid android.
=== debian9 (32 bit report) ===
d3d8: device.c:3165: Test failed: Expected message 0x1c for window 0x1, but didn't receive it
=== debian9 (64 bit WoW report) ===
d3d9: d3d9ex.c:3133: Test failed: Expected message 0x46 for window 0x1, but didn't receive it, i=0.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d9/device.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index dcdd2a55468..403022d03f4 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -3224,12 +3224,15 @@ static HRESULT WINAPI d3d9_device_SetVertexDeclaration(IDirect3DDevice9Ex *iface { struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); struct d3d9_vertex_declaration *decl_impl = unsafe_impl_from_IDirect3DVertexDeclaration9(declaration); + struct wined3d_vertex_declaration *wined3d_decl = decl_impl ? decl_impl->wined3d_declaration : NULL;
TRACE("iface %p, declaration %p.\n", iface, declaration);
wined3d_mutex_lock(); - wined3d_device_set_vertex_declaration(device->wined3d_device, - decl_impl ? decl_impl->wined3d_declaration : NULL); + if (device->recording) + wined3d_stateblock_set_vertex_declaration(device->recording, wined3d_decl); + else + wined3d_device_set_vertex_declaration(device->wined3d_device, wined3d_decl); device->has_vertex_declaration = !!decl_impl; wined3d_mutex_unlock();
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=54031
Your paranoid android.
=== debian9 (32 bit report) ===
d3d8: device.c:3165: Test failed: Expected message 0x1c for window 0x1, but didn't receive it
=== debian9 (32 bit Chinese:China report) ===
d3d9: d3d9ex.c:3133: Test failed: Expected message 0x46 for window 0x1, but didn't receive it, i=0.
=== debian9 (32 bit WoW report) ===
ddraw: ddraw7.c:2672: Test failed: Expected message 0x7e, but didn't receive it.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d9/device.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 403022d03f4..3bfbe38e42d 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -3355,7 +3355,10 @@ static HRESULT WINAPI d3d9_device_SetFVF(IDirect3DDevice9Ex *iface, DWORD fvf) return D3DERR_DRIVERINTERNALERROR; }
- wined3d_device_set_vertex_declaration(device->wined3d_device, decl); + if (device->recording) + wined3d_stateblock_set_vertex_declaration(device->recording, decl); + else + wined3d_device_set_vertex_declaration(device->wined3d_device, decl); device->has_vertex_declaration = TRUE; wined3d_mutex_unlock();
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=54032
Your paranoid android.
=== debian9 (32 bit report) ===
d3d8: device.c:3165: Test failed: Expected message 0x1c for window 0x1, but didn't receive it
=== debian9 (32 bit Chinese:China report) ===
ddraw: ddraw4.c:2943: Test failed: Expected message 0x46, but didn't receive it. ddraw4.c:2945: Test failed: Expected screen size 1920x1200, got 0x0. ddraw4.c:2950: Test failed: Expected (0,0)-(1920,1200), got (0,0)-(1920,1080).
=== debian9 (32 bit WoW report) ===
d3d9: d3d9ex.c:3133: Test failed: Expected message 0x46 for window 0x1, but didn't receive it, i=0.
ddraw: ddraw2.c:2792: Test failed: Expected message 0x46, but didn't receive it. ddraw2.c:2794: Test failed: Expected screen size 1920x1200, got 0x0. ddraw2.c:2799: Test failed: Expected (0,0)-(1920,1200), got (0,0)-(1920,1080).
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d8/device.c | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index efea4708fda..2839e7c7ee3 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -2802,6 +2802,7 @@ static struct d3d8_vertex_declaration *d3d8_device_get_fvf_declaration(struct d3 static HRESULT WINAPI d3d8_device_SetVertexShader(IDirect3DDevice8 *iface, DWORD shader) { struct d3d8_device *device = impl_from_IDirect3DDevice8(iface); + struct wined3d_vertex_declaration *wined3d_decl; struct d3d8_vertex_shader *shader_impl;
TRACE("iface %p, shader %#x.\n", iface, shader); @@ -2811,9 +2812,17 @@ static HRESULT WINAPI d3d8_device_SetVertexShader(IDirect3DDevice8 *iface, DWORD TRACE("Setting FVF, %#x\n", shader);
wined3d_mutex_lock(); - wined3d_device_set_vertex_declaration(device->wined3d_device, - d3d8_device_get_fvf_declaration(device, shader)->wined3d_vertex_declaration); - wined3d_device_set_vertex_shader(device->wined3d_device, NULL); + wined3d_decl = d3d8_device_get_fvf_declaration(device, shader)->wined3d_vertex_declaration; + if (device->recording) + { + wined3d_stateblock_set_vertex_declaration(device->recording, wined3d_decl); + wined3d_stateblock_set_vertex_shader(device->recording, NULL); + } + else + { + wined3d_device_set_vertex_declaration(device->wined3d_device, wined3d_decl); + wined3d_device_set_vertex_shader(device->wined3d_device, NULL); + } wined3d_mutex_unlock();
return D3D_OK; @@ -2829,10 +2838,18 @@ static HRESULT WINAPI d3d8_device_SetVertexShader(IDirect3DDevice8 *iface, DWORD
return D3DERR_INVALIDCALL; } + wined3d_decl = shader_impl->vertex_declaration->wined3d_vertex_declaration;
- wined3d_device_set_vertex_declaration(device->wined3d_device, - shader_impl->vertex_declaration->wined3d_vertex_declaration); - wined3d_device_set_vertex_shader(device->wined3d_device, shader_impl->wined3d_shader); + if (device->recording) + { + wined3d_stateblock_set_vertex_declaration(device->recording, wined3d_decl); + wined3d_stateblock_set_vertex_shader(device->recording, shader_impl->wined3d_shader); + } + else + { + wined3d_device_set_vertex_declaration(device->wined3d_device, wined3d_decl); + wined3d_device_set_vertex_shader(device->wined3d_device, shader_impl->wined3d_shader); + } wined3d_mutex_unlock();
return D3D_OK;
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=54033
Your paranoid android.
=== debian9 (32 bit report) ===
d3d8: device.c:3165: Test failed: Expected message 0x1c for window 0x1, but didn't receive it
=== debian9 (64 bit WoW report) ===
d3d9: d3d9ex.c:3133: Test failed: Expected message 0x46 for window 0x1, but didn't receive it, i=0.
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=54027
Your paranoid android.
=== debian9 (32 bit Chinese:China report) ===
d3d9: d3d9ex.c:3133: Test failed: Expected message 0x46 for window 0x1, but didn't receive it, i=0.
=== debian9 (32 bit WoW report) ===
d3d9: d3d9ex.c:3133: Test failed: Expected message 0x46 for window 0x1, but didn't receive it, i=0.
Please ignore this series for now; I think I'd like to try doing this slightly differently.