[PATCH vkd3d 07/13] vkd3d-shader/hlsl: Introduce a sm4_dst_from_node() helper.
Giovanni Mascellani
gmascellani at codeweavers.com
Wed Dec 22 03:49:12 CST 2021
Hi,
On 22/12/21 00:08, Zebediah Figura wrote:
> @@ -893,13 +893,19 @@ static void sm4_register_from_node(struct sm4_register *reg, unsigned int *write
> assert(instr->reg.allocated);
> reg->type = VKD3D_SM4_RT_TEMP;
> reg->dim = VKD3D_SM4_DIMENSION_VEC4;
> - if (swizzle_type)
> - *swizzle_type = VKD3D_SM4_SWIZZLE_VEC4;
> + *swizzle_type = VKD3D_SM4_SWIZZLE_VEC4;
> reg->idx[0] = instr->reg.id;
> reg->idx_count = 1;
> *writemask = instr->reg.writemask;
> }
>
> +static void sm4_dst_from_node(struct sm4_dst_register *dst, const struct hlsl_ir_node *instr)
> +{
> + unsigned int swizzle_type;
> +
> + sm4_register_from_node(&dst->reg, &dst->writemask, &swizzle_type, instr);
> +}
I am fine either way, but I'd have leaved the possibility for
swizzle_type to be NULL, so that the programmer's intention of ignoring
that output is more evident.
Giovanni.
More information about the wine-devel
mailing list