[PATCH 1/9] d3d11: Implement d3d11_immediate_context_IAGetIndexBuffer().
Józef Kucia
jkucia at codeweavers.com
Fri Jun 24 04:45:57 CDT 2016
Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
dlls/d3d11/device.c | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index 0fc8eb5..13d079e 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -1344,7 +1344,26 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_IAGetVertexBuffers(ID3D11D
static void STDMETHODCALLTYPE d3d11_immediate_context_IAGetIndexBuffer(ID3D11DeviceContext *iface,
ID3D11Buffer **buffer, DXGI_FORMAT *format, UINT *offset)
{
- FIXME("iface %p, buffer %p, format %p, offset %p stub!\n", iface, buffer, format, offset);
+ struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface);
+ enum wined3d_format_id wined3d_format;
+ struct wined3d_buffer *wined3d_buffer;
+ struct d3d_buffer *buffer_impl;
+
+ TRACE("iface %p, buffer %p, format %p, offset %p.\n", iface, buffer, format, offset);
+
+ wined3d_mutex_lock();
+ wined3d_buffer = wined3d_device_get_index_buffer(device->wined3d_device, &wined3d_format, offset);
+ *format = dxgi_format_from_wined3dformat(wined3d_format);
+ if (!wined3d_buffer)
+ {
+ wined3d_mutex_unlock();
+ *buffer = NULL;
+ return;
+ }
+
+ buffer_impl = wined3d_buffer_get_parent(wined3d_buffer);
+ wined3d_mutex_unlock();
+ ID3D11Buffer_AddRef(*buffer = &buffer_impl->ID3D11Buffer_iface);
}
static void STDMETHODCALLTYPE d3d11_immediate_context_GSGetConstantBuffers(ID3D11DeviceContext *iface,
--
2.7.3
More information about the wine-patches
mailing list