[PATCH vkd3d v2 07/10] vkd3d-shader/hlsl: Support complex numeric initializers.

Giovanni Mascellani gmascellani at codeweavers.com
Wed Jan 12 10:48:07 CST 2022


Hi again,

On 12/01/22 17:35, Giovanni Mascellani wrote:
> In other words, it seems that here you have to test for 
> "v->initializer.args_count == 1", not "size == 1". But do your own 
> research.

Actually, I noticed that this shader does not compile on native:

---
float4 main() : SV_TARGET
{
     float3 x = {float4(71, 72, 73, 74)};
     return float4(x, 74);
}
---

(the only difference with my previous email is the pair of braces around 
the initializer)

So it seems that the condition you want to discriminate on is whether 
the initializer is specified as a list (in which case you have to fully 
unpack and match in order) or as a single object (in which case you 
treat it as an assignment). I guess, at least.

However, I think we sometimes tolerate being more permissive than 
native, so maybe you can ignore this corner case. Senior developers will 
tell.

Giovanni.



More information about the wine-devel mailing list