Commit 9defaa53 authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

wined3d: Use the core version of the asynchronous queries functions.

parent 1e48bbb7
......@@ -504,8 +504,8 @@ void context_alloc_occlusion_query(struct wined3d_context *context, struct wined
{
if (gl_info->supported[ARB_OCCLUSION_QUERY])
{
GL_EXTCALL(glGenQueriesARB(1, &query->id));
checkGLcall("glGenQueriesARB");
GL_EXTCALL(glGenQueries(1, &query->id));
checkGLcall("glGenQueries");
TRACE("Allocated occlusion query %u in context %p.\n", query->id, context);
}
......@@ -625,8 +625,8 @@ void context_alloc_timestamp_query(struct wined3d_context *context, struct wined
}
else
{
GL_EXTCALL(glGenQueriesARB(1, &query->id));
checkGLcall("glGenQueriesARB");
GL_EXTCALL(glGenQueries(1, &query->id));
checkGLcall("glGenQueries");
TRACE("Allocated timestamp query %u in context %p.\n", query->id, context);
}
......@@ -980,14 +980,14 @@ static void context_destroy_gl_resources(struct wined3d_context *context)
LIST_FOR_EACH_ENTRY(timestamp_query, &context->timestamp_queries, struct wined3d_timestamp_query, entry)
{
if (context->valid)
GL_EXTCALL(glDeleteQueriesARB(1, &timestamp_query->id));
GL_EXTCALL(glDeleteQueries(1, &timestamp_query->id));
timestamp_query->context = NULL;
}
LIST_FOR_EACH_ENTRY(occlusion_query, &context->occlusion_queries, struct wined3d_occlusion_query, entry)
{
if (context->valid && gl_info->supported[ARB_OCCLUSION_QUERY])
GL_EXTCALL(glDeleteQueriesARB(1, &occlusion_query->id));
GL_EXTCALL(glDeleteQueries(1, &occlusion_query->id));
occlusion_query->context = NULL;
}
......@@ -1025,10 +1025,10 @@ static void context_destroy_gl_resources(struct wined3d_context *context)
}
if (gl_info->supported[ARB_TIMER_QUERY])
GL_EXTCALL(glDeleteQueriesARB(context->free_timestamp_query_count, context->free_timestamp_queries));
GL_EXTCALL(glDeleteQueries(context->free_timestamp_query_count, context->free_timestamp_queries));
if (gl_info->supported[ARB_OCCLUSION_QUERY])
GL_EXTCALL(glDeleteQueriesARB(context->free_occlusion_query_count, context->free_occlusion_queries));
GL_EXTCALL(glDeleteQueries(context->free_occlusion_query_count, context->free_occlusion_queries));
if (gl_info->supported[ARB_SYNC])
{
......
......@@ -2869,6 +2869,7 @@ static void load_gl_funcs(struct wined3d_gl_info *gl_info)
/* Newer core functions */
USE_GL_FUNC(glActiveTexture) /* OpenGL 1.3 */
USE_GL_FUNC(glAttachShader) /* OpenGL 2.0 */
USE_GL_FUNC(glBeginQuery) /* OpenGL 1.5 */
USE_GL_FUNC(glBindAttribLocation) /* OpenGL 2.0 */
USE_GL_FUNC(glBindBuffer) /* OpenGL 1.5 */
USE_GL_FUNC(glBlendColor) /* OpenGL 1.4 */
......@@ -2887,13 +2888,16 @@ static void load_gl_funcs(struct wined3d_gl_info *gl_info)
USE_GL_FUNC(glCreateShader) /* OpenGL 2.0 */
USE_GL_FUNC(glDeleteBuffers) /* OpenGL 1.5 */
USE_GL_FUNC(glDeleteProgram) /* OpenGL 2.0 */
USE_GL_FUNC(glDeleteQueries) /* OpenGL 1.5 */
USE_GL_FUNC(glDeleteShader) /* OpenGL 2.0 */
USE_GL_FUNC(glDetachShader) /* OpenGL 2.0 */
USE_GL_FUNC(glDisableVertexAttribArray) /* OpenGL 2.0 */
USE_GL_FUNC(glDrawBuffers) /* OpenGL 2.0 */
USE_GL_FUNC(glDrawElementsInstanced) /* OpenGL 3.1 */
USE_GL_FUNC(glEnableVertexAttribArray) /* OpenGL 2.0 */
USE_GL_FUNC(glEndQuery) /* OpenGL 1.5 */
USE_GL_FUNC(glGenBuffers) /* OpenGL 1.5 */
USE_GL_FUNC(glGenQueries) /* OpenGL 1.5 */
USE_GL_FUNC(glGetActiveUniform) /* OpenGL 2.0 */
USE_GL_FUNC(glGetAttachedShaders) /* OpenGL 2.0 */
USE_GL_FUNC(glGetAttribLocation) /* OpenGL 2.0 */
......@@ -2901,6 +2905,8 @@ static void load_gl_funcs(struct wined3d_gl_info *gl_info)
USE_GL_FUNC(glGetCompressedTexImage) /* OpenGL 1.3 */
USE_GL_FUNC(glGetProgramInfoLog) /* OpenGL 2.0 */
USE_GL_FUNC(glGetProgramiv) /* OpenGL 2.0 */
USE_GL_FUNC(glGetQueryiv) /* OpenGL 1.5 */
USE_GL_FUNC(glGetQueryObjectuiv) /* OpenGL 1.5 */
USE_GL_FUNC(glGetShaderInfoLog) /* OpenGL 2.0 */
USE_GL_FUNC(glGetShaderiv) /* OpenGL 2.0 */
USE_GL_FUNC(glGetShaderSource) /* OpenGL 2.0 */
......@@ -2974,6 +2980,7 @@ static void load_gl_funcs(struct wined3d_gl_info *gl_info)
MAP_GL_FUNCTION(glActiveTexture, glActiveTextureARB);
MAP_GL_FUNCTION(glAttachShader, glAttachObjectARB);
MAP_GL_FUNCTION(glBeginQuery, glBeginQueryARB);
MAP_GL_FUNCTION(glBindAttribLocation, glBindAttribLocationARB);
MAP_GL_FUNCTION(glBindBuffer, glBindBufferARB);
MAP_GL_FUNCTION(glBlendColor, glBlendColorEXT);
......@@ -2992,13 +2999,16 @@ static void load_gl_funcs(struct wined3d_gl_info *gl_info)
MAP_GL_FUNCTION(glCreateShader, glCreateShaderObjectARB);
MAP_GL_FUNCTION(glDeleteBuffers, glDeleteBuffersARB);
MAP_GL_FUNCTION(glDeleteProgram, glDeleteObjectARB);
MAP_GL_FUNCTION(glDeleteQueries, glDeleteQueriesARB);
MAP_GL_FUNCTION(glDeleteShader, glDeleteObjectARB);
MAP_GL_FUNCTION(glDetachShader, glDetachObjectARB);
MAP_GL_FUNCTION(glDisableVertexAttribArray, glDisableVertexAttribArrayARB);
MAP_GL_FUNCTION(glDrawBuffers, glDrawBuffersARB);
MAP_GL_FUNCTION(glDrawElementsInstanced, glDrawElementsInstancedARB);
MAP_GL_FUNCTION(glEnableVertexAttribArray, glEnableVertexAttribArrayARB);
MAP_GL_FUNCTION(glEndQuery, glEndQueryARB);
MAP_GL_FUNCTION(glGenBuffers, glGenBuffersARB);
MAP_GL_FUNCTION(glGenQueries, glGenQueriesARB);
MAP_GL_FUNCTION(glGetActiveUniform, glGetActiveUniformARB);
MAP_GL_FUNCTION(glGetAttachedShaders, glGetAttachedObjectsARB);
MAP_GL_FUNCTION(glGetAttribLocation, glGetAttribLocationARB);
......@@ -3006,6 +3016,8 @@ static void load_gl_funcs(struct wined3d_gl_info *gl_info)
MAP_GL_FUNCTION(glGetCompressedTexImage, glGetCompressedTexImageARB);
MAP_GL_FUNCTION(glGetProgramInfoLog, glGetInfoLogARB);
MAP_GL_FUNCTION(glGetProgramiv, glGetObjectParameterivARB);
MAP_GL_FUNCTION(glGetQueryiv, glGetQueryivARB);
MAP_GL_FUNCTION(glGetQueryObjectuiv, glGetQueryObjectuivARB);
MAP_GL_FUNCTION(glGetShaderInfoLog, glGetInfoLogARB);
MAP_GL_FUNCTION(glGetShaderiv, glGetObjectParameterivARB);
MAP_GL_FUNCTION(glGetShaderSource, glGetShaderSourceARB);
......@@ -3492,7 +3504,7 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter)
{
GLint counter_bits;
GL_EXTCALL(glGetQueryivARB(GL_SAMPLES_PASSED_ARB, GL_QUERY_COUNTER_BITS_ARB, &counter_bits));
GL_EXTCALL(glGetQueryiv(GL_SAMPLES_PASSED, GL_QUERY_COUNTER_BITS, &counter_bits));
TRACE("Occlusion query counter has %d bits.\n", counter_bits);
if (!counter_bits)
gl_info->supported[ARB_OCCLUSION_QUERY] = FALSE;
......@@ -3501,7 +3513,7 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter)
{
GLint counter_bits;
GL_EXTCALL(glGetQueryivARB(GL_TIMESTAMP, GL_QUERY_COUNTER_BITS_ARB, &counter_bits));
GL_EXTCALL(glGetQueryiv(GL_TIMESTAMP, GL_QUERY_COUNTER_BITS, &counter_bits));
TRACE("Timestamp query counter has %d bits.\n", counter_bits);
if (!counter_bits)
gl_info->supported[ARB_TIMER_QUERY] = FALSE;
......
......@@ -350,16 +350,16 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query,
context = context_acquire(query->device, oq->context->current_rt);
GL_EXTCALL(glGetQueryObjectuivARB(oq->id, GL_QUERY_RESULT_AVAILABLE_ARB, &available));
checkGLcall("glGetQueryObjectuivARB(GL_QUERY_RESULT_AVAILABLE)");
GL_EXTCALL(glGetQueryObjectuiv(oq->id, GL_QUERY_RESULT_AVAILABLE, &available));
checkGLcall("glGetQueryObjectuiv(GL_QUERY_RESULT_AVAILABLE)");
TRACE("available %#x.\n", available);
if (available)
{
if (size)
{
GL_EXTCALL(glGetQueryObjectuivARB(oq->id, GL_QUERY_RESULT_ARB, &samples));
checkGLcall("glGetQueryObjectuivARB(GL_QUERY_RESULT)");
GL_EXTCALL(glGetQueryObjectuiv(oq->id, GL_QUERY_RESULT, &samples));
checkGLcall("glGetQueryObjectuiv(GL_QUERY_RESULT)");
TRACE("Returning %d samples.\n", samples);
fill_query_data(data, size, &samples, sizeof(samples));
}
......@@ -492,7 +492,7 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW
{
context = context_acquire(query->device, oq->context->current_rt);
GL_EXTCALL(glEndQueryARB(GL_SAMPLES_PASSED_ARB));
GL_EXTCALL(glEndQuery(GL_SAMPLES_PASSED));
checkGLcall("glEndQuery()");
}
}
......@@ -503,7 +503,7 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW
context_alloc_occlusion_query(context, oq);
}
GL_EXTCALL(glBeginQueryARB(GL_SAMPLES_PASSED_ARB, oq->id));
GL_EXTCALL(glBeginQuery(GL_SAMPLES_PASSED, oq->id));
checkGLcall("glBeginQuery()");
context_release(context);
......@@ -524,7 +524,7 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW
{
context = context_acquire(query->device, oq->context->current_rt);
GL_EXTCALL(glEndQueryARB(GL_SAMPLES_PASSED_ARB));
GL_EXTCALL(glEndQuery(GL_SAMPLES_PASSED));
checkGLcall("glEndQuery()");
context_release(context);
......@@ -580,16 +580,16 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query,
context = context_acquire(query->device, tq->context->current_rt);
GL_EXTCALL(glGetQueryObjectuivARB(tq->id, GL_QUERY_RESULT_AVAILABLE_ARB, &available));
checkGLcall("glGetQueryObjectuivARB(GL_QUERY_RESULT_AVAILABLE)");
GL_EXTCALL(glGetQueryObjectuiv(tq->id, GL_QUERY_RESULT_AVAILABLE, &available));
checkGLcall("glGetQueryObjectuiv(GL_QUERY_RESULT_AVAILABLE)");
TRACE("available %#x.\n", available);
if (available)
{
if (size)
{
GL_EXTCALL(glGetQueryObjectui64v(tq->id, GL_QUERY_RESULT_ARB, &timestamp));
checkGLcall("glGetQueryObjectuivARB(GL_QUERY_RESULT)");
GL_EXTCALL(glGetQueryObjectui64v(tq->id, GL_QUERY_RESULT, &timestamp));
checkGLcall("glGetQueryObjectui64v(GL_QUERY_RESULT)");
TRACE("Returning timestamp %s.\n", wine_dbgstr_longlong(timestamp));
fill_query_data(data, size, &timestamp, sizeof(timestamp));
}
......
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