summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe/lp_scene.h
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_scene.h
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_scene.h')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_scene.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_scene.h b/src/gallium/drivers/llvmpipe/lp_scene.h
index fa5bbcaf013..bc6c448bc7f 100644
--- a/src/gallium/drivers/llvmpipe/lp_scene.h
+++ b/src/gallium/drivers/llvmpipe/lp_scene.h
@@ -144,6 +144,10 @@ struct lp_scene {
/** list of resources referenced by the scene commands */
struct resource_ref *resources;
+ /** aligned scene width, height */
+ unsigned width_aligned;
+ unsigned height_aligned;
+
/** Total memory used by the scene (in bytes). This sums all the
* data blocks and counts all bins, state, resource references and
* other random allocations within the scene.