Commit acaf1204 authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

d3d9: Retrieve state from the stateblock in d3d9_stateblock_Apply().

parent a9125eed
......@@ -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)
......
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