summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2012-10-31 15:36:27 -0700
committerAndreas Boll <[email protected]>2013-01-20 15:08:27 +0100
commit7e80685340dad7c76f72285c2f6c8268c413fbde (patch)
treec706b9af99f7f509d01141776d9cf4c84736dcbe /src
parente6174a9fd91071841d432a6e63523840b97e4e0e (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]> (cherry picked from commit 4fce0230fc3528be32562410bcddfc887c4d25a0)
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 407a761e6ee..b9310d084c4 100644
--- a/src/mesa/main/queryobj.c
+++ b/src/mesa/main/queryobj.c
@@ -313,13 +313,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 */