[Mesa-dev] [PATCH 5/6] radeonsi: fix TEX writemask

Michel Dänzer michel at daenzer.net
Wed Aug 1 22:51:18 PDT 2012


On Mit, 2012-08-01 at 23:28 +0200, Christian König wrote: 
> Using the writemask in the sampler results in packet
> VGPRS.

What does that mean?


> For now just sample all components and let llvm chose the right one.
> 
> Signed-off-by: Christian König <deathsimple at vodafone.de>
> ---
>  src/gallium/drivers/radeonsi/radeonsi_shader.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/gallium/drivers/radeonsi/radeonsi_shader.c b/src/gallium/drivers/radeonsi/radeonsi_shader.c
> index 522016e..c19a4c2 100644
> --- a/src/gallium/drivers/radeonsi/radeonsi_shader.c
> +++ b/src/gallium/drivers/radeonsi/radeonsi_shader.c
> @@ -519,8 +519,8 @@ static void tex_fetch_args(
>  	LLVMValueRef offset;
>  
>  	/* WriteMask */
> -	emit_data->args[0] = lp_build_const_int32(bld_base->base.gallivm,
> -				emit_data->inst->Dst[0].Register.WriteMask);
> +	/* XXX: should be optimized using emit_data->inst->Dst[0].Register.WriteMask*/
> +	emit_data->args[0] = lp_build_const_int32(bld_base->base.gallivm, 0xf);

Couldn't this incorrectly clobber components of the destination which
were supposed to be masked?


-- 
Earthling Michel Dänzer           |                   http://www.amd.com
Libre software enthusiast         |          Debian, X and DRI developer


More information about the mesa-dev mailing list