gallium: add PIPE_CAP_CONDITIONAL_RENDER
authorMarek Olšák <maraeo@gmail.com>
Tue, 27 Sep 2011 21:08:04 +0000 (23:08 +0200)
committerMarek Olšák <maraeo@gmail.com>
Fri, 30 Sep 2011 21:19:52 +0000 (23:19 +0200)
We were checking whether render_condition is set. That was not reliable,
because it's always set with trace and noop regardless of driver support.

Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/drivers/nv50/nv50_screen.c
src/gallium/drivers/nvc0/nvc0_screen.c
src/gallium/drivers/r300/r300_screen.c
src/gallium/drivers/r600/r600_pipe.c
src/gallium/drivers/softpipe/sp_screen.c
src/gallium/include/pipe/p_defines.h
src/gallium/state_trackers/d3d1x/gd3d11/d3d11_context.h
src/mesa/state_tracker/st_extensions.c

index bd405a78f871094ce57a9b6b7be9d52d6b3e4c42..d3fdd55664ab31d8fd431cfb3c662334d723180a 100644 (file)
@@ -136,6 +136,7 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_TGSI_INSTANCEID:
    case PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR:
    case PIPE_CAP_MIXED_COLORBUFFER_FORMATS:
+   case PIPE_CAP_CONDITIONAL_RENDER:
       return 1;
    default:
       NOUVEAU_ERR("unknown PIPE_CAP %d\n", param);
index a28c7d76c072643833832101b471a6987d73c7c7..9b97f243ebf42ba4b326c961150e95c7b7f4de13 100644 (file)
@@ -124,6 +124,7 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_TGSI_INSTANCEID:
    case PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR:
    case PIPE_CAP_MIXED_COLORBUFFER_FORMATS:
+   case PIPE_CAP_CONDITIONAL_RENDER:
       return 1;
    default:
       NOUVEAU_ERR("unknown PIPE_CAP %d\n", param);
index deb14287df9c71a33d04cd87c997e8ee671988d1..7699ed60b83bf4371497e025b4503b6ca027ebf1 100644 (file)
@@ -114,6 +114,7 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
         case PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR:
         case PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT:
         case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER:
+        case PIPE_CAP_CONDITIONAL_RENDER:
             return 1;
 
         /* r300 cannot do swizzling of compressed textures. Supported otherwise. */
index 25e7c43f4dcbced22c4483c0f0c696e78cf4205d..ec0d58a06669b4dd51d037e6e199ee8d49a08110 100644 (file)
@@ -359,6 +359,7 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_SEAMLESS_CUBE_MAP:
        case PIPE_CAP_FRAGMENT_COLOR_CLAMP_CONTROL:
        case PIPE_CAP_PRIMITIVE_RESTART:
+       case PIPE_CAP_CONDITIONAL_RENDER:
                return 1;
 
        /* Supported except the original R600. */
index 24852a539764a398822c52a521a8b9e029d8e644..485104942ef7c14c2c4e7fc1e7344e8721532ec2 100644 (file)
@@ -124,6 +124,8 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
       return -8;
    case PIPE_CAP_MAX_TEXEL_OFFSET:
       return 7;
+   case PIPE_CAP_CONDITIONAL_RENDER:
+      return 1;
    default:
       return 0;
    }
index 950672c917129a67ff329b78c4e34ea584cacd3f..d87c1a08240a59aa4902680571fc15c6a35505a4 100644 (file)
@@ -470,7 +470,8 @@ enum pipe_cap {
    PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE = 48,
    PIPE_CAP_SCALED_RESOLVE = 49,
    PIPE_CAP_MIN_TEXEL_OFFSET = 50,
-   PIPE_CAP_MAX_TEXEL_OFFSET = 51
+   PIPE_CAP_MAX_TEXEL_OFFSET = 51,
+   PIPE_CAP_CONDITIONAL_RENDER = 52
 };
 
 /* Shader caps not specific to any single stage */
index 6514146e367906ee0b27680bde9906f265fb8f19..2ab320ab3319858dbe1eeb24e759c3c15100c1cb 100644 (file)
@@ -150,7 +150,7 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl<threadsafe>
        {
                if(!pipe->begin_query)
                        caps.queries = false;
-               if(!pipe->render_condition)
+               if(!pipe->render_condition || !screen->get_param(screen, PIPE_CAP_CONDITIONAL_RENDER))
                        caps.render_condition = false;
                if(!pipe->bind_gs_state)
                {
index 2be191cc10e48c3103466f63307c765ac7be9b51..7be3f4077abf97fba6d0a5c33bfd678220a2c7e1 100644 (file)
@@ -501,7 +501,7 @@ void st_init_extensions(struct st_context *st)
       ctx->Extensions.ARB_framebuffer_object = GL_TRUE;
    }
 
-   if (st->pipe->render_condition) {
+   if (screen->get_param(screen, PIPE_CAP_CONDITIONAL_RENDER)) {
       ctx->Extensions.NV_conditional_render = GL_TRUE;
    }