Francisco Casas (@fcasas) commented about libs/vkd3d-shader/hlsl.c:
return hlsl_new_constant(ctx, hlsl_get_scalar_type(ctx, HLSL_TYPE_BOOL), &value, loc);
}
+/* Strings are opaque objects, so don't put anything in the constant. */ +struct hlsl_ir_node *hlsl_new_string_constant(struct hlsl_ctx *ctx, const struct vkd3d_shader_location *loc) +{
- struct hlsl_constant_value value;
- return hlsl_new_constant(ctx, hlsl_get_scalar_type(ctx, HLSL_TYPE_STRING), &value, loc);
+}
This gives a compiler warning: ``` vkd3d/libs/vkd3d-shader/hlsl.c: In function ‘hlsl_new_string_constant’: vkd3d/libs/vkd3d-shader/hlsl.c:1236:12: warning: ‘value’ may be used uninitialized [-Wmaybe-uninitialized] 1236 | return hlsl_new_constant(ctx, hlsl_get_scalar_type(ctx, HLSL_TYPE_STRING), &value, loc); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vkd3d/libs/vkd3d-shader/hlsl.c:1208:22: note: by argument 3 of type ‘const struct hlsl_constant_value *’ to ‘hlsl_new_constant’ declared here 1208 | struct hlsl_ir_node *hlsl_new_constant(struct hlsl_ctx *ctx, struct hlsl_type *type, | ^~~~~~~~~~~~~~~~~ vkd3d/libs/vkd3d-shader/hlsl.c:1235:32: note: ‘value’ declared here 1235 | struct hlsl_constant_value value; ```
My guess is that you want to initialize value to just zeroes. ```c struct hlsl_constant_value value = {}; ```