summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/svga/svga_pipe_blit.c
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom@vmware.com>2017-04-12 10:38:23 +0200
committerThomas Hellstrom <thellstrom@vmware.com>2017-06-16 08:40:26 +0200
commit4c3e8f141b6a7e82d91e64b87c0b63f2b12cc437 (patch)
treeb85e46e79b94722918c388ae0603e5d2f4c0f9d3 /src/gallium/drivers/svga/svga_pipe_blit.c
parent71f857d6ab504c4e355b2fcaf36b66426e6061ab (diff)
svga: Support accelerated conditional blitting
The blitter has functions to save and restore the conditional rendering state, but we currently don't save the needed info. Since also the copy_region_vgpu10 path supports conditional blitting, we instead use the same function as the clearing routines and move that function to svga_pipe_query.c Note that we still haven't implemented conditional blitting with the software fallbacks. Fixes piglit nv_conditional_render::copyteximage Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Diffstat (limited to 'src/gallium/drivers/svga/svga_pipe_blit.c')
-rw-r--r--src/gallium/drivers/svga/svga_pipe_blit.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/gallium/drivers/svga/svga_pipe_blit.c b/src/gallium/drivers/svga/svga_pipe_blit.c
index 13788fd59c1..3d7196dddd2 100644
--- a/src/gallium/drivers/svga/svga_pipe_blit.c
+++ b/src/gallium/drivers/svga/svga_pipe_blit.c
@@ -286,9 +286,6 @@ can_blit_via_svga_copy_region(struct svga_context *svga,
blit_info->mask != (PIPE_MASK_ZS))
return false;
- if (svga->render_condition && blit_info->render_condition_enable)
- return false;
-
return check_blending_and_srgb_cond(svga, blit_info);
}
@@ -334,6 +331,9 @@ can_blit_via_surface_copy(struct svga_context *svga,
{
struct svga_texture *dtex, *stex;
+ if (svga->render_condition && blit_info->render_condition_enable)
+ return false;
+
/* can't copy between different resource types */
if (svga_resource_type(blit_info->src.resource->target) !=
svga_resource_type(blit_info->dst.resource->target))
@@ -372,6 +372,8 @@ try_copy_region(struct svga_context *svga,
&dst_face, &dst_z);
if (can_blit_via_copy_region_vgpu10(svga, blit)) {
+ svga_toggle_render_condition(svga, blit->render_condition_enable, FALSE);
+
copy_region_vgpu10(svga,
blit->src.resource,
blit->src.box.x, blit->src.box.y, src_z,
@@ -381,6 +383,9 @@ try_copy_region(struct svga_context *svga,
blit->dst.level, dst_face,
blit->src.box.width, blit->src.box.height,
blit->src.box.depth);
+
+ svga_toggle_render_condition(svga, blit->render_condition_enable, TRUE);
+
return true;
}
@@ -511,8 +516,6 @@ try_blit(struct svga_context *svga, const struct pipe_blit_info *blit_info)
util_blitter_save_fragment_sampler_views(svga->blitter,
svga->curr.num_sampler_views[PIPE_SHADER_FRAGMENT],
svga->curr.sampler_views[PIPE_SHADER_FRAGMENT]);
- /*util_blitter_save_render_condition(svga->blitter, svga->render_cond_query,
- svga->render_cond_cond, svga->render_cond_mode);*/
if (!can_create_src_view) {
struct pipe_resource template;
@@ -574,8 +577,12 @@ try_blit(struct svga_context *svga, const struct pipe_blit_info *blit_info)
blit.dst.resource = newDst;
}
+ svga_toggle_render_condition(svga, blit.render_condition_enable, FALSE);
+
util_blitter_blit(svga->blitter, &blit);
+ svga_toggle_render_condition(svga, blit.render_condition_enable, TRUE);
+
if (blit.dst.resource != dst) {
struct pipe_blit_info copy_region_blit;
@@ -619,6 +626,13 @@ try_cpu_copy_region(struct svga_context *svga,
{
if (util_can_blit_via_copy_region(blit, TRUE) ||
util_can_blit_via_copy_region(blit, FALSE)) {
+
+ if (svga->render_condition && blit->render_condition_enable) {
+ debug_warning("CPU copy_region doesn't support "
+ "conditional rendering.\n");
+ return false;
+ }
+
copy_region_fallback(svga, blit->dst.resource,
blit->dst.level,
blit->dst.box.x, blit->dst.box.y,