Commit c885524c authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

d3d9: Correctly check for sysmem index buffers in d3d9_stateblock_Apply().

This fixes a regression introduced by 66f37aae. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53372
parent 90183850
...@@ -113,9 +113,10 @@ static HRESULT WINAPI d3d9_stateblock_Capture(IDirect3DStateBlock9 *iface) ...@@ -113,9 +113,10 @@ static HRESULT WINAPI d3d9_stateblock_Capture(IDirect3DStateBlock9 *iface)
static HRESULT WINAPI d3d9_stateblock_Apply(IDirect3DStateBlock9 *iface) static HRESULT WINAPI d3d9_stateblock_Apply(IDirect3DStateBlock9 *iface)
{ {
struct d3d9_stateblock *stateblock = impl_from_IDirect3DStateBlock9(iface); struct d3d9_stateblock *stateblock = impl_from_IDirect3DStateBlock9(iface);
struct d3d9_vertexbuffer *vertex_buffer;
struct wined3d_texture *wined3d_texture; struct wined3d_texture *wined3d_texture;
struct d3d9_indexbuffer *index_buffer;
struct wined3d_buffer *wined3d_buffer; struct wined3d_buffer *wined3d_buffer;
struct d3d9_vertexbuffer *buffer;
struct d3d9_texture *texture; struct d3d9_texture *texture;
struct d3d9_device *device; struct d3d9_device *device;
unsigned int i; unsigned int i;
...@@ -136,13 +137,13 @@ static HRESULT WINAPI d3d9_stateblock_Apply(IDirect3DStateBlock9 *iface) ...@@ -136,13 +137,13 @@ static HRESULT WINAPI d3d9_stateblock_Apply(IDirect3DStateBlock9 *iface)
{ {
if (!(wined3d_buffer = device->stateblock_state->streams[i].buffer)) if (!(wined3d_buffer = device->stateblock_state->streams[i].buffer))
continue; continue;
if (!(buffer = wined3d_buffer_get_parent(wined3d_buffer))) if (!(vertex_buffer = wined3d_buffer_get_parent(wined3d_buffer)))
continue; continue;
if (buffer->draw_buffer) if (vertex_buffer->draw_buffer)
device->sysmem_vb |= 1u << i; device->sysmem_vb |= 1u << i;
} }
device->sysmem_ib = (wined3d_buffer = device->stateblock_state->index_buffer) device->sysmem_ib = (wined3d_buffer = device->stateblock_state->index_buffer)
&& (buffer = wined3d_buffer_get_parent(wined3d_buffer)) && buffer->draw_buffer; && (index_buffer = wined3d_buffer_get_parent(wined3d_buffer)) && index_buffer->sysmem;
device->auto_mipmaps = 0; device->auto_mipmaps = 0;
for (i = 0; i < D3D9_MAX_TEXTURE_UNITS; ++i) 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