Mesa (master): r300: enable ARB_occlusion_query

Maciej Cencora osiris at kemper.freedesktop.org
Sun Aug 16 00:13:50 UTC 2009


Module: Mesa
Branch: master
Commit: 60587182d4ade36df75ee13edf8df6b529fbb0f1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=60587182d4ade36df75ee13edf8df6b529fbb0f1

Author: Maciej Cencora <m.cencora at gmail.com>
Date:   Thu Jun 11 16:11:47 2009 +0200

r300: enable ARB_occlusion_query

Supported only on HW with TCL block and with proper radeon drm.
Required minimum radeon drm version is 1.30 or KMS.

---

 src/mesa/drivers/dri/r300/r300_context.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c
index d37a37c..91fa77a 100644
--- a/src/mesa/drivers/dri/r300/r300_context.c
+++ b/src/mesa/drivers/dri/r300/r300_context.c
@@ -64,6 +64,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "r300_ioctl.h"
 #include "r300_tex.h"
 #include "r300_emit.h"
+#include "r300_queryobj.h"
 #include "r300_swtcl.h"
 #include "radeon_bocs_wrapper.h"
 #include "radeon_buffer_objects.h"
@@ -95,6 +96,7 @@ const struct dri_extension card_extensions[] = {
   /* *INDENT-OFF* */
   {"GL_ARB_depth_texture",		NULL},
   {"GL_ARB_fragment_program",		NULL},
+  {"GL_ARB_occlusion_query",		GL_ARB_occlusion_query_functions},
   {"GL_ARB_multitexture",		NULL},
   {"GL_ARB_point_parameters",		GL_ARB_point_parameters_functions},
   {"GL_ARB_shadow",			NULL},
@@ -358,6 +360,11 @@ static void r300InitGLExtensions(GLcontext *ctx)
 	} else if (r300->options.s3tc_force_disabled) {
 		_mesa_disable_extension(ctx, "GL_EXT_texture_compression_s3tc");
 	}
+
+	if (!r300->radeon.radeonScreen->drmSupportsOcclusionQueries ||
+		!r300->options.hw_tcl_enabled) {
+		_mesa_disable_extension(ctx, "GL_ARB_occlusion_query");
+	}
 }
 
 /* Create the device specific rendering context.
@@ -389,6 +396,7 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual,
 	r300InitStateFuncs(&functions);
 	r300InitTextureFuncs(&functions);
 	r300InitShaderFuncs(&functions);
+	r300InitQueryObjFunctions(&functions);
 	radeonInitBufferObjectFuncs(&functions);
 
 	if (!radeonInitContext(&r300->radeon, &functions,




More information about the mesa-commit mailing list