vkd3d-shader: Pass a vkd3d_shader_parser structure to shader_sm4_free().

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2021-09-02 14:35:50 +02:00 committed by Alexandre Julliard
parent ce07710f49
commit 661570254d
3 changed files with 7 additions and 7 deletions

View File

@ -1075,17 +1075,17 @@ void *shader_sm4_init(const DWORD *byte_code, size_t byte_code_size,
return priv; return priv;
} }
void shader_sm4_free(void *data) void shader_sm4_free(struct vkd3d_shader_parser *parser)
{ {
struct vkd3d_shader_src_param_entry *e1, *e2; struct vkd3d_shader_src_param_entry *e1, *e2;
struct vkd3d_sm4_data *priv = data; struct vkd3d_sm4_data *sm4 = parser->data;
list_move_head(&priv->src_free, &priv->src); list_move_head(&sm4->src_free, &sm4->src);
LIST_FOR_EACH_ENTRY_SAFE(e1, e2, &priv->src_free, struct vkd3d_shader_src_param_entry, entry) LIST_FOR_EACH_ENTRY_SAFE(e1, e2, &sm4->src_free, struct vkd3d_shader_src_param_entry, entry)
{ {
vkd3d_free(e1); vkd3d_free(e1);
} }
vkd3d_free(priv); vkd3d_free(sm4);
} }
static struct vkd3d_shader_src_param *get_src_param(struct vkd3d_sm4_data *priv) static struct vkd3d_shader_src_param *get_src_param(struct vkd3d_sm4_data *priv)

View File

@ -394,7 +394,7 @@ static int vkd3d_shader_parser_init(struct vkd3d_shader_parser *parser,
static void vkd3d_shader_parser_destroy(struct vkd3d_shader_parser *parser) static void vkd3d_shader_parser_destroy(struct vkd3d_shader_parser *parser)
{ {
shader_sm4_free(parser->data); shader_sm4_free(parser);
free_shader_desc(&parser->shader_desc); free_shader_desc(&parser->shader_desc);
} }

View File

@ -890,7 +890,7 @@ struct vkd3d_shader_message_context;
void *shader_sm4_init(const DWORD *byte_code, size_t byte_code_size, void *shader_sm4_init(const DWORD *byte_code, size_t byte_code_size,
const struct vkd3d_shader_signature *output_signature, struct vkd3d_shader_message_context *message_context); const struct vkd3d_shader_signature *output_signature, struct vkd3d_shader_message_context *message_context);
void shader_sm4_free(void *data); void shader_sm4_free(struct vkd3d_shader_parser *parser);
void shader_sm4_read_header(void *data, const DWORD **ptr, void shader_sm4_read_header(void *data, const DWORD **ptr,
struct vkd3d_shader_version *shader_version); struct vkd3d_shader_version *shader_version);
void shader_sm4_read_instruction(void *data, const DWORD **ptr, void shader_sm4_read_instruction(void *data, const DWORD **ptr,