Henri Verbeet : wined3d: Do not record the GL primitive type in stateblocks.

Alexandre Julliard julliard at winehq.org
Mon Feb 27 15:12:08 CST 2017


Module: wine
Branch: master
Commit: e8e4fac959d0da602356fbab172c1bcc31d15b1a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e8e4fac959d0da602356fbab172c1bcc31d15b1a

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Sun Feb 26 07:46:32 2017 +0100

wined3d: Do not record the GL primitive type in stateblocks.

Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/device.c          |  8 +++-----
 dlls/wined3d/stateblock.c      | 17 -----------------
 dlls/wined3d/wined3d_private.h |  3 +--
 3 files changed, 4 insertions(+), 24 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 5a4eb25..dff741f 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3449,11 +3449,9 @@ void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device,
     TRACE("device %p, primitive_type %s\n", device, debug_d3dprimitivetype(primitive_type));
 
     gl_primitive_type = gl_primitive_type_from_d3d(primitive_type);
-    prev = device->update_state->gl_primitive_type;
-    device->update_state->gl_primitive_type = gl_primitive_type;
-    if (device->recording)
-        device->recording->changed.primitive_type = TRUE;
-    else if (gl_primitive_type != prev && (gl_primitive_type == GL_POINTS || prev == GL_POINTS))
+    prev = device->state.gl_primitive_type;
+    device->state.gl_primitive_type = gl_primitive_type;
+    if (gl_primitive_type != prev && (gl_primitive_type == GL_POINTS || prev == GL_POINTS))
         device_invalidate_state(device, STATE_POINT_ENABLE);
 }
 
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c
index 22e511f..8b91353 100644
--- a/dlls/wined3d/stateblock.c
+++ b/dlls/wined3d/stateblock.c
@@ -202,7 +202,6 @@ static void stateblock_savedstates_set_all(struct wined3d_saved_states *states,
     unsigned int i;
 
     /* Single values */
-    states->primitive_type = 1;
     states->indices = 1;
     states->material = 1;
     states->viewport = 1;
@@ -772,9 +771,6 @@ void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock)
         stateblock->state.transforms[transform] = src_state->transforms[transform];
     }
 
-    if (stateblock->changed.primitive_type)
-        stateblock->state.gl_primitive_type = src_state->gl_primitive_type;
-
     if (stateblock->changed.indices
             && ((stateblock->state.index_buffer != src_state->index_buffer)
                 || (stateblock->state.base_vertex_index != src_state->base_vertex_index)
@@ -1045,19 +1041,6 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock)
                 &stateblock->state.transforms[stateblock->contained_transform_states[i]]);
     }
 
-    if (stateblock->changed.primitive_type)
-    {
-        GLenum gl_primitive_type, prev;
-
-        if (device->recording)
-            device->recording->changed.primitive_type = TRUE;
-        gl_primitive_type = stateblock->state.gl_primitive_type;
-        prev = device->update_state->gl_primitive_type;
-        device->update_state->gl_primitive_type = gl_primitive_type;
-        if (gl_primitive_type != prev && (gl_primitive_type == GL_POINTS || prev == GL_POINTS))
-            device_invalidate_state(device, STATE_POINT_ENABLE);
-    }
-
     if (stateblock->changed.indices)
     {
         wined3d_device_set_index_buffer(device, stateblock->state.index_buffer,
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index ec0fcbf..3210e3f 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3101,7 +3101,6 @@ struct wined3d_saved_states
     WORD vertexShaderConstantsI;                /* WINED3D_MAX_CONSTS_I, 16 */
     BOOL vs_consts_f[WINED3D_MAX_VS_CONSTS_F];
     DWORD textures : 20;                        /* MAX_COMBINED_SAMPLERS, 20 */
-    DWORD primitive_type : 1;
     DWORD indices : 1;
     DWORD material : 1;
     DWORD viewport : 1;
@@ -3109,7 +3108,7 @@ struct wined3d_saved_states
     DWORD pixelShader : 1;
     DWORD vertexShader : 1;
     DWORD scissorRect : 1;
-    DWORD padding : 4;
+    DWORD padding : 5;
 };
 
 struct StageState {




More information about the wine-cvs mailing list