Commit f4df53c4 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Move the primitive type to wined3d_state.

parent 32089dc6
......@@ -4655,7 +4655,7 @@ static void WINAPI IWineD3DDeviceImpl_SetPrimitiveType(IWineD3DDevice *iface,
TRACE("iface %p, primitive_type %s\n", iface, debug_d3dprimitivetype(primitive_type));
This->updateStateBlock->changed.primitive_type = TRUE;
This->updateStateBlock->gl_primitive_type = gl_primitive_type_from_d3d(primitive_type);
This->updateStateBlock->state.gl_primitive_type = gl_primitive_type_from_d3d(primitive_type);
}
static void WINAPI IWineD3DDeviceImpl_GetPrimitiveType(IWineD3DDevice *iface,
......@@ -4665,7 +4665,7 @@ static void WINAPI IWineD3DDeviceImpl_GetPrimitiveType(IWineD3DDevice *iface,
TRACE("iface %p, primitive_type %p\n", iface, primitive_type);
*primitive_type = d3d_primitive_type_from_gl(This->stateBlock->gl_primitive_type);
*primitive_type = d3d_primitive_type_from_gl(This->stateBlock->state.gl_primitive_type);
TRACE("Returning %s\n", debug_d3dprimitivetype(*primitive_type));
}
......@@ -5513,10 +5513,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DrawRectPatch(IWineD3DDevice *iface, UI
}
This->currentPatch = patch;
old_primitive_type = This->stateBlock->gl_primitive_type;
This->stateBlock->gl_primitive_type = GL_TRIANGLES;
old_primitive_type = This->stateBlock->state.gl_primitive_type;
This->stateBlock->state.gl_primitive_type = GL_TRIANGLES;
IWineD3DDevice_DrawPrimitiveStrided(iface, patch->numSegs[0] * patch->numSegs[1] * 2 * 3, &patch->strided);
This->stateBlock->gl_primitive_type = old_primitive_type;
This->stateBlock->state.gl_primitive_type = old_primitive_type;
This->currentPatch = NULL;
/* Destroy uncached patches */
......
......@@ -651,7 +651,7 @@ void drawPrimitive(IWineD3DDevice *iface, UINT index_count, UINT StartIdx, UINT
|| (!glPointParameteri && !context->gl_info->supported[NV_POINT_SPRITE]))
&& context->render_offscreen
&& This->stateBlock->state.render_states[WINED3DRS_POINTSPRITEENABLE]
&& This->stateBlock->gl_primitive_type == GL_POINTS)
&& This->stateBlock->state.gl_primitive_type == GL_POINTS)
{
FIXME("Point sprite coordinate origin switching not supported.\n");
}
......@@ -659,7 +659,7 @@ void drawPrimitive(IWineD3DDevice *iface, UINT index_count, UINT StartIdx, UINT
/* Ok, we will be updating the screen from here onwards so grab the lock */
ENTER_GL();
{
GLenum glPrimType = This->stateBlock->gl_primitive_type;
GLenum glPrimType = This->stateBlock->state.gl_primitive_type;
BOOL emulation = FALSE;
const struct wined3d_stream_info *stream_info = &This->strided_streams;
struct wined3d_stream_info stridedlcl;
......
......@@ -718,7 +718,7 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_Capture(IWineD3DStateBlock *iface)
This->state.transforms[transform] = targetStateBlock->state.transforms[transform];
}
if (This->changed.primitive_type) This->gl_primitive_type = targetStateBlock->gl_primitive_type;
if (This->changed.primitive_type) This->state.gl_primitive_type = targetStateBlock->state.gl_primitive_type;
if (This->changed.indices
&& ((This->state.index_buffer != targetStateBlock->state.index_buffer)
......@@ -995,7 +995,7 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_Apply(IWineD3DStateBlock *iface)
if (This->changed.primitive_type)
{
This->device->updateStateBlock->changed.primitive_type = TRUE;
This->device->updateStateBlock->gl_primitive_type = This->gl_primitive_type;
This->device->updateStateBlock->state.gl_primitive_type = This->state.gl_primitive_type;
}
if (This->changed.indices)
......
......@@ -2356,6 +2356,7 @@ struct wined3d_state
enum wined3d_format_id index_format;
INT base_vertex_index;
INT load_base_vertex_index; /* Non-indexed drawing needs 0 here, indexed needs base_vertex_index. */
GLenum gl_primitive_type;
struct IWineD3DVertexShaderImpl *vertex_shader;
BOOL vs_consts_b[MAX_CONST_B];
......@@ -2394,9 +2395,6 @@ struct IWineD3DStateBlockImpl
SAVEDSTATES changed;
struct wined3d_state state;
/* primitive type */
GLenum gl_primitive_type;
/* Light hashmap . Collisions are handled using standard wine double linked lists */
#define LIGHTMAP_SIZE 43 /* Use of a prime number recommended. Set to 1 for a linked list! */
#define LIGHTMAP_HASHFUNC(x) ((x) % LIGHTMAP_SIZE) /* Primitive and simple function */
......
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