[Mesa-dev] [PATCH 2/2] softpipe: handle 32-bit bitfield inserts

Roland Scheidegger sroland at vmware.com
Fri Mar 22 01:26:36 UTC 2019


Am 21.03.19 um 05:16 schrieb Dave Airlie:
> From: Dave Airlie <airlied at redhat.com>
> 
> Fixes piglits if ARB_gpu_shader5 is enabled
> ---
>  src/gallium/auxiliary/tgsi/tgsi_exec.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c
> index c93e4e26e40..78159fc1d9f 100644
> --- a/src/gallium/auxiliary/tgsi/tgsi_exec.c
> +++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c
> @@ -4999,10 +4999,14 @@ micro_bfi(union tgsi_exec_channel *dst,
>  {
>     int i;
>     for (i = 0; i < 4; i++) {
> -      int width = src3->u[i] & 0x1f;
> +      int width = src3->u[i];
>        int offset = src2->u[i] & 0x1f;
> -      int bitmask = ((1 << width) - 1) << offset;
> -      dst->u[i] = ((src1->u[i] << offset) & bitmask) | (src0->u[i] & ~bitmask);
> +      if (width == 32) {
> +         dst->u[i] = src1->u[i];
> +      } else {
> +         int bitmask = ((1 << width) - 1) << offset;
> +         dst->u[i] = ((src1->u[i] << offset) & bitmask) | (src0->u[i] & ~bitmask);
> +      }
>     }
>  }
>  
> 

I think this is a really highly annoying difference between d3d11 and GL
there for bitfieldInsert/Extract...
But in any case, all 4 patches look good to me.
Reviewed-by: Roland Scheidegger <sroland at vmware.com>


More information about the mesa-dev mailing list