llvmpipe: pass fewer parameters to rasterization functions
authorBrian Paul <brianp@vmware.com>
Wed, 24 Feb 2010 20:30:57 +0000 (13:30 -0700)
committerBrian Paul <brianp@vmware.com>
Wed, 24 Feb 2010 20:54:25 +0000 (13:54 -0700)
src/gallium/drivers/llvmpipe/lp_rast.c
src/gallium/drivers/llvmpipe/lp_rast_priv.h
src/gallium/drivers/llvmpipe/lp_rast_tri.c

index bbd63aec2b351699c953ddddef5736bd99d17135..159ef0d55d7094a95fa64bb29a909af93fd7530a 100644 (file)
@@ -396,14 +396,13 @@ void lp_rast_shade_tile( struct lp_rasterizer *rast,
  * Compute shading for a 4x4 block of pixels.
  * This is a bin command called during bin processing.
  */
-void lp_rast_shade_quads( struct lp_rasterizer *rast,
-                          unsigned thread_index,
+void lp_rast_shade_quads( struct lp_rasterizer_task *task,
                           const struct lp_rast_shader_inputs *inputs,
                           unsigned x, unsigned y,
                           int32_t c1, int32_t c2, int32_t c3)
 {
-   struct lp_rasterizer_task *task = &rast->tasks[thread_index];
    const struct lp_rast_state *state = task->current_state;
+   struct lp_rasterizer *rast = task->rast;
    struct lp_rast_tile *tile = &task->tile;
    uint8_t *color[PIPE_MAX_COLOR_BUFS];
    void *depth;
index 5c5497e0929996a698a9b7a58519b6e43487383f..382e169c1c5143c1fd6733bddd9f522925aff538 100644 (file)
@@ -121,8 +121,7 @@ struct lp_rasterizer
 };
 
 
-void lp_rast_shade_quads( struct lp_rasterizer *rast,
-                          unsigned thread_index,
+void lp_rast_shade_quads( struct lp_rasterizer_task *task,
                           const struct lp_rast_shader_inputs *inputs,
                           unsigned x, unsigned y,
                           int32_t c1, int32_t c2, int32_t c3);
@@ -159,13 +158,13 @@ lp_rast_depth_pointer( struct lp_rasterizer *rast,
  * \param x, y location of 4x4 block in window coords
  */
 static INLINE void
-lp_rast_shade_quads_all( struct lp_rasterizer *rast,
-                         unsigned thread_index,
+lp_rast_shade_quads_all( struct lp_rasterizer_task *task,
                          const struct lp_rast_shader_inputs *inputs,
                          unsigned x, unsigned y )
 {
-   const struct lp_rast_state *state = rast->tasks[thread_index].current_state;
-   struct lp_rast_tile *tile = &rast->tasks[thread_index].tile;
+   struct lp_rasterizer *rast = task->rast;
+   const struct lp_rast_state *state = task->current_state;
+   struct lp_rast_tile *tile = &task->tile;
    const unsigned ix = x % TILE_SIZE, iy = y % TILE_SIZE;
    uint8_t *color[PIPE_MAX_COLOR_BUFS];
    void *depth;
index bbc95c399a0acf3c628999b852ed42ff22cb9352..90325aedb898eac7e88059bca9ba69e2ceca81b9 100644 (file)
@@ -93,10 +93,7 @@ block_full_4( struct lp_rasterizer_task *rast_task,
               const struct lp_rast_triangle *tri,
               int x, int y )
 {
-   lp_rast_shade_quads_all(rast_task->rast,
-                           rast_task->thread_index,
-                           &tri->inputs, 
-                           x, y);
+   lp_rast_shade_quads_all(rast_task, &tri->inputs, x, y);
 }
 
 
@@ -133,8 +130,7 @@ do_block_4( struct lp_rasterizer_task *rast_task,
    assert(x >= 0);
    assert(y >= 0);
 
-   lp_rast_shade_quads(rast_task->rast,
-                       rast_task->thread_index,
+   lp_rast_shade_quads(rast_task,
                        &tri->inputs, 
                        x, y,
                        -c1, -c2, -c3);