Mesa (master): svga: add new begin_blit()

Brian Paul brianp at kemper.freedesktop.org
Fri Aug 26 13:39:02 UTC 2016


Module: Mesa
Branch: master
Commit: 1da538f85bc327f4ae5e1a5b90c15b99f8cf48df
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1da538f85bc327f4ae5e1a5b90c15b99f8cf48df

Author: Neha Bhende <bhenden at vmware.com>
Date:   Thu Aug 11 16:30:14 2016 -0700

svga: add new begin_blit()

Saving all blitter states will be done in begin_blit() so that
begin_blit() can be used before performing any blit operation.

Reviewed-by: Brian Paul <brianp at vmware.com>
Reviewed-by: Charmaine Lee <charmainel at vmware.com>

---

 src/gallium/drivers/svga/svga_pipe_clear.c | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_pipe_clear.c b/src/gallium/drivers/svga/svga_pipe_clear.c
index c874726..1eb3757 100644
--- a/src/gallium/drivers/svga/svga_pipe_clear.c
+++ b/src/gallium/drivers/svga/svga_pipe_clear.c
@@ -35,18 +35,11 @@
 
 
 /**
- * Clear the whole color buffer(s) by drawing a quad.  For VGPU10 we use
- * this when clearing integer render targets.  We'll also clear the
- * depth and/or stencil buffers if the clear_buffers mask specifies them.
+ * Saving blitter states before doing any blitter operation
  */
 static void
-clear_buffers_with_quad(struct svga_context *svga,
-                        unsigned clear_buffers,
-                        const union pipe_color_union *color,
-                        double depth, unsigned stencil)
+begin_blit(struct svga_context *svga)
 {
-   const struct pipe_framebuffer_state *fb = &svga->curr.framebuffer;
-
    util_blitter_save_vertex_buffer_slot(svga->blitter, svga->curr.vb);
    util_blitter_save_vertex_elements(svga->blitter, (void*)svga->curr.velems);
    util_blitter_save_vertex_shader(svga->blitter, svga->curr.vs);
@@ -62,7 +55,23 @@ clear_buffers_with_quad(struct svga_context *svga,
                                          (void*)svga->curr.depth);
    util_blitter_save_stencil_ref(svga->blitter, &svga->curr.stencil_ref);
    util_blitter_save_sample_mask(svga->blitter, svga->curr.sample_mask);
+}
+
+
+/**
+ * Clear the whole color buffer(s) by drawing a quad.  For VGPU10 we use
+ * this when clearing integer render targets.  We'll also clear the
+ * depth and/or stencil buffers if the clear_buffers mask specifies them.
+ */
+static void
+clear_buffers_with_quad(struct svga_context *svga,
+                        unsigned clear_buffers,
+                        const union pipe_color_union *color,
+                        double depth, unsigned stencil)
+{
+   const struct pipe_framebuffer_state *fb = &svga->curr.framebuffer;
 
+   begin_blit(svga);
    util_blitter_clear(svga->blitter,
                       fb->width, fb->height,
                       1, /* num_layers */




More information about the mesa-commit mailing list