summaryrefslogtreecommitdiff
path: root/src/mesa/main
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-07-13 09:25:57 -0600
committerBrian <brian.paul@tungstengraphics.com>2007-07-13 09:25:57 -0600
commit563479552e2f491fb94e7fac5772f3c72cee962a (patch)
treecc9d7617d45b14d3ff9e2b1517f64fd2b4079eeb /src/mesa/main
parent676fcf0de270651311a6b812e98f2e71d7dae925 (diff)
Added basic occlusion counting
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/queryobj.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
index 0e59ba615a..fc04dde3f4 100644
--- a/src/mesa/main/queryobj.c
+++ b/src/mesa/main/queryobj.c
@@ -30,6 +30,11 @@
#include "queryobj.h"
#include "mtypes.h"
+#if 1 /*PIPE*/
+#include "pipe/p_context.h"
+#include "state_tracker/st_context.h"
+#endif
+
/**
* Allocate a new query object. This is a fallback routine called via
@@ -220,6 +225,10 @@ _mesa_BeginQueryARB(GLenum target, GLuint id)
q->Result = 0;
q->Ready = GL_FALSE;
+#if 1 /*PIPE*/
+ ctx->st->pipe->reset_occlusion_counter(ctx->st->pipe);
+#endif
+
if (target == GL_SAMPLES_PASSED_ARB) {
ctx->Query.CurrentOcclusionObject = q;
}
@@ -282,6 +291,12 @@ _mesa_EndQueryARB(GLenum target)
/* if we're using software rendering/querying */
q->Ready = GL_TRUE;
}
+
+#if 1 /*PIPE*/
+ if (target == GL_SAMPLES_PASSED_ARB) {
+ q->Result = ctx->st->pipe->get_occlusion_counter(ctx->st->pipe);
+ }
+#endif
}