summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2015-02-22 15:21:59 +0100
committerMarek Olšák <[email protected]>2015-05-26 12:42:37 +0200
commit0c5a309cee868cd6e3870f439f560f5f32eb7c40 (patch)
tree7f78464f8eb4858f36b6f9eecd2dc52bcfea94b3 /src
parentfa7f606e89dc4447f07fec0b84d396a4ff25ee7e (diff)
radeonsi: use a switch statement in si_shader_selector_key
Reviewed-by: Michel Dänzer <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/radeonsi/si_state_shaders.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c
index 610af948f12..e037ce41468 100644
--- a/src/gallium/drivers/radeonsi/si_state_shaders.c
+++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
@@ -356,21 +356,25 @@ static INLINE void si_shader_selector_key(struct pipe_context *ctx,
union si_shader_key *key)
{
struct si_context *sctx = (struct si_context *)ctx;
- memset(key, 0, sizeof(*key));
+ unsigned i;
- if (sel->type == PIPE_SHADER_VERTEX) {
- unsigned i;
- if (!sctx->vertex_elements)
- return;
+ memset(key, 0, sizeof(*key));
- for (i = 0; i < sctx->vertex_elements->count; ++i)
- key->vs.instance_divisors[i] = sctx->vertex_elements->elements[i].instance_divisor;
+ switch (sel->type) {
+ case PIPE_SHADER_VERTEX:
+ if (sctx->vertex_elements)
+ for (i = 0; i < sctx->vertex_elements->count; ++i)
+ key->vs.instance_divisors[i] =
+ sctx->vertex_elements->elements[i].instance_divisor;
if (sctx->gs_shader) {
key->vs.as_es = 1;
key->vs.gs_used_inputs = sctx->gs_shader->gs_used_inputs;
}
- } else if (sel->type == PIPE_SHADER_FRAGMENT) {
+ break;
+ case PIPE_SHADER_GEOMETRY:
+ break;
+ case PIPE_SHADER_FRAGMENT: {
struct si_state_rasterizer *rs = sctx->queued.named.rasterizer;
if (sel->info.properties[TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS])
@@ -398,11 +402,14 @@ static INLINE void si_shader_selector_key(struct pipe_context *ctx,
}
key->ps.alpha_func = PIPE_FUNC_ALWAYS;
-
/* Alpha-test should be disabled if colorbuffer 0 is integer. */
if (sctx->queued.named.dsa &&
!sctx->framebuffer.cb0_is_integer)
key->ps.alpha_func = sctx->queued.named.dsa->alpha_func;
+ break;
+ }
+ default:
+ assert(0);
}
}