aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/queryobj.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/main/queryobj.c')
-rw-r--r--mesalib/src/mesa/main/queryobj.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/mesalib/src/mesa/main/queryobj.c b/mesalib/src/mesa/main/queryobj.c
index d21691328..1e39adc49 100644
--- a/mesalib/src/mesa/main/queryobj.c
+++ b/mesalib/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 */