[Mesa-dev] [PATCH] st/mesa: fix XPD lowering - don't read dst
Brian Paul
brianp at vmware.com
Mon Aug 28 21:40:05 UTC 2017
Reviewed-by: Brian Paul <brianp at vmware.com>
On 08/28/2017 03:30 PM, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
>
> Bugzilla: https://urldefense.proofpoint.com/v2/url?u=https-3A__bugs.freedesktop.org_show-5Fbug.cgi-3Fid-3D102461&d=DwIGaQ&c=uilaK90D4TOVoH58JNXRgQ&r=Ie7_encNUsqxbSRbqbNgofw0ITcfE8JKfaUjIQhncGA&m=3xi9WRUmX1JlmtpmFjIRCRCCYMQXcJg1WwPpphdDFzQ&s=F_7J8ekr4Msq1-gu4mt4ZhlXh6TLKP4vWkM4O_M39jc&e=
> ---
> src/mesa/state_tracker/st_mesa_to_tgsi.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c
> index 916f7fa..fa9fa44 100644
> --- a/src/mesa/state_tracker/st_mesa_to_tgsi.c
> +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c
> @@ -555,33 +555,36 @@ compile_instruction(
> src, num_src );
> return;
>
> case OPCODE_SCS:
> ureg_COS(ureg, ureg_writemask(dst[0], TGSI_WRITEMASK_X),
> ureg_scalar(src[0], TGSI_SWIZZLE_X));
> ureg_SIN(ureg, ureg_writemask(dst[0], TGSI_WRITEMASK_Y),
> ureg_scalar(src[0], TGSI_SWIZZLE_X));
> break;
>
> - case OPCODE_XPD:
> - ureg_MUL(ureg, ureg_writemask(dst[0], TGSI_WRITEMASK_XYZ),
> + case OPCODE_XPD: {
> + struct ureg_dst tmp = ureg_DECL_temporary(ureg);
> +
> + ureg_MUL(ureg, ureg_writemask(tmp, TGSI_WRITEMASK_XYZ),
> ureg_swizzle(src[0], TGSI_SWIZZLE_Y, TGSI_SWIZZLE_Z,
> TGSI_SWIZZLE_X, 0),
> ureg_swizzle(src[1], TGSI_SWIZZLE_Z, TGSI_SWIZZLE_X,
> TGSI_SWIZZLE_Y, 0));
> ureg_MAD(ureg, ureg_writemask(dst[0], TGSI_WRITEMASK_XYZ),
> ureg_swizzle(src[0], TGSI_SWIZZLE_Z, TGSI_SWIZZLE_X,
> TGSI_SWIZZLE_Y, 0),
> ureg_negate(ureg_swizzle(src[1], TGSI_SWIZZLE_Y,
> TGSI_SWIZZLE_Z, TGSI_SWIZZLE_X, 0)),
> - ureg_src(dst[0]));
> + ureg_src(tmp));
> break;
> + }
>
> case OPCODE_RSQ:
> ureg_RSQ( ureg, dst[0], ureg_abs(src[0]) );
> break;
>
> case OPCODE_ABS:
> ureg_MOV(ureg, dst[0], ureg_abs(src[0]));
> break;
>
> case OPCODE_SUB:
>
More information about the mesa-dev
mailing list