summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2012-10-31 15:36:27 -0700
committerEric Anholt <[email protected]>2012-11-04 12:28:36 -0800
commit4fce0230fc3528be32562410bcddfc887c4d25a0 (patch)
tree3297f605461820f26f2bbb7702b38edfbb5139bb /src
parent947d8ff4a7c4b7ffb4013056b48dbabe6b3931b0 (diff)
mesa: Fix core GL genned-name handling for glBeginQuery().
Fixes piglit gl-3.1/genned-names. NOTE: This is a candidate for the 9.0 branch. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/queryobj.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
index d21691328e7..1e39adc49d2 100644
--- a/src/mesa/main/queryobj.c
+++ b/src/mesa/main/queryobj.c
@@ -321,13 +321,19 @@ _mesa_BeginQueryIndexed(GLenum target, GLuint index, GLuint id)
q = _mesa_lookup_query_object(ctx, id);
if (!q) {
- /* create new object */
- q = ctx->Driver.NewQueryObject(ctx, id);
- if (!q) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBeginQuery{Indexed}");
+ if (ctx->API == API_OPENGL_CORE) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glBeginQuery{Indexed}(non-gen name)");
return;
+ } else {
+ /* create new object */
+ q = ctx->Driver.NewQueryObject(ctx, id);
+ if (!q) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBeginQuery{Indexed}");
+ return;
+ }
+ _mesa_HashInsert(ctx->Query.QueryObjects, id, q);
}
- _mesa_HashInsert(ctx->Query.QueryObjects, id, q);
}
else {
/* pre-existing object */