Francisco Casas (@fcasas) commented about libs/vkd3d-shader/dxil.c:
return NULL;
}
-static enum vkd3d_result sm6_parser_init(struct sm6_parser *sm6, const uint32_t *byte_code, size_t byte_code_size,
const char *source_name, struct vkd3d_shader_message_context *message_context)
+static enum vkd3d_result sm6_parser_init(struct sm6_parser *sm6, const char *source_name,
struct vkd3d_shader_message_context *message_context, struct dxbc_shader_desc *dxbc_desc)
I am not fond of passing `dxbc_desc` as a parameter and use it far later to initialize the signatures in `sm6->p.program`. It may be hard to see from outside the function that `dxcb_desc` will be lending its signatures to `sm6->p.program` and be memset to 0. Also, any error before `dxbc_desc` lends the signatures to `sm6->p.program` leaks these signatures.
How about creating `dxbc_desc` inside `sm6_parser_init()` right before lending the signatures? This would require passing the whole `compile_info` as a parameter and also move the 32-bit alignment there.