Commit 4afc7470 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Resolve "load_base_vertex_index" in wined3d_cs_exec_draw().

parent 9c1fbe50
...@@ -311,9 +311,17 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * ...@@ -311,9 +311,17 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
static void wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) static void wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
{ {
struct wined3d_state *state = &cs->device->state;
const struct wined3d_cs_draw *op = data; const struct wined3d_cs_draw *op = data;
draw_primitive(cs->device, &cs->device->state, op->base_vertex_idx, op->start_idx, if (!cs->device->adapter->gl_info.supported[ARB_DRAW_ELEMENTS_BASE_VERTEX]
&& state->load_base_vertex_index != op->base_vertex_idx)
{
state->load_base_vertex_index = op->base_vertex_idx;
device_invalidate_state(cs->device, STATE_BASEVERTEXINDEX);
}
draw_primitive(cs->device, state, op->base_vertex_idx, op->start_idx,
op->index_count, op->start_instance, op->instance_count, op->indexed); op->index_count, op->start_instance, op->instance_count, op->indexed);
} }
......
...@@ -3497,12 +3497,6 @@ HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT ...@@ -3497,12 +3497,6 @@ HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT
{ {
TRACE("device %p, start_vertex %u, vertex_count %u.\n", device, start_vertex, vertex_count); TRACE("device %p, start_vertex %u, vertex_count %u.\n", device, start_vertex, vertex_count);
if (device->state.load_base_vertex_index)
{
device->state.load_base_vertex_index = 0;
device_invalidate_state(device, STATE_BASEVERTEXINDEX);
}
wined3d_cs_emit_draw(device->cs, 0, start_vertex, vertex_count, 0, 0, FALSE); wined3d_cs_emit_draw(device->cs, 0, start_vertex, vertex_count, 0, 0, FALSE);
return WINED3D_OK; return WINED3D_OK;
...@@ -3519,8 +3513,6 @@ void CDECL wined3d_device_draw_primitive_instanced(struct wined3d_device *device ...@@ -3519,8 +3513,6 @@ void CDECL wined3d_device_draw_primitive_instanced(struct wined3d_device *device
HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *device, UINT start_idx, UINT index_count) HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *device, UINT start_idx, UINT index_count)
{ {
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
TRACE("device %p, start_idx %u, index_count %u.\n", device, start_idx, index_count); TRACE("device %p, start_idx %u, index_count %u.\n", device, start_idx, index_count);
if (!device->state.index_buffer) if (!device->state.index_buffer)
...@@ -3533,13 +3525,6 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *devic ...@@ -3533,13 +3525,6 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *devic
return WINED3DERR_INVALIDCALL; return WINED3DERR_INVALIDCALL;
} }
if (!gl_info->supported[ARB_DRAW_ELEMENTS_BASE_VERTEX] &&
device->state.load_base_vertex_index != device->state.base_vertex_index)
{
device->state.load_base_vertex_index = device->state.base_vertex_index;
device_invalidate_state(device, STATE_BASEVERTEXINDEX);
}
wined3d_cs_emit_draw(device->cs, device->state.base_vertex_index, start_idx, index_count, 0, 0, TRUE); wined3d_cs_emit_draw(device->cs, device->state.base_vertex_index, start_idx, index_count, 0, 0, TRUE);
return WINED3D_OK; return WINED3D_OK;
......
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