On Wed May 31 20:16:16 2023 +0000, Nikolay Sivov wrote:
It does not accept coords.node / swizzle, because types are different, I think.
Just to summarize what we discussed in IRC: there are few hlsl_ir_expr ops that are allowed to handle different types of arguments and return value. My understanding is that HLSL_OP2_DIV is not one of them (like, e.g. HLSL_OP2_DOT), when replacing this hlsl_new_expr() call with a call to hlsl_new_binary_expr(), the assertion should hold true.
This is not happening however, because `load->coords.node` is float4 and the swizzle is float2 (or float3 for tex3Dproj). What is missing is to create a new .XY (or .XYZ) swizzle for `load->coords.node` and pass it as arg1 instead of `load->coords.node` directly.