summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe/lp_setup.c
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2013-05-30 02:05:01 +0200
committerRoland Scheidegger <[email protected]>2013-05-31 20:21:05 +0200
commit869c5d438f137b2c6b9aec1dddc00bfa64f36621 (patch)
tree893e668a17c701d88ef2af0afa6cbfceb1beacb1 /src/gallium/drivers/llvmpipe/lp_setup.c
parente881c9a5dc5457f0b096a3c583c5b1450beb89e9 (diff)
llvmpipe: reduce alignment requirement for resources from 64x64 to 4x4
The overallocation was very bad especially for things like 1d array textures which got blown up by a factor of 64. (Even ordinary smallish 2d textures benefit a lot from this, a mipmapped 64x64 rgba8 texture previously used 7*16kB = 112kB instead of now ~22kB.) 4x4 is chosen because this is the size the jit functions run on, so making it smaller is going to be a bit more complicated. It is actually not strictly 4x4 pixel, since we'd want to avoid situations where different threads are rendering to the same cacheline so we keep cacheline size alignment in x direction (often 64bytes). To make this work introduce new task width/height parameters and make sure clears don't clear the whole tile if it's a partial tile. Likewise, the rasterizer may produce fragments outside the 4x4 blocks present in a tile, so don't call the jit function for them. This does not yet fix rendering to buffers (which cannot have any y alignment at all), and 1d/1d array textures are still overallocated by a factor of 4. v2: replace magic number 4 with LP_RASTER_BLOCK_SIZE, fix size of buffers allocated (needed in case we render to them). Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_setup.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_setup.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c
index a141fa337ab..bafcf56b803 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup.c
@@ -694,8 +694,7 @@ lp_setup_set_fragment_sampler_views(struct lp_setup_context *setup,
assert(last_level <= res->last_level);
/*
- * The complexity here is only necessary for depth textures which
- * still are tiled.
+ * The complexity here should no longer be necessary.
*/
mip_ptr = llvmpipe_get_texture_image_all(lp_tex, first_level,
LP_TEX_USAGE_READ);