d3d9: Use device->stateblock_state to check for a valid vertex declaration.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2021-03-27 14:34:25 -05:00 committed by Alexandre Julliard
parent 21c7719055
commit 7c62e6b169
2 changed files with 5 additions and 8 deletions

View File

@ -113,8 +113,7 @@ struct d3d9_device
DWORD sysmem_ib : 1;
DWORD in_destruction : 1;
DWORD in_scene : 1;
DWORD has_vertex_declaration : 1;
DWORD padding : 12;
DWORD padding : 13;
DWORD auto_mipmaps; /* D3D9_MAX_TEXTURE_UNITS */

View File

@ -3024,7 +3024,7 @@ static HRESULT WINAPI d3d9_device_DrawPrimitive(IDirect3DDevice9Ex *iface,
iface, primitive_type, start_vertex, primitive_count);
wined3d_mutex_lock();
if (!device->has_vertex_declaration)
if (!device->stateblock_state->vertex_declaration)
{
wined3d_mutex_unlock();
WARN("Called without a valid vertex declaration set.\n");
@ -3057,7 +3057,7 @@ static HRESULT WINAPI d3d9_device_DrawIndexedPrimitive(IDirect3DDevice9Ex *iface
vertex_count, start_idx, primitive_count);
wined3d_mutex_lock();
if (!device->has_vertex_declaration)
if (!device->stateblock_state->vertex_declaration)
{
wined3d_mutex_unlock();
WARN("Called without a valid vertex declaration set.\n");
@ -3143,7 +3143,7 @@ static HRESULT WINAPI d3d9_device_DrawPrimitiveUP(IDirect3DDevice9Ex *iface,
wined3d_mutex_lock();
if (!device->has_vertex_declaration)
if (!device->stateblock_state->vertex_declaration)
{
wined3d_mutex_unlock();
WARN("Called without a valid vertex declaration set.\n");
@ -3260,7 +3260,7 @@ static HRESULT WINAPI d3d9_device_DrawIndexedPrimitiveUP(IDirect3DDevice9Ex *ifa
wined3d_mutex_lock();
if (!device->has_vertex_declaration)
if (!device->stateblock_state->vertex_declaration)
{
wined3d_mutex_unlock();
WARN("Called without a valid vertex declaration set.\n");
@ -3425,7 +3425,6 @@ static HRESULT WINAPI d3d9_device_SetVertexDeclaration(IDirect3DDevice9Ex *iface
wined3d_mutex_lock();
wined3d_stateblock_set_vertex_declaration(device->update_state,
decl_impl ? decl_impl->wined3d_declaration : NULL);
device->has_vertex_declaration = !!decl_impl;
wined3d_mutex_unlock();
return D3D_OK;
@ -3548,7 +3547,6 @@ static HRESULT WINAPI d3d9_device_SetFVF(IDirect3DDevice9Ex *iface, DWORD fvf)
}
wined3d_stateblock_set_vertex_declaration(device->update_state, decl);
device->has_vertex_declaration = TRUE;
wined3d_mutex_unlock();
return D3D_OK;