diff options
author | Michel Dänzer <[email protected]> | 2012-08-23 17:10:37 +0200 |
---|---|---|
committer | Michel Dänzer <[email protected]> | 2012-08-27 11:51:41 +0200 |
commit | d1e40b3d40b2e90ad4f275565f1ae27fe6f964cc (patch) | |
tree | 41a93fa06f09fad3ba0ae3071a4997c58c0406e6 /src/gallium/drivers/radeonsi/radeonsi_shader.h | |
parent | 84fdda280f4361add3802476ce9a30ac1c0b4c69 (diff) |
radeonsi: Maintain cache of pixel shader variants according to contxt state.
Mostly inspired by r600g commit 4acf71f01ea1edb253cd38cc059d4af1a2a40bf4
('r600g: cache shader variants instead of rebuilding v3').
Signed-off-by: Michel Dänzer <[email protected]>
Reviewed-by: Christian König <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/radeonsi_shader.h')
-rw-r--r-- | src/gallium/drivers/radeonsi/radeonsi_shader.h | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/gallium/drivers/radeonsi/radeonsi_shader.h b/src/gallium/drivers/radeonsi/radeonsi_shader.h index d44ee9b128b..aa2888ccf30 100644 --- a/src/gallium/drivers/radeonsi/radeonsi_shader.h +++ b/src/gallium/drivers/radeonsi/radeonsi_shader.h @@ -37,6 +37,25 @@ struct si_shader_io { bool centroid; }; +struct si_pipe_shader; + +struct si_pipe_shader_selector { + struct si_pipe_shader *current; + + struct tgsi_token *tokens; + struct pipe_stream_output_info so; + + unsigned num_shaders; + + /* PIPE_SHADER_[VERTEX|FRAGMENT|...] */ + unsigned type; + + /* 1 when the shader contains + * TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS, otherwise it's 0. + * Used to determine whether we need to include nr_cbufs in the key */ + unsigned fs_write_all; +}; + struct si_shader { unsigned ninput; struct si_shader_io input[32]; @@ -50,16 +69,17 @@ struct si_shader { }; struct si_pipe_shader { + struct si_pipe_shader_selector *selector; + struct si_pipe_shader *next_variant; struct si_shader shader; struct si_pm4_state *pm4; struct si_resource *bo; - struct tgsi_token *tokens; unsigned num_sgprs; unsigned num_vgprs; unsigned spi_ps_input_ena; unsigned sprite_coord_enable; - struct pipe_stream_output_info so; unsigned so_strides[4]; + unsigned key; }; /* radeonsi_shader.c */ |