wined3d: state->user_stream is always FALSE in device_stream_info_from_declaration().
Since user pointer draws were removed, state->user_stream will only ever be set for "strided" draws, and device_stream_info_from_declaration() is never called for those.
This commit is contained in:
parent
29cb3c1d90
commit
76a2864a3b
|
@ -181,9 +181,11 @@ void device_stream_info_from_declaration(struct wined3d_device *device, struct w
|
||||||
struct wined3d_vertex_declaration *declaration = state->vertex_declaration;
|
struct wined3d_vertex_declaration *declaration = state->vertex_declaration;
|
||||||
BOOL use_vshader;
|
BOOL use_vshader;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
WORD map;
|
||||||
|
|
||||||
stream_info->use_map = 0;
|
stream_info->use_map = 0;
|
||||||
stream_info->swizzle_map = 0;
|
stream_info->swizzle_map = 0;
|
||||||
|
stream_info->all_vbo = 1;
|
||||||
|
|
||||||
/* Check for transformed vertices, disable vertex shader if present. */
|
/* Check for transformed vertices, disable vertex shader if present. */
|
||||||
stream_info->position_transformed = declaration->position_transformed;
|
stream_info->position_transformed = declaration->position_transformed;
|
||||||
|
@ -205,37 +207,25 @@ void device_stream_info_from_declaration(struct wined3d_device *device, struct w
|
||||||
|
|
||||||
if (!buffer) continue;
|
if (!buffer) continue;
|
||||||
|
|
||||||
data.buffer_object = 0;
|
|
||||||
data.addr = NULL;
|
|
||||||
|
|
||||||
stride = stream->stride;
|
stride = stream->stride;
|
||||||
if (state->user_stream)
|
|
||||||
{
|
|
||||||
TRACE("Stream %u is UP, %p\n", element->input_slot, buffer);
|
|
||||||
data.buffer_object = 0;
|
|
||||||
data.addr = (BYTE *)buffer;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
TRACE("Stream %u isn't UP, %p\n", element->input_slot, buffer);
|
|
||||||
buffer_get_memory(buffer, &device->adapter->gl_info, &data);
|
|
||||||
|
|
||||||
/* Can't use vbo's if the base vertex index is negative. OpenGL doesn't accept negative offsets
|
TRACE("Stream %u, buffer %p.\n", element->input_slot, buffer);
|
||||||
* (or rather offsets bigger than the vbo, because the pointer is unsigned), so use system memory
|
buffer_get_memory(buffer, &device->adapter->gl_info, &data);
|
||||||
* sources. In most sane cases the pointer - offset will still be > 0, otherwise it will wrap
|
|
||||||
* around to some big value. Hope that with the indices, the driver wraps it back internally. If
|
/* We can't use VBOs if the base vertex index is negative. OpenGL
|
||||||
* not, drawStridedSlow is needed, including a vertex buffer path. */
|
* doesn't accept negative offsets (or rather offsets bigger than the
|
||||||
if (state->load_base_vertex_index < 0)
|
* VBO, because the pointer is unsigned), so use system memory
|
||||||
{
|
* sources. In most sane cases the pointer - offset will still be > 0,
|
||||||
WARN("load_base_vertex_index is < 0 (%d), not using VBOs.\n",
|
* otherwise it will wrap around to some big value. Hope that with the
|
||||||
state->load_base_vertex_index);
|
* indices, the driver wraps it back internally. If not,
|
||||||
data.buffer_object = 0;
|
* drawStridedSlow() is needed, including a vertex buffer path. */
|
||||||
data.addr = buffer_get_sysmem(buffer, &device->adapter->gl_info);
|
if (state->load_base_vertex_index < 0)
|
||||||
if ((UINT_PTR)data.addr < -state->load_base_vertex_index * stride)
|
{
|
||||||
{
|
WARN("load_base_vertex_index is < 0 (%d), not using VBOs.\n", state->load_base_vertex_index);
|
||||||
FIXME("System memory vertex data load offset is negative!\n");
|
data.buffer_object = 0;
|
||||||
}
|
data.addr = buffer_get_sysmem(buffer, &device->adapter->gl_info);
|
||||||
}
|
if ((UINT_PTR)data.addr < -state->load_base_vertex_index * stride)
|
||||||
|
FIXME("System memory vertex data load offset is negative!\n");
|
||||||
}
|
}
|
||||||
data.addr += element->offset;
|
data.addr += element->offset;
|
||||||
|
|
||||||
|
@ -295,42 +285,32 @@ void device_stream_info_from_declaration(struct wined3d_device *device, struct w
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Preload the vertex buffers. */
|
||||||
device->num_buffer_queries = 0;
|
device->num_buffer_queries = 0;
|
||||||
if (!state->user_stream)
|
for (i = 0, map = stream_info->use_map; map; map >>= 1, ++i)
|
||||||
{
|
{
|
||||||
WORD map = stream_info->use_map;
|
struct wined3d_stream_info_element *element;
|
||||||
stream_info->all_vbo = 1;
|
struct wined3d_buffer *buffer;
|
||||||
|
|
||||||
/* PreLoad all the vertex buffers. */
|
if (!(map & 1))
|
||||||
for (i = 0; map; map >>= 1, ++i)
|
continue;
|
||||||
|
|
||||||
|
element = &stream_info->elements[i];
|
||||||
|
buffer = state->streams[element->stream_idx].buffer;
|
||||||
|
wined3d_buffer_preload(buffer);
|
||||||
|
|
||||||
|
/* If the preload dropped the buffer object, update the stream info. */
|
||||||
|
if (buffer->buffer_object != element->data.buffer_object)
|
||||||
{
|
{
|
||||||
struct wined3d_stream_info_element *element;
|
element->data.buffer_object = 0;
|
||||||
struct wined3d_buffer *buffer;
|
element->data.addr = buffer_get_sysmem(buffer, &device->adapter->gl_info) + (ptrdiff_t)element->data.addr;
|
||||||
|
|
||||||
if (!(map & 1)) continue;
|
|
||||||
|
|
||||||
element = &stream_info->elements[i];
|
|
||||||
buffer = state->streams[element->stream_idx].buffer;
|
|
||||||
wined3d_buffer_preload(buffer);
|
|
||||||
|
|
||||||
/* If the preload dropped the buffer object, update the stream info. */
|
|
||||||
if (buffer->buffer_object != element->data.buffer_object)
|
|
||||||
{
|
|
||||||
element->data.buffer_object = 0;
|
|
||||||
element->data.addr = buffer_get_sysmem(buffer, &device->adapter->gl_info)
|
|
||||||
+ (ptrdiff_t)element->data.addr;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!buffer->buffer_object)
|
|
||||||
stream_info->all_vbo = 0;
|
|
||||||
|
|
||||||
if (buffer->query)
|
|
||||||
device->buffer_queries[device->num_buffer_queries++] = buffer->query;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
if (!buffer->buffer_object)
|
||||||
{
|
stream_info->all_vbo = 0;
|
||||||
stream_info->all_vbo = 0;
|
|
||||||
|
if (buffer->query)
|
||||||
|
device->buffer_queries[device->num_buffer_queries++] = buffer->query;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue