[PATCH vkd3d 1/6] vkd3d-shader/hlsl: Write SM4 sample instructions.

Francisco Casas fcasas at codeweavers.com
Wed Dec 1 08:35:33 CST 2021


Hi,

> + instr.srcs[1].swizzle = hlsl_map_swizzle(hlsl_swizzle_from_writemask(writemask),
> instr.dsts[0].writemask);
> +
> + sm4_register_from_deref(ctx, &instr.srcs[2].reg, &writemask,
> + &instr.srcs[1].swizzle_type, sampler, sampler->var->data_type);
> +
> + instr.src_count = 3;

Probably
&instr.srcs[1].swizzle_type
shall be
&instr.srcs[2].swizzle_type
there.

>Here you pass the swizzle_type field to sm4_register_from_deref, as 
>write_sm4_ld already does. However, it seems that 
>sm4_register_from_deref currently ignores swizzle_type in its texture 
>branch, so that's going to remain uninitialized (swizzle_type is also 
>ignored in another branch of sm4_register_from_deref).

I missed that. I think they weren't explicitly handled on master. 
I will make them default to VKD3D_SM4_SWIZZLE_VEC4 on an upcoming patch,
probably after Mystral's big batch.



More information about the wine-devel mailing list