r600: move selecting shaders into earlier code.
authorDave Airlie <airlied@redhat.com>
Mon, 30 Nov 2015 01:14:26 +0000 (11:14 +1000)
committerDave Airlie <airlied@redhat.com>
Sun, 6 Dec 2015 23:58:59 +0000 (09:58 +1000)
select the ps/gs/vs in that order then process the results.

Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/r600/r600_state_common.c

index 68b1a4246c0869d0b07f0dde2b6d929008564f2a..64cb67a7b195a586c818b7f568550f832f1ed0d0 100644 (file)
@@ -1319,9 +1319,12 @@ static bool r600_update_derived_state(struct r600_context *rctx)
 
        update_gs_block_state(rctx, rctx->gs_shader != NULL);
 
-       if (rctx->gs_shader) {
+       if (rctx->gs_shader)
                SELECT_SHADER_OR_FAIL(gs);
 
+       SELECT_SHADER_OR_FAIL(vs);
+
+       if (rctx->gs_shader) {
                if (!rctx->shader_stages.geom_enable) {
                        rctx->shader_stages.geom_enable = true;
                        r600_mark_atom_dirty(rctx, &rctx->shader_stages.atom);
@@ -1336,8 +1339,6 @@ static bool r600_update_derived_state(struct r600_context *rctx)
                        rctx->b.streamout.enabled_stream_buffers_mask = rctx->gs_shader->current->gs_copy_shader->enabled_stream_buffers_mask;
                }
 
-               SELECT_SHADER_OR_FAIL(vs);
-
                /* vs_shader is used as ES */
                if (unlikely(vs_dirty || rctx->hw_shader_stages[R600_HW_STAGE_ES].shader != rctx->vs_shader->current)) {
                        update_shader_atom(ctx, &rctx->hw_shader_stages[R600_HW_STAGE_ES], rctx->vs_shader->current);
@@ -1350,8 +1351,6 @@ static bool r600_update_derived_state(struct r600_context *rctx)
                        r600_mark_atom_dirty(rctx, &rctx->shader_stages.atom);
                }
 
-               SELECT_SHADER_OR_FAIL(vs);
-
                if (unlikely(vs_dirty || rctx->hw_shader_stages[R600_HW_STAGE_VS].shader != rctx->vs_shader->current)) {
                        update_shader_atom(ctx, &rctx->hw_shader_stages[R600_HW_STAGE_VS], rctx->vs_shader->current);