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

Alexandre Julliard julliard at winehq.org
Tue Mar 30 15:19:51 CDT 2021


Module: wine
Branch: master
Commit: 7c62e6b169f18f4a5d5809490f8aebdb5a9375eb
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=7c62e6b169f18f4a5d5809490f8aebdb5a9375eb

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Sat Mar 27 14:34:25 2021 -0500

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

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/d3d9/d3d9_private.h |  3 +--
 dlls/d3d9/device.c       | 10 ++++------
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/dlls/d3d9/d3d9_private.h b/dlls/d3d9/d3d9_private.h
index 03ab10ad01b..dc7c4ca3b1c 100644
--- a/dlls/d3d9/d3d9_private.h
+++ b/dlls/d3d9/d3d9_private.h
@@ -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 */
 
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c
index fec631e0e67..229fc59521c 100644
--- a/dlls/d3d9/device.c
+++ b/dlls/d3d9/device.c
@@ -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;




More information about the wine-cvs mailing list