Module: wine Branch: master Commit: e8b2eb0021b96f9e9cc73f1ccf6f5edc78588e49 URL: https://gitlab.winehq.org/wine/wine/-/commit/e8b2eb0021b96f9e9cc73f1ccf6f5ed...
Author: Elizabeth Figura zfigura@codeweavers.com Date: Thu Apr 25 19:30:09 2024 -0500
wined3d: Pass the primary stateblock to wined3d_device_process_vertices().
---
dlls/d3d8/device.c | 3 +-- dlls/d3d9/device.c | 3 +-- dlls/ddraw/executebuffer.c | 5 ++--- dlls/ddraw/vertexbuffer.c | 3 +-- dlls/wined3d/device.c | 4 +++- dlls/wined3d/wined3d.spec | 2 +- include/wine/wined3d.h | 2 +- 7 files changed, 10 insertions(+), 12 deletions(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 401677e8261..e9cdfa9b4ff 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -2798,8 +2798,7 @@ static HRESULT WINAPI d3d8_device_ProcessVertices(IDirect3DDevice8 *iface, UINT ERR("Failed to set stream source.\n"); }
- wined3d_device_apply_stateblock(device->wined3d_device, device->state); - hr = wined3d_device_process_vertices(device->wined3d_device, src_start_idx, dst_idx, + hr = wined3d_device_process_vertices(device->wined3d_device, device->state, src_start_idx, dst_idx, vertex_count, dst->wined3d_buffer, NULL, flags, dst->fvf);
map = device->sysmem_vb; diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index c3cecc4e27f..408dace48ad 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -3391,8 +3391,7 @@ static HRESULT WINAPI d3d9_device_ProcessVertices(IDirect3DDevice9Ex *iface, ERR("Failed to set stream source.\n"); }
- wined3d_device_apply_stateblock(device->wined3d_device, device->state); - hr = wined3d_device_process_vertices(device->wined3d_device, src_start_idx, dst_idx, vertex_count, + hr = wined3d_device_process_vertices(device->wined3d_device, device->state, src_start_idx, dst_idx, vertex_count, dst_impl->wined3d_buffer, decl_impl ? decl_impl->wined3d_declaration : NULL, flags, dst_impl->fvf);
diff --git a/dlls/ddraw/executebuffer.c b/dlls/ddraw/executebuffer.c index 0cf0bf121f3..b0d60c6fb65 100644 --- a/dlls/ddraw/executebuffer.c +++ b/dlls/ddraw/executebuffer.c @@ -311,10 +311,9 @@ HRESULT d3d_execute_buffer_execute(struct d3d_execute_buffer *buffer, struct d3d wined3d_stateblock_set_vertex_declaration(device->state, ddraw_find_decl(device->ddraw, op == D3DPROCESSVERTICES_TRANSFORMLIGHT ? D3DFVF_VERTEX : D3DFVF_LVERTEX)); - wined3d_device_apply_stateblock(device->wined3d_device, device->state); d3d_device_sync_surfaces(device); - wined3d_device_process_vertices(device->wined3d_device, ci->wStart, ci->wDest, - ci->dwCount, buffer->dst_vertex_buffer, NULL, 0, D3DFVF_TLVERTEX); + wined3d_device_process_vertices(device->wined3d_device, device->state, ci->wStart, + ci->wDest, ci->dwCount, buffer->dst_vertex_buffer, NULL, 0, D3DFVF_TLVERTEX); break;
case D3DPROCESSVERTICES_COPY: diff --git a/dlls/ddraw/vertexbuffer.c b/dlls/ddraw/vertexbuffer.c index c02d7e6e354..ccfa0c2e752 100644 --- a/dlls/ddraw/vertexbuffer.c +++ b/dlls/ddraw/vertexbuffer.c @@ -304,8 +304,7 @@ static HRESULT WINAPI d3d_vertex_buffer7_ProcessVertices(IDirect3DVertexBuffer7 wined3d_stateblock_set_stream_source(device_impl->state, 0, src_buffer_impl->wined3d_buffer, 0, get_flexible_vertex_size(src_buffer_impl->fvf)); wined3d_stateblock_set_vertex_declaration(device_impl->state, src_buffer_impl->wined3d_declaration); - wined3d_device_apply_stateblock(device_impl->wined3d_device, device_impl->state); - hr = wined3d_device_process_vertices(device_impl->wined3d_device, src_idx, dst_idx, + hr = wined3d_device_process_vertices(device_impl->wined3d_device, device_impl->state, src_idx, dst_idx, count, dst_buffer_impl->wined3d_buffer, NULL, flags, dst_buffer_impl->fvf);
/* Restore the states if needed */ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index c0648f2aace..5cfd4040d8e 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3610,7 +3610,7 @@ static HRESULT process_vertices_strided(const struct wined3d_device *device, DWO } #undef copy_and_next
-HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device, +HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device, struct wined3d_stateblock *stateblock, UINT src_start_idx, UINT dst_idx, UINT vertex_count, struct wined3d_buffer *dst_buffer, const struct wined3d_vertex_declaration *declaration, uint32_t flags, uint32_t dst_fvf) { @@ -3631,6 +3631,8 @@ HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device, if (declaration) FIXME("Output vertex declaration not implemented yet.\n");
+ wined3d_device_apply_stateblock(device, stateblock); + vs = state->shader[WINED3D_SHADER_TYPE_VERTEX]; state->shader[WINED3D_SHADER_TYPE_VERTEX] = NULL; wined3d_stream_info_from_declaration(&stream_info, state, &device->adapter->d3d_info); diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index fee5ed0dd7a..3bfe6d2b200 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -73,7 +73,7 @@ @ cdecl wined3d_device_get_swapchain_count(ptr) @ cdecl wined3d_device_get_wined3d(ptr) @ cdecl wined3d_device_incref(ptr) -@ cdecl wined3d_device_process_vertices(ptr long long long ptr ptr long long) +@ cdecl wined3d_device_process_vertices(ptr ptr long long long ptr ptr long long) @ cdecl wined3d_device_release_focus_window(ptr) @ cdecl wined3d_device_reset(ptr ptr ptr ptr long) @ cdecl wined3d_device_set_clip_status(ptr ptr) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index b3c1b2f8152..2d2d097497e 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2401,7 +2401,7 @@ struct wined3d_swapchain * __cdecl wined3d_device_get_swapchain(const struct win UINT __cdecl wined3d_device_get_swapchain_count(const struct wined3d_device *device); struct wined3d * __cdecl wined3d_device_get_wined3d(const struct wined3d_device *device); ULONG __cdecl wined3d_device_incref(struct wined3d_device *device); -HRESULT __cdecl wined3d_device_process_vertices(struct wined3d_device *device, +HRESULT __cdecl wined3d_device_process_vertices(struct wined3d_device *device, struct wined3d_stateblock *stateblock, UINT src_start_idx, UINT dst_idx, UINT vertex_count, struct wined3d_buffer *dst_buffer, const struct wined3d_vertex_declaration *declaration, uint32_t flags, uint32_t dst_fvf); void __cdecl wined3d_device_release_focus_window(struct wined3d_device *device);