Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/hlsl.y:
- data_type = params->args[0]->data_type;
- if (data_type->base_type == HLSL_TYPE_BOOL || data_type->base_type == HLSL_TYPE_DOUBLE)
- {
struct vkd3d_string_buffer *string;
if ((string = hlsl_type_to_string(ctx, data_type)))
hlsl_error(ctx, loc, VKD3D_SHADER_ERROR_HLSL_INVALID_TYPE,
"Wrong type for argument 0 of asuint(): expected 'int', 'uint', 'float', or 'half', but got '%s'.",
string->buffer);
hlsl_release_string_buffer(ctx, string);
- }
- data_type = convert_numeric_type(ctx, data_type, HLSL_TYPE_UINT);
- operands[0] = params->args[0];
- if (!(expr = hlsl_new_expr(ctx, HLSL_OP1_REINTERPRET, data_type, operands, loc)))
If you use `add_expr()` you get for free the last todo test, because it automatically splits matrices.
(which made me notice that `hlsl_new_expr()` and `add_expr()` take parameters in a different order, and now I hate this fact)