wined3d: Pass a wined3d_context_gl structure to wined3d_query_create_buffer_object().

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2019-07-04 16:28:02 +04:30 committed by Alexandre Julliard
parent 2e49b85f97
commit d7fd641482
1 changed files with 4 additions and 3 deletions

View File

@ -37,10 +37,10 @@ static BOOL wined3d_query_buffer_is_valid(struct wined3d_query *query)
return query->map_ptr[0] == query->map_ptr[1];
}
static void wined3d_query_create_buffer_object(struct wined3d_context *context, struct wined3d_query *query)
static void wined3d_query_create_buffer_object(struct wined3d_context_gl *context_gl, struct wined3d_query *query)
{
const struct wined3d_gl_info *gl_info = context->gl_info;
const GLuint map_flags = GL_MAP_READ_BIT | GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT | GL_MAP_COHERENT_BIT;
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
GLuint buffer_object;
GL_EXTCALL(glGenBuffers(1, &buffer_object));
@ -75,6 +75,7 @@ static void wined3d_query_destroy_buffer_object(struct wined3d_context *context,
* instead of from the csmt-thread. */
static BOOL wined3d_query_buffer_queue_result(struct wined3d_context *context, struct wined3d_query *query, GLuint id)
{
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
const struct wined3d_gl_info *gl_info = context->gl_info;
GLsync tmp_sync;
@ -96,7 +97,7 @@ static BOOL wined3d_query_buffer_queue_result(struct wined3d_context *context, s
}
if (!query->buffer_object)
wined3d_query_create_buffer_object(context, query);
wined3d_query_create_buffer_object(context_gl, query);
GL_EXTCALL(glBindBuffer(GL_QUERY_BUFFER, query->buffer_object));
/* Read the same value twice. We know we have the result if map_ptr[0] == map_ptr[1]. */