aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe/lp_rast_priv.h
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-12-07 17:02:17 -0700
committerBrian Paul <[email protected]>2009-12-07 18:04:54 -0700
commit3a06c113c76355fc9622adfe7565c18d9787e9a8 (patch)
tree7020ba41b1fda67c9f4adb157fba7ec2f8cca1d9 /src/gallium/drivers/llvmpipe/lp_rast_priv.h
parentcdaea049c95031338040b31ff31944c8a001a1dd (diff)
llvmpipe: repartition lp_rasterizer state for threading
Some of the state is per-thread. Put that state in new lp_rasterizer_task struct.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_rast_priv.h')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_rast_priv.h43
1 files changed, 30 insertions, 13 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_rast_priv.h b/src/gallium/drivers/llvmpipe/lp_rast_priv.h
index 98111edff72..9e7cbd7912e 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast_priv.h
+++ b/src/gallium/drivers/llvmpipe/lp_rast_priv.h
@@ -30,6 +30,10 @@
#include "lp_rast.h"
+
+#define MAX_THREADS 4 /* XXX probably temporary here */
+
+
struct pipe_transfer;
struct pipe_screen;
@@ -47,14 +51,34 @@ struct lp_rast_tile
/**
- * This is the state required while rasterizing a tile.
- * The tile size is TILE_SIZE x TILE_SIZE pixels.
+ * Per-thread rasterization state
*/
-struct lp_rasterizer
+struct lp_rasterizer_task
{
struct lp_rast_tile tile; /** Tile color/z/stencil memory */
unsigned x, y; /**< Pos of this tile in framebuffer, in pixels */
+
+ /* Pixel blocks produced during rasterization
+ */
+ unsigned nr_blocks;
+ struct {
+ unsigned x;
+ unsigned y;
+ unsigned mask;
+ } blocks[256];
+
+ const struct lp_rast_state *current_state;
+};
+
+
+/**
+ * This is the state required while rasterizing tiles.
+ * Note that this contains per-thread information too.
+ * The tile size is TILE_SIZE x TILE_SIZE pixels.
+ */
+struct lp_rasterizer
+{
unsigned width, height; /**< Size of framebuffer, in pixels */
boolean clipped_tile;
@@ -78,20 +102,13 @@ struct lp_rasterizer
char clear_stencil;
} state;
- /* Pixel blocks produced during rasterization
- */
- unsigned nr_blocks;
- struct {
- unsigned x;
- unsigned y;
- unsigned mask;
- } blocks[256];
-
- const struct lp_rast_state *current_state;
+ /** A task object for each rasterization thread */
+ struct lp_rasterizer_task tasks[MAX_THREADS];
};
void lp_rast_shade_quads( struct lp_rasterizer *rast,
+ unsigned thread_index,
const struct lp_rast_shader_inputs *inputs,
unsigned x, unsigned y,
unsigned masks);