diff options
author | Marek Olšák <[email protected]> | 2015-02-22 15:38:21 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2015-05-26 12:42:37 +0200 |
commit | 224a77cc60cc0e7f8a14e35ebca6e42544af39b1 (patch) | |
tree | 54923d2a683d1114798d88b793a11c650823f5ae /src/gallium/drivers | |
parent | 0c5a309cee868cd6e3870f439f560f5f32eb7c40 (diff) |
radeonsi: use a switch statement in si_delete_shader_selector
Reviewed-by: Michel Dänzer <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state_shaders.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c index e037ce41468..208c8523ef1 100644 --- a/src/gallium/drivers/radeonsi/si_state_shaders.c +++ b/src/gallium/drivers/radeonsi/si_state_shaders.c @@ -592,15 +592,22 @@ static void si_delete_shader_selector(struct pipe_context *ctx, while (p) { c = p->next_variant; - if (sel->type == PIPE_SHADER_GEOMETRY) { + switch (sel->type) { + case PIPE_SHADER_VERTEX: + if (p->key.vs.as_es) + si_pm4_delete_state(sctx, es, p->pm4); + else + si_pm4_delete_state(sctx, vs, p->pm4); + break; + case PIPE_SHADER_GEOMETRY: si_pm4_delete_state(sctx, gs, p->pm4); si_pm4_delete_state(sctx, vs, p->gs_copy_shader->pm4); - } else if (sel->type == PIPE_SHADER_FRAGMENT) + break; + case PIPE_SHADER_FRAGMENT: si_pm4_delete_state(sctx, ps, p->pm4); - else if (p->key.vs.as_es) - si_pm4_delete_state(sctx, es, p->pm4); - else - si_pm4_delete_state(sctx, vs, p->pm4); + break; + } + si_shader_destroy(ctx, p); free(p); p = c; |