diff options
author | Roland Scheidegger <sroland@vmware.com> | 2015-03-27 16:49:54 +0100 |
---|---|---|
committer | Roland Scheidegger <sroland@vmware.com> | 2015-03-28 02:59:42 +0100 |
commit | b2424fb0304cf4afd363b35c1dab49fb7edddb08 (patch) | |
tree | 3acdd6cdb1107fab78297567d0d22ca60572b85d /src/gallium/drivers/llvmpipe/lp_scene.c | |
parent | 764fc2be5ab61c86baaab746e7ea7702328c4f9f (diff) | |
download | external_mesa3d-b2424fb0304cf4afd363b35c1dab49fb7edddb08.zip external_mesa3d-b2424fb0304cf4afd363b35c1dab49fb7edddb08.tar.gz external_mesa3d-b2424fb0304cf4afd363b35c1dab49fb7edddb08.tar.bz2 |
llvmpipe: simplify address calculation for 4x4 blocks
These functions looked quite complicated, even though what they actually did
was trivial (ever since we dropped swizzled rendering). Also drop lookup of
format block per bytes done for each block, and do it once per scene instead.
This improves everybody's favorite "benchmark" by 3% or so, though
lp_rast_shade_quads_all() which calls this shows up still quite high for a
function which does little more than call the jit function.
(This would most likely be much better handled by the jit function itself,
the strides are passed through anyway already, though for being able to
handle layers it would definitely add some complexity.)
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.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_scene.c b/src/gallium/drivers/llvmpipe/lp_scene.c index e95d76a..2441b3c 100644 --- a/src/gallium/drivers/llvmpipe/lp_scene.c +++ b/src/gallium/drivers/llvmpipe/lp_scene.c @@ -174,6 +174,7 @@ lp_scene_begin_rasterization(struct lp_scene *scene) cbuf->u.tex.level, cbuf->u.tex.first_layer, LP_TEX_USAGE_READ_WRITE); + scene->cbufs[i].format_bytes = util_format_get_blocksize(cbuf->format); } else { struct llvmpipe_resource *lpr = llvmpipe_resource(cbuf->texture); @@ -182,6 +183,7 @@ lp_scene_begin_rasterization(struct lp_scene *scene) scene->cbufs[i].layer_stride = 0; scene->cbufs[i].map = lpr->data; scene->cbufs[i].map += cbuf->u.buf.first_element * pixstride; + scene->cbufs[i].format_bytes = util_format_get_blocksize(cbuf->format); } } @@ -194,6 +196,7 @@ lp_scene_begin_rasterization(struct lp_scene *scene) zsbuf->u.tex.level, zsbuf->u.tex.first_layer, LP_TEX_USAGE_READ_WRITE); + scene->zsbuf.format_bytes = util_format_get_blocksize(zsbuf->format); } } |