summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe/lp_scene.c
diff options
context:
space:
mode:
authorRoland Scheidegger <sroland@vmware.com>2013-05-30 02:05:01 +0200
committerRoland Scheidegger <sroland@vmware.com>2013-05-31 20:21:05 +0200
commit869c5d438f137b2c6b9aec1dddc00bfa64f36621 (patch)
tree893e668a17c701d88ef2af0afa6cbfceb1beacb1 /src/gallium/drivers/llvmpipe/lp_scene.c
parente881c9a5dc5457f0b096a3c583c5b1450beb89e9 (diff)
downloadexternal_mesa3d-869c5d438f137b2c6b9aec1dddc00bfa64f36621.zip
external_mesa3d-869c5d438f137b2c6b9aec1dddc00bfa64f36621.tar.gz
external_mesa3d-869c5d438f137b2c6b9aec1dddc00bfa64f36621.tar.bz2
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 <jfonseca@vmware.com>
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_scene.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_scene.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_scene.c b/src/gallium/drivers/llvmpipe/lp_scene.c
index 771ad08..2dfc7ff 100644
--- a/src/gallium/drivers/llvmpipe/lp_scene.c
+++ b/src/gallium/drivers/llvmpipe/lp_scene.c
@@ -505,6 +505,8 @@ void lp_scene_begin_binning( struct lp_scene *scene,
scene->tiles_x = align(fb->width, TILE_SIZE) / TILE_SIZE;
scene->tiles_y = align(fb->height, TILE_SIZE) / TILE_SIZE;
+ scene->width_aligned = align(fb->width, LP_RASTER_BLOCK_SIZE);
+ scene->height_aligned = align(fb->height, LP_RASTER_BLOCK_SIZE);
assert(scene->tiles_x <= TILES_X);
assert(scene->tiles_y <= TILES_Y);