aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/queryobj.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2015-03-05 23:40:39 +0100
committermarha <marha@users.sourceforge.net>2015-03-05 23:42:09 +0100
commitc646056120fe14e4c4ccf81bac5d78d61225a8e8 (patch)
treeba0af42750f0ab6dc4724342a7063835636222b5 /mesalib/src/mesa/main/queryobj.c
parent87e58a93f7248171e736656080069cb65ff56aae (diff)
parent8574eba804031f6b19713f0b02952280730bf62e (diff)
downloadvcxsrv-c646056120fe14e4c4ccf81bac5d78d61225a8e8.tar.gz
vcxsrv-c646056120fe14e4c4ccf81bac5d78d61225a8e8.tar.bz2
vcxsrv-c646056120fe14e4c4ccf81bac5d78d61225a8e8.zip
Merge remote-tracking branch 'origin/released'
Conflicts: mesalib/src/mesa/drivers/dri/swrast/swrast.c mesalib/src/mesa/main/.gitignore mesalib/src/mesa/main/queryobj.c
Diffstat (limited to 'mesalib/src/mesa/main/queryobj.c')
-rwxr-xr-x[-rw-r--r--]mesalib/src/mesa/main/queryobj.c31
1 files changed, 24 insertions, 7 deletions
diff --git a/mesalib/src/mesa/main/queryobj.c b/mesalib/src/mesa/main/queryobj.c
index 39c70535a..9ecc7d3b5 100644..100755
--- a/mesalib/src/mesa/main/queryobj.c
+++ b/mesalib/src/mesa/main/queryobj.c
@@ -146,12 +146,13 @@ static struct gl_query_object **
get_pipe_stats_binding_point(struct gl_context *ctx,
GLenum target)
{
- const int which = target - GL_VERTICES_SUBMITTED_ARB;
- if (!_mesa_is_desktop_gl(ctx) ||
+ const int which = target - GL_VERTICES_SUBMITTED_ARB;
+ assert(which < MAX_PIPELINE_STATISTICS);
+
+ if (!_mesa_is_desktop_gl(ctx) ||
!ctx->Extensions.ARB_pipeline_statistics_query)
return NULL;
- assert(which < MAX_PIPELINE_STATISTICS);
return &ctx->Query.pipeline_stats[which];
}
@@ -405,6 +406,22 @@ _mesa_BeginQueryIndexed(GLenum target, GLuint index, GLuint id)
"glBeginQuery{Indexed}(query already active)");
return;
}
+
+ /* Section 2.14 Asynchronous Queries, page 84 of the OpenGL ES 3.0.4
+ * spec states:
+ *
+ * "BeginQuery generates an INVALID_OPERATION error if any of the
+ * following conditions hold: [...] id is the name of an
+ * existing query object whose type does not match target; [...]
+ *
+ * Similar wording exists in the OpenGL 4.5 spec, section 4.2. QUERY
+ * OBJECTS AND ASYNCHRONOUS QUERIES, page 43.
+ */
+ if (q->EverBound && q->Target != target) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glBeginQuery{Indexed}(target mismatch)");
+ return;
+ }
}
q->Target = target;
@@ -666,7 +683,7 @@ _mesa_GetQueryObjectiv(GLuint id, GLenum pname, GLint *params)
if (id)
q = _mesa_lookup_query_object(ctx, id);
- if (!q || q->Active) {
+ if (!q || q->Active || !q->EverBound) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glGetQueryObjectivARB(id=%d is invalid or active)", id);
return;
@@ -717,7 +734,7 @@ _mesa_GetQueryObjectuiv(GLuint id, GLenum pname, GLuint *params)
if (id)
q = _mesa_lookup_query_object(ctx, id);
- if (!q || q->Active) {
+ if (!q || q->Active || !q->EverBound) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glGetQueryObjectuivARB(id=%d is invalid or active)", id);
return;
@@ -771,7 +788,7 @@ _mesa_GetQueryObjecti64v(GLuint id, GLenum pname, GLint64EXT *params)
if (id)
q = _mesa_lookup_query_object(ctx, id);
- if (!q || q->Active) {
+ if (!q || q->Active || !q->EverBound) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glGetQueryObjectui64vARB(id=%d is invalid or active)", id);
return;
@@ -811,7 +828,7 @@ _mesa_GetQueryObjectui64v(GLuint id, GLenum pname, GLuint64EXT *params)
if (id)
q = _mesa_lookup_query_object(ctx, id);
- if (!q || q->Active) {
+ if (!q || q->Active || !q->EverBound) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glGetQueryObjectuui64vARB(id=%d is invalid or active)", id);
return;