summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_rast_priv.h
diff options
context:
space:
mode:
authorKeith Whitwell <keithw@vmware.com>2010-07-16 14:40:30 +0100
committerJosé Fonseca <jfonseca@vmware.com>2010-07-16 17:24:21 +0100
commit2f6d47a7c8d6e69e5154de44115aab9ba35a41d2 (patch)
tree8919f6686b6f7db8aa3d3305084076d8884afb15 /src/gallium/drivers/llvmpipe/lp_rast_priv.h
parentb7fff13d58b57870807bae2f43fa2854b551b267 (diff)
llvmpipe: use single swizzled tile
Use a single swizzled tile per colorbuf (and per thread) to avoid accumulating large amounts of cached swizzled data. Now that the SSE3 code has been merged to master, the performance delta of this change is minimal, the main benefit is reduced memory usage due to no longer keeping swizzled copies of render targets. It's clear from the performance of the in-place version of this code that there is still quite a bit of time being spent swizzling & unswizzling, but it's not clear exactly how to reduce that.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_rast_priv.h')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_rast_priv.h24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_rast_priv.h b/src/gallium/drivers/llvmpipe/lp_rast_priv.h
index 8044927c8b..b4a48cfd02 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast_priv.h
+++ b/src/gallium/drivers/llvmpipe/lp_rast_priv.h
@@ -148,7 +148,7 @@ lp_rast_get_depth_block_pointer(struct lp_rasterizer_task *task,
* the oom warning as this most likely because there is no
* zsbuf.
*/
- return lp_get_dummy_tile_silent();
+ return lp_dummy_tile;
}
depth = (rast->zsbuf.map +
@@ -178,15 +178,14 @@ lp_rast_get_color_tile_pointer(struct lp_rasterizer_task *task,
struct llvmpipe_resource *lpt;
assert(cbuf);
lpt = llvmpipe_resource(cbuf->texture);
- task->color_tiles[buf] = llvmpipe_get_texture_tile(lpt,
- cbuf->face + cbuf->zslice,
- cbuf->level,
- usage,
- task->x,
- task->y);
- if (!task->color_tiles[buf]) {
- /* out of memory - use dummy tile memory */
- return lp_get_dummy_tile();
+ task->color_tiles[buf] = lp_swizzled_cbuf[task->thread_index][buf];
+
+ if (usage != LP_TEX_USAGE_WRITE_ALL) {
+ llvmpipe_swizzle_cbuf_tile(lpt,
+ cbuf->face + cbuf->zslice,
+ cbuf->level,
+ task->x, task->y,
+ task->color_tiles[buf]);
}
}
@@ -212,10 +211,7 @@ lp_rast_get_color_block_pointer(struct lp_rasterizer_task *task,
assert((y % TILE_VECTOR_HEIGHT) == 0);
color = lp_rast_get_color_tile_pointer(task, buf, LP_TEX_USAGE_READ_WRITE);
- if (!color) {
- /* out of memory - use dummy tile memory */
- return lp_get_dummy_tile();
- }
+ assert(color);
px = x % TILE_SIZE;
py = y % TILE_SIZE;