svga: Add render_condition boolean flag in struct svga_context
authorNeha Bhende <bhenden@vmware.com>
Wed, 28 Sep 2016 17:48:45 +0000 (10:48 -0700)
committerBrian Paul <brianp@vmware.com>
Thu, 3 Nov 2016 20:29:22 +0000 (14:29 -0600)
set render_condition flag when driver performs conditional rendering.
Blit using DXPredCopyRegion command gets affected by conditional rendering so
We should check this flag while performing blit operation

Tested with piglit tests.

v2: As per Charmaine's comment, setting render_condition flag if svga_query is valid.
Tested with pigit tests.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
src/gallium/drivers/svga/svga_context.h
src/gallium/drivers/svga/svga_pipe_blit.c
src/gallium/drivers/svga/svga_pipe_query.c

index 3e65384a07a2c458c67f91faa70323edca613872..5eb7fc8718760ce246406f5d272ade9c8ad0a090 100644 (file)
@@ -589,6 +589,8 @@ struct svga_context
       SVGA3dQueryId query_id;
       boolean cond;
    } pred;
+
+   boolean render_condition;
 };
 
 /* A flag for each state_tracker state object:
index 75576f2d72c2775472f92ba84a2d9cd506800ab4..054e3f5a1c0170cae29c67a1e71effc4280ea86e 100644 (file)
@@ -265,7 +265,8 @@ can_blit_via_copy_region_vgpu10(struct svga_context *svga,
       blit_info->mask != (PIPE_MASK_ZS))
      return false;
 
-   if (blit_info->alpha_blend || blit_info->render_condition_enable ||
+   if (blit_info->alpha_blend ||
+       (svga->render_condition && blit_info->render_condition_enable) ||
        blit_info->scissor_enable)
       return false;
 
index a7bfb4ea265d06a5efb6854f3897b358948b2bc8..e8bae264cf15681fd714eb006cc81c21d25d7d3f 100644 (file)
@@ -1242,6 +1242,8 @@ svga_render_condition(struct pipe_context *pipe, struct pipe_query *q,
       svga->pred.query_id = queryId;
       svga->pred.cond = condition;
    }
+
+   svga->render_condition = (sq != NULL);
 }