Mesa (lp-binning): llvmpipe: Follow write_color/write_zstencil.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Fri Oct 9 09:38:27 UTC 2009


Module: Mesa
Branch: lp-binning
Commit: 47510040a68f5f672aee22eac6c01fb4dd60ec67
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=47510040a68f5f672aee22eac6c01fb4dd60ec67

Author: José Fonseca <jfonseca at vmware.com>
Date:   Fri Oct  9 10:37:24 2009 +0100

llvmpipe: Follow write_color/write_zstencil.

---

 src/gallium/drivers/llvmpipe/lp_rast.c      |   24 ++++++++++++++++++++----
 src/gallium/drivers/llvmpipe/lp_rast.h      |    6 ------
 src/gallium/drivers/llvmpipe/lp_rast_priv.h |    2 ++
 3 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c b/src/gallium/drivers/llvmpipe/lp_rast.c
index 6ac44fe..9825099 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast.c
+++ b/src/gallium/drivers/llvmpipe/lp_rast.c
@@ -64,6 +64,7 @@ void lp_rast_bind_color( struct lp_rasterizer *rast,
                          boolean write_color )
 {
    pipe_surface_reference(&rast->state.cbuf, cbuf);
+   rast->state.write_color = write_color;
 }
 
 void lp_rast_bind_zstencil( struct lp_rasterizer *rast,
@@ -71,6 +72,7 @@ void lp_rast_bind_zstencil( struct lp_rasterizer *rast,
                             boolean write_zstencil )
 {
    pipe_surface_reference(&rast->state.zsbuf, zsbuf);
+   rast->state.write_zstencil = write_zstencil;
 }
 
 
@@ -206,7 +208,7 @@ void lp_rast_shade_quads( struct lp_rasterizer *rast,
  */
 
 
-void lp_rast_end_tile( struct lp_rasterizer *rast )
+static void lp_rast_store_color( struct lp_rasterizer *rast )
 {
    struct pipe_surface *surface;
    struct pipe_screen *screen;
@@ -250,11 +252,25 @@ void lp_rast_end_tile( struct lp_rasterizer *rast )
 
    screen->tex_transfer_destroy(transfer);
 
-   if (0) {
-      /* FIXME: call u_tile func to store depth/stencil to surface */
-   }
 }
 
+
+static void lp_rast_store_zstencil( struct lp_rasterizer *rast )
+{
+   /* FIXME: call u_tile func to store depth/stencil to surface */
+}
+
+
+void lp_rast_end_tile( struct lp_rasterizer *rast )
+{
+   if (rast->state.write_color)
+      lp_rast_store_color(rast);
+
+   if (rast->state.write_zstencil)
+      lp_rast_store_zstencil(rast);
+}
+
+
 /* Shutdown:
  */
 void lp_rast_destroy( struct lp_rasterizer *rast )
diff --git a/src/gallium/drivers/llvmpipe/lp_rast.h b/src/gallium/drivers/llvmpipe/lp_rast.h
index 26d057b..aa50fba 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast.h
+++ b/src/gallium/drivers/llvmpipe/lp_rast.h
@@ -163,12 +163,6 @@ void lp_rast_shade_tile( struct lp_rasterizer *,
                          const union lp_rast_cmd_arg *,
                          const struct lp_rast_shader_inputs *);
 
-void lp_rast_store_color( struct lp_rasterizer *,
-                          const union lp_rast_cmd_arg *);
-
-void lp_rast_store_zstencil( struct lp_rasterizer *,
-                             const union lp_rast_cmd_arg *);
-
 
 /* End of tile:
  */
diff --git a/src/gallium/drivers/llvmpipe/lp_rast_priv.h b/src/gallium/drivers/llvmpipe/lp_rast_priv.h
index d7a8b9c..f5a6699 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast_priv.h
+++ b/src/gallium/drivers/llvmpipe/lp_rast_priv.h
@@ -61,6 +61,8 @@ struct lp_rasterizer {
    struct {
       struct pipe_surface *cbuf;
       struct pipe_surface *zsbuf;
+      boolean write_color;
+      boolean write_zstencil;
       unsigned clear_color;
       unsigned clear_depth;
       char clear_stencil;




More information about the mesa-commit mailing list