Mesa (lp-binning): llvmpipe: implement lp_rast_load_color()

Brian Paul brianp at kemper.freedesktop.org
Sat Dec 12 01:01:21 UTC 2009


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

Author: Brian Paul <brianp at vmware.com>
Date:   Fri Dec 11 15:00:28 2009 -0700

llvmpipe: implement lp_rast_load_color()

---

 src/gallium/drivers/llvmpipe/lp_rast.c |   26 ++++++++++++++++++++++++--
 1 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c b/src/gallium/drivers/llvmpipe/lp_rast.c
index 2ea3ac6..9020cf9 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast.c
+++ b/src/gallium/drivers/llvmpipe/lp_rast.c
@@ -210,9 +210,31 @@ void lp_rast_load_color( struct lp_rasterizer *rast,
                          unsigned thread_index,
                          const union lp_rast_cmd_arg arg)
 {
-   LP_DBG(DEBUG_RAST, "%s\n", __FUNCTION__);
+   struct lp_rasterizer_task *task = &rast->tasks[thread_index];
+   const unsigned x = task->x;
+   const unsigned y = task->y;
+   int w = TILE_SIZE;
+   int h = TILE_SIZE;
+
+   LP_DBG(DEBUG_RAST, "%s at %u, %u\n", __FUNCTION__, x, y);
+
+   if (x + w > rast->state.fb.width)
+      w -= x + w - rast->state.fb.width;
+
+   if (y + h > rast->state.fb.height)
+      h -= y + h - rast->state.fb.height;
 
-   /* call u_tile func to load colors from surface */
+   assert(w >= 0);
+   assert(h >= 0);
+   assert(w <= TILE_SIZE);
+   assert(h <= TILE_SIZE);
+
+   lp_tile_read_4ub(rast->cbuf_transfer->format,
+                     rast->tasks[thread_index].tile.color,
+                     rast->cbuf_map, 
+                     rast->cbuf_transfer->stride,
+                     x, y,
+                     w, h);
 }
 
 




More information about the mesa-commit mailing list