[Mesa-dev] [PATCH] st/pbo: select the right swizzle for instance IDs

Marek Olšák maraeo at gmail.com
Thu Apr 6 15:14:00 UTC 2017


Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Thu, Apr 6, 2017 at 4:50 PM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
>
> The system value only has an X component, and radeonsi started
> checking that in debug builds.
>
> Reported-by: Michel Dänzer <michel.daenzer at amd.com>
> Fixes: 4cf29427770f ("radeonsi: support 64-bit system values")
> ---
>  src/mesa/state_tracker/st_pbo.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/mesa/state_tracker/st_pbo.c b/src/mesa/state_tracker/st_pbo.c
> index 2c63c09..1ded583 100644
> --- a/src/mesa/state_tracker/st_pbo.c
> +++ b/src/mesa/state_tracker/st_pbo.c
> @@ -326,21 +326,22 @@ st_pbo_create_vs(struct st_context *st)
>     /* out_pos = in_pos */
>     ureg_MOV(ureg, out_pos, in_pos);
>
>     if (st->pbo.layers) {
>        if (st->pbo.use_gs) {
>           /* out_pos.z = i2f(gl_InstanceID) */
>           ureg_I2F(ureg, ureg_writemask(out_pos, TGSI_WRITEMASK_Z),
>                          ureg_scalar(in_instanceid, TGSI_SWIZZLE_X));
>        } else {
>           /* out_layer = gl_InstanceID */
> -         ureg_MOV(ureg, out_layer, in_instanceid);
> +         ureg_MOV(ureg, ureg_writemask(out_layer, TGSI_WRITEMASK_X),
> +                        ureg_scalar(in_instanceid, TGSI_SWIZZLE_X));
>        }
>     }
>
>     ureg_END(ureg);
>
>     return ureg_create_shader_and_destroy(ureg, st->pipe);
>  }
>
>  void *
>  st_pbo_create_gs(struct st_context *st)
> --
> 2.9.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list