vc4: Speed up glGenerateMipmaps by avoiding shadow baselevel.
authorEric Anholt <eric@anholt.net>
Fri, 15 Jul 2016 00:26:43 +0000 (17:26 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 15 Jul 2016 20:54:00 +0000 (13:54 -0700)
commit3bcd0f1912a60cc9d3813923d18d29465e41ff56
treea453cbfb302a1e70b0704c3725f9ce6e5172db0d
parent88152d7dc0e2cf233cd2c38a4e9affb1ea73fa97
vc4: Speed up glGenerateMipmaps by avoiding shadow baselevel.

To support general GL_TEXTURE_BASE_LEVEL we have to copy to a temporary
miptree.  However, if a single level is being selected, we can use the
existing miptree and force all the sampling to be from that particular
level.

This avoids a ton of software fallbacks in glGenerateMipmaps(), which uses
base levels in the blit implementation in gallium.  Improves "glmark2 -b
terrain" from 2 fps to 3 (perhaps some more precision would be useful?),
and cuts its CPU usage during the benchmarking from ~30% to ~10% (total
CPU time from 8.8s to 7.6s).
src/gallium/drivers/vc4/vc4_context.h
src/gallium/drivers/vc4/vc4_program.c
src/gallium/drivers/vc4/vc4_qir.h
src/gallium/drivers/vc4/vc4_resource.c
src/gallium/drivers/vc4/vc4_state.c