Module: wine Branch: master Commit: dc67be012fe780306e6d1e16a8d9369da716d161 URL: http://source.winehq.org/git/wine.git/?a=commit;h=dc67be012fe780306e6d1e16a8...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Thu Nov 22 21:13:38 2012 +0100
d3d10core: Implement d3d10_device_SOGetTargets().
---
dlls/d3d10core/device.c | 21 ++++++++++++++++++++- dlls/wined3d/device.c | 15 +++++++++++++++ dlls/wined3d/wined3d.spec | 1 + include/wine/wined3d.h | 2 ++ 4 files changed, 38 insertions(+), 1 deletions(-)
diff --git a/dlls/d3d10core/device.c b/dlls/d3d10core/device.c index 3b09a04..0623ee5 100644 --- a/dlls/d3d10core/device.c +++ b/dlls/d3d10core/device.c @@ -713,8 +713,27 @@ static void STDMETHODCALLTYPE d3d10_device_OMGetDepthStencilState(ID3D10Device * static void STDMETHODCALLTYPE d3d10_device_SOGetTargets(ID3D10Device *iface, UINT buffer_count, ID3D10Buffer **buffers, UINT *offsets) { - FIXME("iface %p, buffer_count %u, buffers %p, offsets %p stub!\n", + struct d3d10_device *device = impl_from_ID3D10Device(iface); + unsigned int i; + + TRACE("iface %p, buffer_count %u, buffers %p, offsets %p.\n", iface, buffer_count, buffers, offsets); + + for (i = 0; i < buffer_count; ++i) + { + struct wined3d_buffer *wined3d_buffer; + struct d3d10_buffer *buffer_impl; + + if (!(wined3d_buffer = wined3d_device_get_stream_output(device->wined3d_device, i, &offsets[i]))) + { + buffers[i] = NULL; + continue; + } + + buffer_impl = wined3d_buffer_get_parent(wined3d_buffer); + buffers[i] = &buffer_impl->ID3D10Buffer_iface; + ID3D10Buffer_AddRef(buffers[i]); + } }
static void STDMETHODCALLTYPE d3d10_device_RSGetState(ID3D10Device *iface, ID3D10RasterizerState **rasterizer_state) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index b0e7ac2..20c535c 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1600,6 +1600,21 @@ void CDECL wined3d_device_set_stream_output(struct wined3d_device *device, UINT } }
+struct wined3d_buffer * CDECL wined3d_device_get_stream_output(struct wined3d_device *device, + UINT idx, UINT *offset) +{ + TRACE("device %p, idx %u, offset %p.\n", device, idx, offset); + + if (idx >= MAX_STREAM_OUT) + { + WARN("Invalid stream output %u.\n", idx); + return NULL; + } + + *offset = device->stateBlock->state.stream_output[idx].offset; + return device->stateBlock->state.stream_output[idx].buffer; +} + HRESULT CDECL wined3d_device_set_stream_source(struct wined3d_device *device, UINT stream_idx, struct wined3d_buffer *buffer, UINT offset, UINT stride) { diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 56e73e9..549a444 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -81,6 +81,7 @@ @ cdecl wined3d_device_get_sampler_state(ptr long long) @ cdecl wined3d_device_get_scissor_rect(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) @ cdecl wined3d_device_get_stream_source_freq(ptr long ptr) @ cdecl wined3d_device_get_surface_from_dc(ptr ptr) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 76e44f1..dd4d29b 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2150,6 +2150,8 @@ DWORD __cdecl wined3d_device_get_sampler_state(const struct wined3d_device *devi UINT sampler_idx, enum wined3d_sampler_state state); void __cdecl wined3d_device_get_scissor_rect(const struct wined3d_device *device, 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); HRESULT __cdecl wined3d_device_get_stream_source(const struct wined3d_device *device, UINT stream_idx, struct wined3d_buffer **buffer, UINT *offset, UINT *stride); HRESULT __cdecl wined3d_device_get_stream_source_freq(const struct wined3d_device *device,