mirror of
https://github.com/reactos/wine.git
synced 2025-02-18 03:48:01 +00:00
wined3d: Determine index buffer location based on vertex buffer locations.
This commit is contained in:
parent
9267148705
commit
29893d8162
@ -404,6 +404,7 @@ void device_update_stream_info(struct wined3d_device *device, const struct wined
|
||||
{
|
||||
struct wined3d_stream_info *stream_info = &device->strided_streams;
|
||||
const struct wined3d_state *state = &device->stateBlock->state;
|
||||
DWORD prev_all_vbo = stream_info->all_vbo;
|
||||
|
||||
if (device->up_strided)
|
||||
{
|
||||
@ -445,6 +446,16 @@ void device_update_stream_info(struct wined3d_device *device, const struct wined
|
||||
device->useDrawStridedSlow = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (state->index_buffer && !state->user_stream)
|
||||
{
|
||||
if (prev_all_vbo != stream_info->all_vbo)
|
||||
device_invalidate_state(device, STATE_INDEXBUFFER);
|
||||
if (stream_info->all_vbo)
|
||||
wined3d_buffer_preload(state->index_buffer);
|
||||
else
|
||||
buffer_get_sysmem(state->index_buffer, gl_info);
|
||||
}
|
||||
}
|
||||
|
||||
static void device_preload_texture(const struct wined3d_state *state, unsigned int idx)
|
||||
|
@ -676,7 +676,7 @@ void drawPrimitive(struct wined3d_device *device, UINT index_count, UINT StartId
|
||||
if (!state->user_stream)
|
||||
{
|
||||
struct wined3d_buffer *index_buffer = state->index_buffer;
|
||||
if (!index_buffer->buffer_object)
|
||||
if (!index_buffer->buffer_object || !stream_info->all_vbo)
|
||||
idxData = index_buffer->resource.allocatedMemory;
|
||||
else
|
||||
idxData = NULL;
|
||||
|
@ -4817,9 +4817,10 @@ static void scissorrect(struct wined3d_context *context, const struct wined3d_st
|
||||
|
||||
static void indexbuffer(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||
{
|
||||
const struct wined3d_stream_info *stream_info = &context->swapchain->device->strided_streams;
|
||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||
|
||||
if (state->user_stream || !state->index_buffer)
|
||||
if (state->user_stream || !state->index_buffer || !stream_info->all_vbo)
|
||||
{
|
||||
GL_EXTCALL(glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user