Commit 3ee3324c authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

wined3d: Add support for returning multiple scissor rectangles.

parent 857756fc
......@@ -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));
......
......@@ -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;
......
......@@ -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,
......
......@@ -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)
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment