Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d11/device.c | 4 ++-- dlls/d3d9/device.c | 2 +- dlls/wined3d/device.c | 13 +++++++++---- dlls/wined3d/wined3d.spec | 2 +- include/wine/wined3d.h | 3 ++- 5 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index c6a7218fb7..d49f08b57a 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -2140,7 +2140,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_RSGetScissorRects(ID3D11De return;
wined3d_mutex_lock(); - wined3d_device_get_scissor_rect(device->wined3d_device, rects); + wined3d_device_get_scissor_rects(device->wined3d_device, NULL, rects); wined3d_mutex_unlock(); if (*rect_count > 1) memset(&rects[1], 0, (*rect_count - 1) * sizeof(*rects)); @@ -4943,7 +4943,7 @@ static void STDMETHODCALLTYPE d3d10_device_RSGetScissorRects(ID3D10Device1 *ifac return;
wined3d_mutex_lock(); - wined3d_device_get_scissor_rect(device->wined3d_device, rects); + wined3d_device_get_scissor_rects(device->wined3d_device, NULL, rects); wined3d_mutex_unlock(); if (*rect_count > 1) memset(&rects[1], 0, (*rect_count - 1) * sizeof(*rects)); diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index b73d974860..2134257543 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -2577,7 +2577,7 @@ static HRESULT WINAPI d3d9_device_GetScissorRect(IDirect3DDevice9Ex *iface, RECT TRACE("iface %p, rect %p.\n", iface, rect);
wined3d_mutex_lock(); - wined3d_device_get_scissor_rect(device->wined3d_device, rect); + wined3d_device_get_scissor_rects(device->wined3d_device, NULL, rect); wined3d_mutex_unlock();
return D3D_OK; diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index f412cbe88d..c04bd820f7 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -2157,12 +2157,17 @@ void CDECL wined3d_device_set_scissor_rects(struct wined3d_device *device, unsig wined3d_cs_emit_set_scissor_rects(device->cs, rect_count, rects); }
-void CDECL wined3d_device_get_scissor_rect(const struct wined3d_device *device, RECT *rect) +void CDECL wined3d_device_get_scissor_rects(const struct wined3d_device *device, unsigned int *rect_count, RECT *rects) { - TRACE("device %p, rect %p.\n", device, rect); + unsigned int count; + + TRACE("device %p, rect_count %p, rects %p.\n", device, rect_count, rects);
- *rect = device->state.scissor_rects[0]; - TRACE("Returning rect %s.\n", wine_dbgstr_rect(rect)); + count = rect_count ? min(*rect_count, device->state.scissor_rect_count) : 1; + if (count && rects) + memcpy(rects, device->state.scissor_rects, count * sizeof(*rects)); + if (rect_count) + *rect_count = device->state.scissor_rect_count; }
void CDECL wined3d_device_set_vertex_declaration(struct wined3d_device *device, diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 21b2414bbe..357b76ebac 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -101,7 +101,7 @@ @ cdecl wined3d_device_get_render_state(ptr long) @ cdecl wined3d_device_get_rendertarget_view(ptr long) @ cdecl wined3d_device_get_sampler_state(ptr long long) -@ cdecl wined3d_device_get_scissor_rect(ptr ptr) +@ cdecl wined3d_device_get_scissor_rects(ptr ptr ptr) @ cdecl wined3d_device_get_software_vertex_processing(ptr) @ cdecl wined3d_device_get_stream_output(ptr long ptr) @ cdecl wined3d_device_get_stream_source(ptr long ptr ptr ptr) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 6223706f57..13e83da626 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2304,7 +2304,8 @@ struct wined3d_rendertarget_view * __cdecl wined3d_device_get_rendertarget_view( unsigned int view_idx); DWORD __cdecl wined3d_device_get_sampler_state(const struct wined3d_device *device, UINT sampler_idx, enum wined3d_sampler_state state); -void __cdecl wined3d_device_get_scissor_rect(const struct wined3d_device *device, RECT *rect); +void __cdecl wined3d_device_get_scissor_rects(const struct wined3d_device *device, unsigned int *rect_count, + RECT *rect); BOOL __cdecl wined3d_device_get_software_vertex_processing(const struct wined3d_device *device); struct wined3d_buffer * __cdecl wined3d_device_get_stream_output(struct wined3d_device *device, UINT idx, UINT *offset);