Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/d3d9/stateblock.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/dlls/d3d9/stateblock.c b/dlls/d3d9/stateblock.c index a1ce3d5856c..3c1e3230095 100644 --- a/dlls/d3d9/stateblock.c +++ b/dlls/d3d9/stateblock.c @@ -118,11 +118,9 @@ static HRESULT WINAPI d3d9_stateblock_Apply(IDirect3DStateBlock9 *iface) struct wined3d_texture *wined3d_texture; struct wined3d_buffer *wined3d_buffer; struct d3d9_vertexbuffer *buffer; - unsigned int i, offset, stride; - enum wined3d_format_id format; struct d3d9_texture *texture; struct d3d9_device *device; - HRESULT hr; + unsigned int i;
TRACE("iface %p.\n", iface);
@@ -138,15 +136,14 @@ static HRESULT WINAPI d3d9_stateblock_Apply(IDirect3DStateBlock9 *iface) device->sysmem_vb = 0; for (i = 0; i < D3D9_MAX_STREAMS; ++i) { - if (FAILED(hr = wined3d_device_get_stream_source(device->wined3d_device, - i, &wined3d_buffer, &offset, &stride))) + if (!(wined3d_buffer = device->stateblock_state->streams[i].buffer)) continue; - if (!wined3d_buffer || !(buffer = wined3d_buffer_get_parent(wined3d_buffer))) + if (!(buffer = wined3d_buffer_get_parent(wined3d_buffer))) continue; if (buffer->draw_buffer) device->sysmem_vb |= 1u << i; } - device->sysmem_ib = (wined3d_buffer = wined3d_device_get_index_buffer(device->wined3d_device, &format, &offset)) + device->sysmem_ib = (wined3d_buffer = device->stateblock_state->index_buffer) && (buffer = wined3d_buffer_get_parent(wined3d_buffer)) && buffer->draw_buffer; device->auto_mipmaps = 0; for (i = 0; i < D3D9_MAX_TEXTURE_UNITS; ++i)