summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/svga/svga_context.h1
-rw-r--r--src/gallium/drivers/svga/svga_state_framebuffer.c6
-rw-r--r--src/gallium/drivers/svga/svga_surface.c8
3 files changed, 15 insertions, 0 deletions
diff --git a/src/gallium/drivers/svga/svga_context.h b/src/gallium/drivers/svga/svga_context.h
index 2b95a787870..3789a46bf50 100644
--- a/src/gallium/drivers/svga/svga_context.h
+++ b/src/gallium/drivers/svga/svga_context.h
@@ -401,6 +401,7 @@ struct svga_hw_draw_state
unsigned default_constbuf_size[PIPE_SHADER_TYPES];
boolean rasterizer_discard; /* set if rasterization is disabled */
+ boolean has_backed_views; /* set if any of the rtv/dsv is a backed surface view */
};
diff --git a/src/gallium/drivers/svga/svga_state_framebuffer.c b/src/gallium/drivers/svga/svga_state_framebuffer.c
index b2b037ddd7f..e76b1da6aa5 100644
--- a/src/gallium/drivers/svga/svga_state_framebuffer.c
+++ b/src/gallium/drivers/svga/svga_state_framebuffer.c
@@ -174,6 +174,12 @@ emit_fb_vgpu10(struct svga_context *svga)
assert(svga_have_vgpu10(svga));
+ /* Reset the has_backed_views flag.
+ * The flag is set in svga_validate_surface_view() if
+ * a backed surface view is used.
+ */
+ svga->state.hw_draw.has_backed_views = FALSE;
+
/* Setup render targets array. Note that we loop over the max of the
* number of previously bound buffers and the new buffers to unbind
* any previously bound buffers when the new number of buffers is less
diff --git a/src/gallium/drivers/svga/svga_surface.c b/src/gallium/drivers/svga/svga_surface.c
index ef566c4e255..d9c1e2502fb 100644
--- a/src/gallium/drivers/svga/svga_surface.c
+++ b/src/gallium/drivers/svga/svga_surface.c
@@ -428,6 +428,10 @@ svga_validate_surface_view(struct svga_context *svga, struct svga_surface *s)
"same resource used in shaderResource and renderTarget 0x%x\n",
s->handle);
s = create_backed_surface_view(svga, s);
+
+ if (s)
+ svga->state.hw_draw.has_backed_views = TRUE;
+
/* s may be null here if the function failed */
break;
}
@@ -678,6 +682,10 @@ svga_propagate_rendertargets(struct svga_context *svga)
{
unsigned i;
+ /* Early exit if there is no backing texture views in use */
+ if (!svga->state.hw_draw.has_backed_views)
+ return;
+
/* Note that we examine the svga->state.hw_draw.framebuffer surfaces,
* not the svga->curr.framebuffer surfaces, because it's the former
* surfaces which may be backing surface views (the actual render targets).