Commit 12a05be5 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Use GL_STATIC_DRAW_ARB for static buffers.

This mostly affects the initial placement of the VBO. If an application really does use a static buffer as if it was a dynamic one the driver is likely to migrate it out of VRAM anyway, we shouldn't penalize more well-behaved applications for that.
parent f91c0356
......@@ -113,7 +113,8 @@ static void delete_gl_buffer(struct wined3d_buffer *This, const struct wined3d_g
/* Context activation is done by the caller. */
static void buffer_create_buffer_object(struct wined3d_buffer *This, const struct wined3d_gl_info *gl_info)
{
GLenum error, gl_usage;
GLenum gl_usage = GL_STATIC_DRAW_ARB;
GLenum error;
TRACE("Creating an OpenGL vertex buffer object for wined3d_buffer %p with usage %s.\n",
This, debug_d3dusage(This->resource.usage));
......@@ -149,12 +150,9 @@ static void buffer_create_buffer_object(struct wined3d_buffer *This, const struc
goto fail;
}
/* Don't use static, because dx apps tend to update the buffer
* quite often even if they specify 0 usage.
*/
if(This->resource.usage & WINED3DUSAGE_DYNAMIC)
if (This->resource.usage & WINED3DUSAGE_DYNAMIC)
{
TRACE("Gl usage = GL_STREAM_DRAW_ARB\n");
TRACE("Buffer has WINED3DUSAGE_DYNAMIC set.\n");
gl_usage = GL_STREAM_DRAW_ARB;
if(gl_info->supported[APPLE_FLUSH_BUFFER_RANGE])
......@@ -169,11 +167,6 @@ static void buffer_create_buffer_object(struct wined3d_buffer *This, const struc
}
/* No setup is needed here for GL_ARB_map_buffer_range */
}
else
{
TRACE("Gl usage = GL_DYNAMIC_DRAW_ARB\n");
gl_usage = GL_DYNAMIC_DRAW_ARB;
}
/* Reserve memory for the buffer. The amount of data won't change
* so we are safe with calling glBufferData once and
......
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