Paul Gofman : wined3d: Initialise stream frequency to 1.

Alexandre Julliard julliard at winehq.org
Mon Feb 11 16:12:09 CST 2019


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

Author: Paul Gofman <gofmanp at gmail.com>
Date:   Fri Feb  8 19:34:13 2019 +0300

wined3d: Initialise stream frequency to 1.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=39080
Signed-off-by: Paul Gofman <gofmanp at gmail.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/context.c    | 2 +-
 dlls/wined3d/stateblock.c | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 81b1fc0..96ba06d 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -5388,7 +5388,7 @@ static void context_load_numbered_arrays(struct wined3d_context *context,
         stream = &state->streams[element->stream_idx];
 
         if ((stream->flags & WINED3DSTREAMSOURCE_INSTANCEDATA) && !context->instance_count)
-            context->instance_count = state->streams[0].frequency ? state->streams[0].frequency : 1;
+            context->instance_count = state->streams[0].frequency;
 
         if (gl_info->supported[ARB_INSTANCED_ARRAYS])
         {
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c
index 4f16c99..1ae0f35 100644
--- a/dlls/wined3d/stateblock.c
+++ b/dlls/wined3d/stateblock.c
@@ -1448,6 +1448,9 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d
     state->blend_factor.g = 1.0f;
     state->blend_factor.b = 1.0f;
     state->blend_factor.a = 1.0f;
+
+    for (i = 0; i < MAX_STREAMS; ++i)
+        state->streams[i].frequency = 1;
 }
 
 void state_init(struct wined3d_state *state, struct wined3d_fb_state *fb,
@@ -1496,6 +1499,9 @@ static void stateblock_state_init_default(struct wined3d_stateblock_state *state
     state->blend_factor.g = 1.0f;
     state->blend_factor.b = 1.0f;
     state->blend_factor.a = 1.0f;
+
+    for (i = 0; i < MAX_STREAMS; ++i)
+        state->streams[i].frequency = 1;
 }
 
 void wined3d_stateblock_state_init(struct wined3d_stateblock_state *state,




More information about the wine-cvs mailing list