i965: Add support for NV_conditional_render.
authorEric Anholt <eric@anholt.net>
Wed, 20 Apr 2011 04:40:48 +0000 (21:40 -0700)
committerEric Anholt <eric@anholt.net>
Sat, 23 Apr 2011 20:21:57 +0000 (13:21 -0700)
Since we lack hardware support for it, this is a simple matter of
checking _mesa_check_conditional_render at the entrypoints, and
suppressing it for the metaops where it doesn't apply.

Reviewed-by: Brian Paul <brianp@vmware.com>
docs/GL3.txt
docs/relnotes-7.11.html
src/mesa/drivers/dri/i965/brw_draw.c
src/mesa/drivers/dri/intel/intel_clear.c
src/mesa/drivers/dri/intel/intel_extensions.c
src/mesa/drivers/dri/intel/intel_pixel_bitmap.c
src/mesa/drivers/dri/intel/intel_pixel_copy.c

index 6eeb9e4f35f37befb1e3a96b4992d851848e9a99..c4e6059e6867f7043a954af1148fd23a93b4ed30 100644 (file)
@@ -13,7 +13,7 @@ Feature                                               Status
 GL 3.0:
 
 GLSL 1.30 (GL_EXT_gpu_shader4, etc.)                  started
-Conditional rendering (GL_NV_conditional_render)      DONE (swrast & softpipe)
+Conditional rendering (GL_NV_conditional_render)      DONE (swrast, softpipe, i965)
 Map buffer subranges (GL_ARB_map_buffer_range)        DONE
 Clamping controls (GL_ARB_color_buffer_float)         DONE
 Float textures, renderbuffers (GL_ARB_texture_float)  DONE (gallium r300)
index d223a0a0de976a4f7bd7b378995051213796d186..b57fe9bb5a7258c72ef81f86924df4cc140d17bb 100644 (file)
@@ -51,6 +51,7 @@ tbd
 <li>GL_ATI_draw_buffers (all drivers)
 <li>GL_ATI_texture_compression_3dc (gallium drivers, swrast)
 <li>GL_ATI_texture_float (gallium, i965)
+<li>GL_NV_conditional_render (i965)
 <li>GL_NV_texture_barrier (gallium drivers)
 </ul>
 
index 2db70c543eaa4f18944cd0d0a45884e9190be13f..4dd0c8203dd0ea6589b8b242eaf36e8b0863d806 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "main/glheader.h"
 #include "main/context.h"
+#include "main/condrender.h"
 #include "main/state.h"
 #include "main/enums.h"
 #include "tnl/tnl.h"
@@ -438,6 +439,9 @@ void brw_draw_prims( struct gl_context *ctx,
 {
    GLboolean retval;
 
+   if (!_mesa_check_conditional_render(ctx))
+      return;
+
    if (!vbo_all_varyings_in_vbos(arrays)) {
       if (!index_bounds_valid)
         vbo_get_minmax_index(ctx, prim, ib, &min_index, &max_index);
index 82d29e76712b0c94f6caafa5cfa059e6f848054e..5a96232107e5c9b012b93acf0393f2d420a9d8c3 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "main/glheader.h"
 #include "main/mtypes.h"
+#include "main/condrender.h"
 #include "swrast/swrast.h"
 #include "drivers/common/meta.h"
 
@@ -88,6 +89,9 @@ intelClear(struct gl_context *ctx, GLbitfield mask)
    struct intel_renderbuffer *irb;
    int i;
 
+   if (!_mesa_check_conditional_render(ctx))
+      return;
+
    if (mask & (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_FRONT_RIGHT)) {
       intel->front_buffer_dirty = GL_TRUE;
    }
index 6a818577a556dc5a736c0888e59302e180f7e3c4..c24bc99f9048b0087a8c1c3a7671ec6788a93b0e 100644 (file)
@@ -190,6 +190,7 @@ static const struct dri_extension brw_extensions[] = {
    { "GL_ATI_envmap_bumpmap",             GL_ATI_envmap_bumpmap_functions },
    { "GL_ATI_separate_stencil",           GL_ATI_separate_stencil_functions },
    { "GL_ATI_texture_env_combine3",       NULL },
+   { "GL_NV_conditional_render",          NULL },
    { "GL_NV_texture_env_combine4",        NULL },
    { NULL,                                NULL }
 };
index 43cdd0d2bac5b74c3a58c820df936aac7f0e0ff9..0012f19db1c273d78fd7fc4cc06c3072db1a327c 100644 (file)
@@ -29,6 +29,7 @@
 #include "main/enums.h"
 #include "main/image.h"
 #include "main/colormac.h"
+#include "main/condrender.h"
 #include "main/mtypes.h"
 #include "main/macros.h"
 #include "main/pbo.h"
@@ -329,6 +330,9 @@ intelBitmap(struct gl_context * ctx,
 {
    struct intel_context *intel = intel_context(ctx);
 
+   if (!_mesa_check_conditional_render(ctx))
+      return;
+
    if (do_blit_bitmap(ctx, x, y, width, height,
                           unpack, pixels))
       return;
index a7ca780e944021899142479a5d466662a3efb07d..e83f1bfab949717f819a1bf1236e4f95707bf8a0 100644 (file)
@@ -29,6 +29,7 @@
 #include "main/image.h"
 #include "main/state.h"
 #include "main/mtypes.h"
+#include "main/condrender.h"
 #include "drivers/common/meta.h"
 
 #include "intel_context.h"
@@ -204,6 +205,9 @@ intelCopyPixels(struct gl_context * ctx,
 {
    DBG("%s\n", __FUNCTION__);
 
+   if (!_mesa_check_conditional_render(ctx))
+      return;
+
    if (do_blit_copypixels(ctx, srcx, srcy, width, height, destx, desty, type))
       return;