Commit 6f5a2f58 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

wined3d: Fix transform feedback primitive mode.

parent acb33749
......@@ -57,7 +57,7 @@ const struct wined3d_light WINED3D_default_light =
* actually have the same values in GL and D3D. */
GLenum gl_primitive_type_from_d3d(enum wined3d_primitive_type primitive_type)
{
switch(primitive_type)
switch (primitive_type)
{
case WINED3D_PT_POINTLIST:
return GL_POINTS;
......@@ -90,7 +90,7 @@ GLenum gl_primitive_type_from_d3d(enum wined3d_primitive_type primitive_type)
return GL_TRIANGLE_STRIP_ADJACENCY_ARB;
default:
FIXME("Unhandled primitive type %s\n", debug_d3dprimitivetype(primitive_type));
FIXME("Unhandled primitive type %s.\n", debug_d3dprimitivetype(primitive_type));
case WINED3D_PT_UNDEFINED:
return ~0u;
}
......@@ -98,7 +98,7 @@ GLenum gl_primitive_type_from_d3d(enum wined3d_primitive_type primitive_type)
static enum wined3d_primitive_type d3d_primitive_type_from_gl(GLenum primitive_type)
{
switch(primitive_type)
switch (primitive_type)
{
case GL_POINTS:
return WINED3D_PT_POINTLIST;
......@@ -131,7 +131,7 @@ static enum wined3d_primitive_type d3d_primitive_type_from_gl(GLenum primitive_t
return WINED3D_PT_TRIANGLESTRIP_ADJ;
default:
FIXME("Unhandled primitive type %s\n", debug_d3dprimitivetype(primitive_type));
FIXME("Unhandled primitive type %s.\n", debug_d3dprimitivetype(primitive_type));
case ~0u:
return WINED3D_PT_UNDEFINED;
}
......
......@@ -435,6 +435,32 @@ static void context_pause_transform_feedback(struct wined3d_context *context, BO
context_end_transform_feedback(context);
}
static GLenum gl_tfb_primitive_type_from_d3d(enum wined3d_primitive_type primitive_type)
{
GLenum gl_primitive_type = gl_primitive_type_from_d3d(primitive_type);
switch (gl_primitive_type)
{
case GL_POINTS:
return GL_POINTS;
case GL_LINE_STRIP:
case GL_LINE_STRIP_ADJACENCY:
case GL_LINES_ADJACENCY:
case GL_LINES:
return GL_LINES;
case GL_TRIANGLE_FAN:
case GL_TRIANGLE_STRIP:
case GL_TRIANGLE_STRIP_ADJACENCY:
case GL_TRIANGLES_ADJACENCY:
case GL_TRIANGLES:
return GL_TRIANGLES;
default:
return gl_primitive_type;
}
}
/* 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,
......@@ -584,7 +610,6 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
if (use_transform_feedback(state))
{
const struct wined3d_shader *shader = state->shader[WINED3D_SHADER_TYPE_GEOMETRY];
GLenum primitive_mode = gl_primitive_type_from_d3d(shader->u.gs.output_type);
if (shader->u.gs.so_desc.rasterizer_stream_idx == WINED3D_NO_RASTERIZER_STREAM)
{
......@@ -601,7 +626,8 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
}
else if (!context->transform_feedback_active)
{
GL_EXTCALL(glBeginTransformFeedback(primitive_mode));
GLenum mode = gl_tfb_primitive_type_from_d3d(shader->u.gs.output_type);
GL_EXTCALL(glBeginTransformFeedback(mode));
checkGLcall("glBeginTransformFeedback");
context->transform_feedback_active = 1;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment