*/
void svga_surfaces_flush(struct svga_context *svga)
{
- struct svga_screen *svgascreen = svga_screen(svga->pipe.screen);
- unsigned i;
-
SVGA_STATS_TIME_PUSH(svga_sws(svga), SVGA_STATS_TIME_SURFACEFLUSH);
/* Emit buffered drawing commands.
*/
svga_hwtnl_flush_retry( svga );
- /* Emit back-copy from render target view to texture.
+ /* Emit back-copy from render target views to textures.
*/
- for (i = 0; i < svgascreen->max_color_buffers; i++) {
- if (svga->curr.framebuffer.cbufs[i])
- svga_propagate_surface(svga, svga->curr.framebuffer.cbufs[i]);
- }
-
- if (svga->curr.framebuffer.zsbuf)
- svga_propagate_surface(svga, svga->curr.framebuffer.zsbuf);
+ svga_propagate_rendertargets(svga);
SVGA_STATS_TIME_POP(svga_sws(svga));
}
}
+/**
+ * If any of the render targets are in backing texture views, propagate any
+ * changes to them back to the original texture.
+ */
+void
+svga_propagate_rendertargets(struct svga_context *svga)
+{
+ const unsigned num_cbufs = svga_screen(svga->pipe.screen)->max_color_buffers;
+ unsigned i;
+
+ for (i = 0; i < num_cbufs; i++) {
+ if (svga->curr.framebuffer.cbufs[i]) {
+ svga_propagate_surface(svga, svga->curr.framebuffer.cbufs[i]);
+ }
+ }
+
+ if (svga->curr.framebuffer.zsbuf) {
+ svga_propagate_surface(svga, svga->curr.framebuffer.zsbuf);
+ }
+}
+
+
/**
* Check if we should call svga_propagate_surface on the surface.
*/
extern void
svga_propagate_surface(struct svga_context *svga, struct pipe_surface *surf);
+void
+svga_propagate_rendertargets(struct svga_context *svga);
+
extern boolean
svga_surface_needs_propagation(const struct pipe_surface *surf);