r600g: cache shader variants instead of rebuilding v3
authorVadim Girlin <vadimgirlin@gmail.com>
Mon, 11 Jun 2012 09:11:47 +0000 (13:11 +0400)
committerVadim Girlin <vadimgirlin@gmail.com>
Tue, 26 Jun 2012 22:06:55 +0000 (02:06 +0400)
commit4acf71f01ea1edb253cd38cc059d4af1a2a40bf4
treef735a384fda706b02f0c12fb3e391e5496490c26
parent55a89889ba8b9e58fdccf9d363d22aac93ba1281
r600g: cache shader variants instead of rebuilding v3

Shader variants are stored in the list, the key for lookup is based on the
states that require different hw shaders - currently it's rctx->two_side (all
gpus) and rctx->nr_cbufs (evergreen/cayman, when writes_all property is set).

v2:
 - use simple list instead of keymap as suggested by Marek on irc
 - call r600_adjust_gprs from r600_bind_vs_shader for r6xx/r7xx
   (r600_shader_select isn't used for vertex shaders currently)

v3:
 - fix call to r600_adjust_gprs - do it after updating current shader

Improves performance for some apps, e.g. FlightGear -
see https://bugs.freedesktop.org/show_bug.cgi?id=50360

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
src/gallium/drivers/r600/evergreen_state.c
src/gallium/drivers/r600/r600_pipe.h
src/gallium/drivers/r600/r600_shader.c
src/gallium/drivers/r600/r600_state.c
src/gallium/drivers/r600/r600_state_common.c