aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/queryobj.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-08-27 08:17:50 +0200
committermarha <marha@users.sourceforge.net>2012-08-27 08:17:50 +0200
commitb3462c12542a69eeaa3fe90fddfbb15d30c18158 (patch)
tree294230cca0e59ee250cd70060ba3f8c3742b4023 /mesalib/src/mesa/main/queryobj.c
parente91ed68959d63f79e3b4973bc80c7ebcd07ed021 (diff)
downloadvcxsrv-b3462c12542a69eeaa3fe90fddfbb15d30c18158.tar.gz
vcxsrv-b3462c12542a69eeaa3fe90fddfbb15d30c18158.tar.bz2
vcxsrv-b3462c12542a69eeaa3fe90fddfbb15d30c18158.zip
xwininfo fontconfig libX11 libXau libXext libxcb mesa pixman
xkeyboard-config git update 27 Aug 2012
Diffstat (limited to 'mesalib/src/mesa/main/queryobj.c')
-rw-r--r--mesalib/src/mesa/main/queryobj.c37
1 files changed, 36 insertions, 1 deletions
diff --git a/mesalib/src/mesa/main/queryobj.c b/mesalib/src/mesa/main/queryobj.c
index 4492a172b..407a761e6 100644
--- a/mesalib/src/mesa/main/queryobj.c
+++ b/mesalib/src/mesa/main/queryobj.c
@@ -482,7 +482,36 @@ _mesa_GetQueryIndexediv(GLenum target, GLuint index, GLenum pname,
switch (pname) {
case GL_QUERY_COUNTER_BITS_ARB:
- *params = 8 * sizeof(q->Result);
+ switch (target) {
+ case GL_SAMPLES_PASSED:
+ *params = ctx->Const.QueryCounterBits.SamplesPassed;
+ break;
+ case GL_ANY_SAMPLES_PASSED:
+ /* The minimum value of this is 1 if it's nonzero, and the value
+ * is only ever GL_TRUE or GL_FALSE, so no sense in reporting more
+ * bits.
+ */
+ *params = 1;
+ break;
+ case GL_TIME_ELAPSED:
+ *params = ctx->Const.QueryCounterBits.TimeElapsed;
+ break;
+ case GL_TIMESTAMP:
+ *params = ctx->Const.QueryCounterBits.Timestamp;
+ break;
+ case GL_PRIMITIVES_GENERATED:
+ *params = ctx->Const.QueryCounterBits.PrimitivesGenerated;
+ break;
+ case GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:
+ *params = ctx->Const.QueryCounterBits.PrimitivesWritten;
+ break;
+ default:
+ _mesa_problem(ctx,
+ "Unknown target in glGetQueryIndexediv(target = %s)",
+ _mesa_lookup_enum_by_nr(target));
+ *params = 0;
+ break;
+ }
break;
case GL_CURRENT_QUERY_ARB:
*params = q ? q->Id : 0;
@@ -716,6 +745,12 @@ _mesa_init_queryobj(struct gl_context *ctx)
{
ctx->Query.QueryObjects = _mesa_NewHashTable();
ctx->Query.CurrentOcclusionObject = NULL;
+
+ ctx->Const.QueryCounterBits.SamplesPassed = 64;
+ ctx->Const.QueryCounterBits.TimeElapsed = 64;
+ ctx->Const.QueryCounterBits.Timestamp = 64;
+ ctx->Const.QueryCounterBits.PrimitivesGenerated = 64;
+ ctx->Const.QueryCounterBits.PrimitivesWritten = 64;
}