diff options
author | Marek Olšák <[email protected]> | 2013-12-04 13:54:50 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2013-12-12 18:48:04 +0100 |
commit | 7fa8fb7382285797c34ef498da7a3a4cf3a85ebe (patch) | |
tree | f8ce6a932fcb13f01054cb344f04e9f963436080 /src/gallium/drivers/radeonsi/si_state.c | |
parent | 0eb528abf21a172ef7a8aef7c1733b1101eba2b7 (diff) |
radeonsi: fix binding the dummy pixel shader
This fixes valgrind errors in glxinfo.
Reviewed-by: Michel Dänzer <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_state.c')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index 165475c6fd5..d99cfe88bc4 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -2335,15 +2335,12 @@ static void si_bind_vs_shader(struct pipe_context *ctx, void *state) if (rctx->vs_shader == sel) return; - rctx->vs_shader = sel; - - if (sel && sel->current) { - si_pm4_bind_state(rctx, vs, sel->current->pm4); - rctx->b.streamout.stride_in_dw = sel->so.stride; - } else { - si_pm4_bind_state(rctx, vs, rctx->dummy_pixel_shader->pm4); - } + if (!sel || !sel->current) + return; + rctx->vs_shader = sel; + si_pm4_bind_state(rctx, vs, sel->current->pm4); + rctx->b.streamout.stride_in_dw = sel->so.stride; rctx->b.flags |= R600_CONTEXT_INV_SHADER_CACHE; } @@ -2355,13 +2352,11 @@ static void si_bind_ps_shader(struct pipe_context *ctx, void *state) if (rctx->ps_shader == sel) return; - rctx->ps_shader = sel; - - if (sel && sel->current) - si_pm4_bind_state(rctx, ps, sel->current->pm4); - else - si_pm4_bind_state(rctx, ps, rctx->dummy_pixel_shader->pm4); + if (!sel || !sel->current) + sel = rctx->dummy_pixel_shader; + rctx->ps_shader = sel; + si_pm4_bind_state(rctx, ps, sel->current->pm4); rctx->b.flags |= R600_CONTEXT_INV_SHADER_CACHE; } |