Francisco Casas (@fcasas) commented about libs/vkd3d-shader/hlsl.y:
+ if (dim == HLSL_SAMPLER_DIM_1D) + { + struct hlsl_constant_value half_value; + struct hlsl_ir_load *load; + struct hlsl_ir_node *half; + struct hlsl_ir_var *var; + unsigned int idx = 0; + + if (!(var = hlsl_new_synthetic_var(ctx, "coords", hlsl_get_vector_type(ctx, HLSL_TYPE_FLOAT, 2), loc))) + return false; + + initialize_var_components(ctx, params->instrs, var, &idx, coords); + if (shader_profile_version_ge(ctx, 4, 0)) + { + half_value.u[0].f = 0.5f; + if (!(half = hlsl_new_constant(ctx, hlsl_get_scalar_type(ctx, HLSL_TYPE_FLOAT), &half_value, loc))) I think you can use hlsl_new_float_constant() here.
-- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/339#note_45135