Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- dlls/wined3d/buffer.c | 10 ++++------ dlls/wined3d/texture.c | 3 ++- dlls/wined3d/view.c | 3 ++- dlls/wined3d/wined3d_private.h | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c index 2b24e071c05..0caf933724a 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -200,7 +200,6 @@ static BOOL wined3d_buffer_gl_create_buffer_object(struct wined3d_buffer_gl *buf struct wined3d_context_gl *context_gl) { const struct wined3d_gl_info *gl_info = context_gl->gl_info; - GLenum gl_usage = GL_STATIC_DRAW; struct wined3d_bo_gl *bo; GLenum error;
@@ -223,6 +222,7 @@ static BOOL wined3d_buffer_gl_create_buffer_object(struct wined3d_buffer_gl *buf bo = &buffer_gl->bo; GL_EXTCALL(glGenBuffers(1, &bo->id)); bo->binding = wined3d_buffer_gl_binding_from_bind_flags(gl_info, buffer_gl->b.resource.bind_flags); + bo->usage = GL_STATIC_DRAW; buffer_gl->b.buffer_object = (uintptr_t)bo; error = gl_info->gl_ops.gl.p_glGetError(); if (!bo->id || error != GL_NO_ERROR) @@ -242,7 +242,7 @@ static BOOL wined3d_buffer_gl_create_buffer_object(struct wined3d_buffer_gl *buf if (buffer_gl->b.resource.usage & WINED3DUSAGE_DYNAMIC) { TRACE("Buffer has WINED3DUSAGE_DYNAMIC set.\n"); - gl_usage = GL_STREAM_DRAW_ARB; + bo->usage = GL_STREAM_DRAW_ARB;
if (gl_info->supported[APPLE_FLUSH_BUFFER_RANGE]) { @@ -254,7 +254,7 @@ static BOOL wined3d_buffer_gl_create_buffer_object(struct wined3d_buffer_gl *buf /* No setup is needed here for GL_ARB_map_buffer_range. */ }
- GL_EXTCALL(glBufferData(bo->binding, buffer_gl->b.resource.size, NULL, gl_usage)); + GL_EXTCALL(glBufferData(bo->binding, buffer_gl->b.resource.size, NULL, bo->usage)); error = gl_info->gl_ops.gl.p_glGetError(); if (error != GL_NO_ERROR) { @@ -262,7 +262,6 @@ static BOOL wined3d_buffer_gl_create_buffer_object(struct wined3d_buffer_gl *buf goto fail; }
- buffer_gl->buffer_object_usage = gl_usage; buffer_invalidate_bo_range(&buffer_gl->b, 0, 0);
return TRUE; @@ -799,8 +798,7 @@ static void wined3d_buffer_gl_sync_apple(struct wined3d_buffer_gl *buffer_gl, { wined3d_buffer_gl_bind(buffer_gl, context_gl);
- GL_EXTCALL(glBufferData(buffer_gl->bo.binding, buffer_gl->b.resource.size, - NULL, buffer_gl->buffer_object_usage)); + GL_EXTCALL(glBufferData(buffer_gl->bo.binding, buffer_gl->b.resource.size, NULL, buffer_gl->bo.usage)); checkGLcall("glBufferData"); return; } diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 0aef891547a..73821cc27a9 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -1926,8 +1926,9 @@ static void wined3d_texture_prepare_buffer_object(struct wined3d_texture *textur
GL_EXTCALL(glGenBuffers(1, &bo->id)); bo->binding = GL_PIXEL_UNPACK_BUFFER; + bo->usage = GL_STREAM_DRAW; GL_EXTCALL(glBindBuffer(bo->binding, bo->id)); - GL_EXTCALL(glBufferData(bo->binding, sub_resource->size, NULL, GL_STREAM_DRAW)); + GL_EXTCALL(glBufferData(bo->binding, sub_resource->size, NULL, bo->usage)); GL_EXTCALL(glBindBuffer(bo->binding, 0)); checkGLcall("Create buffer object");
diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index a690bd4ae6b..bf4c9ca5af1 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -1417,8 +1417,9 @@ static void wined3d_unordered_access_view_gl_cs_init(void *object)
GL_EXTCALL(glGenBuffers(1, &bo->id)); bo->binding = GL_ATOMIC_COUNTER_BUFFER; + bo->usage = GL_STATIC_DRAW; GL_EXTCALL(glBindBuffer(bo->binding, bo->id)); - GL_EXTCALL(glBufferData(bo->binding, sizeof(initial_value), &initial_value, GL_STATIC_DRAW)); + GL_EXTCALL(glBufferData(bo->binding, sizeof(initial_value), &initial_value, bo->usage)); checkGLcall("create atomic counter buffer"); view_gl->v.counter_bo = (uintptr_t)bo; } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index fa718501e45..dbdb10a182a 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1539,6 +1539,7 @@ struct wined3d_bo_gl { GLuint id; GLenum binding; + GLenum usage; };
static inline GLuint wined3d_bo_gl_id(uintptr_t bo) @@ -4825,7 +4826,6 @@ struct wined3d_buffer_gl struct wined3d_buffer b;
struct wined3d_bo_gl bo; - GLenum buffer_object_usage; };
static inline struct wined3d_buffer_gl *wined3d_buffer_gl(struct wined3d_buffer *buffer)