=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: wined3d: Resume transform feedback after geometry shader switch.

Alexandre Julliard julliard at winehq.org
Thu Mar 30 15:18:02 CDT 2017


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

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Thu Mar 30 14:09:24 2017 +0200

wined3d: Resume transform feedback after geometry shader switch.

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/d3d11/tests/d3d11.c |  1 -
 dlls/wined3d/drawprim.c  | 39 ++++++++++++++++++++++++---------------
 2 files changed, 24 insertions(+), 16 deletions(-)

diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index 1e7b5df..dbf8324 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -16870,7 +16870,6 @@ static void test_stream_output_resume(void)
         for (j = 0; j < 6; ++j) /* 2 triangles */
         {
             data = get_readback_vec4(&rb, idx++, 0);
-            todo_wine
             ok(compare_vec4(data, &constants[i], 0),
                     "Got unexpected result {%.8e, %.8e, %.8e, %.8e} at %u (%u, %u).\n",
                     data->x, data->y, data->z, data->w, idx, i, j);
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index 3611bf5..1335707 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -414,6 +414,27 @@ static BOOL use_transform_feedback(const struct wined3d_state *state)
     return shader->u.gs.so_desc.element_count;
 }
 
+static void context_pause_transform_feedback(struct wined3d_context *context, BOOL force)
+{
+    const struct wined3d_gl_info *gl_info = context->gl_info;
+
+    if (!context->transform_feedback_active || context->transform_feedback_paused)
+        return;
+
+    if (gl_info->supported[ARB_TRANSFORM_FEEDBACK2])
+    {
+        GL_EXTCALL(glPauseTransformFeedback());
+        checkGLcall("glPauseTransformFeedback");
+        context->transform_feedback_paused = 1;
+        return;
+    }
+
+    WARN("Cannot pause transform feedback operations.\n");
+
+    if (force)
+        context_end_transform_feedback(context);
+}
+
 /* Routine common to the draw primitive and draw indexed primitive routines */
 void draw_primitive(struct wined3d_device *device, const struct wined3d_state *state,
         int base_vertex_idx, unsigned int start_idx, unsigned int index_count,
@@ -447,8 +468,8 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
     }
     gl_info = context->gl_info;
 
-    if (context->transform_feedback_active && !use_transform_feedback(state))
-        context_end_transform_feedback(context);
+    if (!use_transform_feedback(state))
+        context_pause_transform_feedback(context, TRUE);
 
     for (i = 0; i < gl_info->limits.buffers; ++i)
     {
@@ -599,19 +620,7 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
         checkGLcall("glMemoryBarrier");
     }
 
-    if (context->transform_feedback_active)
-    {
-        if (gl_info->supported[ARB_TRANSFORM_FEEDBACK2])
-        {
-            GL_EXTCALL(glPauseTransformFeedback());
-            checkGLcall("glPauseTransformFeedback");
-            context->transform_feedback_paused = 1;
-        }
-        else
-        {
-            WARN("Cannot pause transform feedback operations.\n");
-        }
-    }
+    context_pause_transform_feedback(context, FALSE);
 
     if (rasterizer_discard)
     {




More information about the wine-cvs mailing list