diff options
author | Edward O'Callaghan <[email protected]> | 2015-08-19 18:58:46 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2015-08-21 09:46:13 +1000 |
commit | e2145de74d6333f099613c595c5c46f79f54e59f (patch) | |
tree | 8d0637d55547998a275dbb8e7acb653675269a37 /src/gallium/drivers/r600 | |
parent | bbf8291bf869e219bd0e71063bf26a060682a000 (diff) |
r600: Rewrite r600_shader_selector_key() to use a switch stmt
Signed-off-by: Edward O'Callaghan <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600')
-rw-r--r-- | src/gallium/drivers/r600/r600_state_common.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c index aa4a8d0240f..c7445b8b367 100644 --- a/src/gallium/drivers/r600/r600_state_common.c +++ b/src/gallium/drivers/r600/r600_state_common.c @@ -709,7 +709,18 @@ static inline struct r600_shader_key r600_shader_selector_key(struct pipe_contex struct r600_shader_key key; memset(&key, 0, sizeof(key)); - if (sel->type == PIPE_SHADER_FRAGMENT) { + switch (sel->type) { + case PIPE_SHADER_VERTEX: { + key.vs_as_es = (rctx->gs_shader != NULL); + if (rctx->ps_shader->current->shader.gs_prim_id_input && !rctx->gs_shader) { + key.vs_as_gs_a = true; + key.vs_prim_id_out = rctx->ps_shader->current->shader.input[rctx->ps_shader->current->shader.ps_prim_id_input].spi_sid; + } + break; + } + case PIPE_SHADER_GEOMETRY: + break; + case PIPE_SHADER_FRAGMENT: { key.color_two_side = rctx->rasterizer && rctx->rasterizer->two_side; key.alpha_to_one = rctx->alpha_to_one && rctx->rasterizer && rctx->rasterizer->multisample_enable && @@ -718,13 +729,12 @@ static inline struct r600_shader_key r600_shader_selector_key(struct pipe_contex /* Dual-source blending only makes sense with nr_cbufs == 1. */ if (key.nr_cbufs == 1 && rctx->dual_src_blend) key.nr_cbufs = 2; - } else if (sel->type == PIPE_SHADER_VERTEX) { - key.vs_as_es = (rctx->gs_shader != NULL); - if (rctx->ps_shader->current->shader.gs_prim_id_input && !rctx->gs_shader) { - key.vs_as_gs_a = true; - key.vs_prim_id_out = rctx->ps_shader->current->shader.input[rctx->ps_shader->current->shader.ps_prim_id_input].spi_sid; - } + break; } + default: + assert(0); + } + return key; } |