q->Id = id;
q->Result = 0;
q->Active = GL_FALSE;
- q->Ready = GL_TRUE; /* correct, see spec */
+
+ /* This is to satisfy the language of the specification: "In the initial
+ * state of a query object, the result is available" (OpenGL 3.1 ยง
+ * 2.13).
+ */
+ q->Ready = GL_TRUE;
}
return q;
}
return &ctx->Query.CurrentOcclusionObject;
else
return NULL;
+ case GL_ANY_SAMPLES_PASSED_CONSERVATIVE:
+ if (ctx->Extensions.ARB_ES3_compatibility
+ || (ctx->API == API_OPENGLES2 && ctx->Version >= 30))
+ return &ctx->Query.CurrentOcclusionObject;
+ else
+ return NULL;
case GL_TIME_ELAPSED_EXT:
if (ctx->Extensions.EXT_timer_query)
return &ctx->Query.CurrentTimerObject;
void GLAPIENTRY
-_mesa_GenQueriesARB(GLsizei n, GLuint *ids)
+_mesa_GenQueries(GLsizei n, GLuint *ids)
{
GLuint first;
GET_CURRENT_CONTEXT(ctx);
void GLAPIENTRY
-_mesa_DeleteQueriesARB(GLsizei n, const GLuint *ids)
+_mesa_DeleteQueries(GLsizei n, const GLuint *ids)
{
GLint i;
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glDeleeteQueries(%d)\n", n);
+ _mesa_debug(ctx, "glDeleteQueries(%d)\n", n);
if (n < 0) {
_mesa_error(ctx, GL_INVALID_VALUE, "glDeleteQueriesARB(n < 0)");
GLboolean GLAPIENTRY
-_mesa_IsQueryARB(GLuint id)
+_mesa_IsQuery(GLuint id)
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
q = _mesa_lookup_query_object(ctx, id);
if (!q) {
- if (ctx->API == API_OPENGL_CORE) {
+ if (ctx->API != API_OPENGL_COMPAT) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glBeginQuery{Indexed}(non-gen name)");
return;
}
void GLAPIENTRY
-_mesa_BeginQueryARB(GLenum target, GLuint id)
+_mesa_BeginQuery(GLenum target, GLuint id)
{
_mesa_BeginQueryIndexed(target, 0, id);
}
void GLAPIENTRY
-_mesa_EndQueryARB(GLenum target)
+_mesa_EndQuery(GLenum target)
{
_mesa_EndQueryIndexed(target, 0);
}
}
void GLAPIENTRY
-_mesa_GetQueryivARB(GLenum target, GLenum pname, GLint *params)
+_mesa_GetQueryiv(GLenum target, GLenum pname, GLint *params)
{
_mesa_GetQueryIndexediv(target, 0, pname, params);
}
void GLAPIENTRY
-_mesa_GetQueryObjectivARB(GLuint id, GLenum pname, GLint *params)
+_mesa_GetQueryObjectiv(GLuint id, GLenum pname, GLint *params)
{
struct gl_query_object *q = NULL;
GET_CURRENT_CONTEXT(ctx);
if (!q->Ready)
ctx->Driver.WaitQuery(ctx, q);
/* if result is too large for returned type, clamp to max value */
- if (q->Target == GL_ANY_SAMPLES_PASSED) {
+ if (q->Target == GL_ANY_SAMPLES_PASSED
+ || q->Target == GL_ANY_SAMPLES_PASSED_CONSERVATIVE) {
if (q->Result)
*params = GL_TRUE;
else
void GLAPIENTRY
-_mesa_GetQueryObjectuivARB(GLuint id, GLenum pname, GLuint *params)
+_mesa_GetQueryObjectuiv(GLuint id, GLenum pname, GLuint *params)
{
struct gl_query_object *q = NULL;
GET_CURRENT_CONTEXT(ctx);
if (!q->Ready)
ctx->Driver.WaitQuery(ctx, q);
/* if result is too large for returned type, clamp to max value */
- if (q->Target == GL_ANY_SAMPLES_PASSED) {
+ if (q->Target == GL_ANY_SAMPLES_PASSED
+ || q->Target == GL_ANY_SAMPLES_PASSED_CONSERVATIVE) {
if (q->Result)
*params = GL_TRUE;
else
* New with GL_EXT_timer_query
*/
void GLAPIENTRY
-_mesa_GetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64EXT *params)
+_mesa_GetQueryObjecti64v(GLuint id, GLenum pname, GLint64EXT *params)
{
struct gl_query_object *q = NULL;
GET_CURRENT_CONTEXT(ctx);
* New with GL_EXT_timer_query
*/
void GLAPIENTRY
-_mesa_GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT *params)
+_mesa_GetQueryObjectui64v(GLuint id, GLenum pname, GLuint64EXT *params)
{
struct gl_query_object *q = NULL;
GET_CURRENT_CONTEXT(ctx);
_mesa_init_queryobj_dispatch(const struct gl_context *ctx,
struct _glapi_table *disp)
{
- SET_GenQueriesARB(disp, _mesa_GenQueriesARB);
- SET_DeleteQueriesARB(disp, _mesa_DeleteQueriesARB);
- SET_IsQueryARB(disp, _mesa_IsQueryARB);
- SET_BeginQueryARB(disp, _mesa_BeginQueryARB);
- SET_EndQueryARB(disp, _mesa_EndQueryARB);
- SET_GetQueryivARB(disp, _mesa_GetQueryivARB);
- SET_GetQueryObjectuivARB(disp, _mesa_GetQueryObjectuivARB);
+ SET_GenQueries(disp, _mesa_GenQueries);
+ SET_DeleteQueries(disp, _mesa_DeleteQueries);
+ SET_IsQuery(disp, _mesa_IsQuery);
+ SET_BeginQuery(disp, _mesa_BeginQuery);
+ SET_EndQuery(disp, _mesa_EndQuery);
+ SET_GetQueryiv(disp, _mesa_GetQueryiv);
+ SET_GetQueryObjectuiv(disp, _mesa_GetQueryObjectuiv);
if (_mesa_is_desktop_gl(ctx)) {
- SET_GetQueryObjectivARB(disp, _mesa_GetQueryObjectivARB);
+ SET_GetQueryObjectiv(disp, _mesa_GetQueryObjectiv);
SET_QueryCounter(disp, _mesa_QueryCounter);
- SET_GetQueryObjecti64vEXT(disp, _mesa_GetQueryObjecti64vEXT);
- SET_GetQueryObjectui64vEXT(disp, _mesa_GetQueryObjectui64vEXT);
+ SET_GetQueryObjecti64v(disp, _mesa_GetQueryObjecti64v);
+ SET_GetQueryObjectui64v(disp, _mesa_GetQueryObjectui64v);
SET_BeginQueryIndexed(disp, _mesa_BeginQueryIndexed);
SET_EndQueryIndexed(disp, _mesa_EndQueryIndexed);