From d2b50ac6892808791c4d461317a4b011369fcc39 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Mon, 24 Jul 2017 20:30:13 +0200 Subject: wined3d: Implement DrawInstancedIndirect. --- dlls/d3d11/device.c | 12 +++++++++++- dlls/wined3d/device.c | 9 +++++++++ dlls/wined3d/wined3d.spec | 1 + include/wine/wined3d.h | 2 ++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 2ecce826042..d3660a12e50 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1802,7 +1802,17 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_DrawIndexedInstancedIndire static void STDMETHODCALLTYPE d3d11_immediate_context_DrawInstancedIndirect(ID3D11DeviceContext *iface, ID3D11Buffer *buffer, UINT offset) { - FIXME("iface %p, buffer %p, offset %u stub!\n", iface, buffer, offset); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); + struct d3d_buffer *d3d_buffer; + + TRACE("iface %p, buffer %p, offset %u.\n", iface, buffer, offset); + + d3d_buffer = unsafe_impl_from_ID3D11Buffer(buffer); + + wined3d_mutex_lock(); + wined3d_device_draw_primitive_instanced_indirect(device->wined3d_device, + d3d_buffer->wined3d_buffer, offset); + wined3d_mutex_unlock(); } static void STDMETHODCALLTYPE d3d11_immediate_context_Dispatch(ID3D11DeviceContext *iface, diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index b6458cfde53..112e7f45ca4 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3752,6 +3752,15 @@ void CDECL wined3d_device_draw_primitive_instanced(struct wined3d_device *device 0, start_vertex, vertex_count, start_instance, instance_count, FALSE); } +void CDECL wined3d_device_draw_primitive_instanced_indirect(struct wined3d_device *device, + struct wined3d_buffer *buffer, unsigned int offset) +{ + TRACE("device %p, buffer %p, offset %u.\n", device, buffer, offset); + + wined3d_cs_emit_draw_indirect(device->cs, device->state.gl_primitive_type, device->state.gl_patch_vertices, + buffer, offset, FALSE); +} + HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *device, UINT start_idx, UINT index_count) { TRACE("device %p, start_idx %u, index_count %u.\n", device, start_idx, index_count); diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 2d80b3a8772..9c48b98b3ac 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -48,6 +48,7 @@ @ cdecl wined3d_device_draw_indexed_primitive_instanced_indirect(ptr ptr long) @ cdecl wined3d_device_draw_primitive(ptr long long) @ 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_evict_managed_resources(ptr) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 0b4c97fad54..b8fb5503e53 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2250,6 +2250,8 @@ void __cdecl wined3d_device_draw_indexed_primitive_instanced_indirect(struct win HRESULT __cdecl wined3d_device_draw_primitive(struct wined3d_device *device, UINT start_vertex, UINT vertex_count); void __cdecl wined3d_device_draw_primitive_instanced(struct wined3d_device *device, UINT start_vertex, UINT vertex_count, UINT start_instance, UINT instance_count); +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); void __cdecl wined3d_device_evict_managed_resources(struct wined3d_device *device); -- 2.13.1