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();