struct gl_query_object *CondRenderQuery;
/** GL_EXT_transform_feedback */
- struct gl_query_object *PrimitivesGenerated;
- struct gl_query_object *PrimitivesWritten;
+ struct gl_query_object *PrimitivesGenerated[MAX_VERTEX_STREAMS];
+ struct gl_query_object *PrimitivesWritten[MAX_VERTEX_STREAMS];
/** GL_ARB_timer_query */
struct gl_query_object *TimeElapsed;
/**
- * Return pointer to the query object binding point for the given target.
+ * Return pointer to the query object binding point for the given target and
+ * index.
* \return NULL if invalid target, else the address of binding point
*/
static struct gl_query_object **
-get_query_binding_point(struct gl_context *ctx, GLenum target)
+get_query_binding_point(struct gl_context *ctx, GLenum target, GLuint index)
{
switch (target) {
case GL_SAMPLES_PASSED_ARB:
return NULL;
case GL_PRIMITIVES_GENERATED:
if (ctx->Extensions.EXT_transform_feedback)
- return &ctx->Query.PrimitivesGenerated;
+ return &ctx->Query.PrimitivesGenerated[index];
else
return NULL;
case GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:
if (ctx->Extensions.EXT_transform_feedback)
- return &ctx->Query.PrimitivesWritten;
+ return &ctx->Query.PrimitivesWritten[index];
else
return NULL;
default:
if (q) {
if (q->Active) {
struct gl_query_object **bindpt;
- bindpt = get_query_binding_point(ctx, q->Target);
+ bindpt = get_query_binding_point(ctx, q->Target, q->Stream);
assert(bindpt); /* Should be non-null for active q. */
if (bindpt) {
*bindpt = NULL;
FLUSH_VERTICES(ctx, 0);
- bindpt = get_query_binding_point(ctx, target);
+ bindpt = get_query_binding_point(ctx, target, index);
if (!bindpt) {
_mesa_error(ctx, GL_INVALID_ENUM, "glBeginQuery{Indexed}(target)");
return;
FLUSH_VERTICES(ctx, 0);
- bindpt = get_query_binding_point(ctx, target);
+ bindpt = get_query_binding_point(ctx, target, index);
if (!bindpt) {
_mesa_error(ctx, GL_INVALID_ENUM, "glEndQuery{Indexed}(target)");
return;
}
}
else {
- bindpt = get_query_binding_point(ctx, target);
+ bindpt = get_query_binding_point(ctx, target, index);
if (!bindpt) {
_mesa_error(ctx, GL_INVALID_ENUM, "glGetQuery{Indexed}iv(target)");
return;