[PATCH 7/7] wined3d: Resume transform feedback after geometry shader switch.
Józef Kucia
jkucia at codeweavers.com
Thu Mar 30 07:09:24 CDT 2017
Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
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)
{
--
2.10.2
More information about the wine-patches
mailing list