[Mesa-dev] [PATCH 06/53] r600: move selecting shaders into earlier code.

Oded Gabbay oded.gabbay at gmail.com
Mon Nov 30 04:33:14 PST 2015


On Mon, Nov 30, 2015 at 8:20 AM, Dave Airlie <airlied at gmail.com> wrote:
> From: Dave Airlie <airlied at redhat.com>
>
> select the ps/gs/vs in that order then process the results.

Is there a chance the statements executed inside the "if
(rctx->gs_shader) {" may affect the result of r600_shader_select (and
hence SELECT_SHADER_OR_FAIL) ?
If so, then moving the macro before the if might be problematic.

       Oded


>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>  src/gallium/drivers/r600/r600_state_common.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c
> index b6d739d..6042976 100644
> --- a/src/gallium/drivers/r600/r600_state_common.c
> +++ b/src/gallium/drivers/r600/r600_state_common.c
> @@ -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);
>
> --
> 2.5.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list