[Mesa-dev] [PATCH 08/53] r600: add SET_NULL_SHADER macro.

Oded Gabbay oded.gabbay at gmail.com
Tue Dec 1 01:05:21 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>
>
> This is used to set a hw shader to NULL.
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>  src/gallium/drivers/r600/r600_state_common.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c
> index b107f8a..36afbd6 100644
> --- a/src/gallium/drivers/r600/r600_state_common.c
> +++ b/src/gallium/drivers/r600/r600_state_common.c
> @@ -1294,6 +1294,11 @@ static void r600_update_clip_state(struct r600_context *rctx,
>                         return false;                                   \
>         } while(0)
>
> +#define SET_NULL_SHADER(hw) do {                                               \
> +               if (rctx->hw_shader_stages[(hw)].shader)        \
> +                       update_shader_atom(ctx, &rctx->hw_shader_stages[(hw)], NULL); \
> +       } while (0)
> +
>  static bool r600_update_derived_state(struct r600_context *rctx)
>  {
>         struct pipe_context * ctx = (struct pipe_context*)rctx;
> @@ -1346,8 +1351,8 @@ static bool r600_update_derived_state(struct r600_context *rctx)
>                 }
>         } else {
>                 if (unlikely(rctx->hw_shader_stages[R600_HW_STAGE_GS].shader)) {
> -                       update_shader_atom(ctx, &rctx->hw_shader_stages[R600_HW_STAGE_GS], NULL);
> -                       update_shader_atom(ctx, &rctx->hw_shader_stages[R600_HW_STAGE_ES], NULL);
> +                       SET_NULL_SHADER(R600_HW_STAGE_GS);
> +                       SET_NULL_SHADER(R600_HW_STAGE_ES);
>                         rctx->shader_stages.geom_enable = false;
>                         r600_mark_atom_dirty(rctx, &rctx->shader_stages.atom);
>                 }
> --
> 2.5.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reviewed-by: Oded Gabbay <oded.gabbay at gmail.com>


More information about the mesa-dev mailing list