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

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:51 +02:00 committed by Alexandre Julliard
parent 661570254d
commit 12190ee3a9
4 changed files with 9 additions and 8 deletions

View File

@ -1110,12 +1110,13 @@ static struct vkd3d_shader_src_param *get_src_param(struct vkd3d_sm4_data *priv)
return &e->param;
}
void shader_sm4_read_header(void *data, const DWORD **ptr, struct vkd3d_shader_version *shader_version)
void shader_sm4_read_header(struct vkd3d_shader_parser *parser,
const uint32_t **ptr, struct vkd3d_shader_version *shader_version)
{
struct vkd3d_sm4_data *priv = data;
struct vkd3d_sm4_data *sm4 = parser->data;
*ptr = priv->start;
*shader_version = priv->shader_version;
*ptr = sm4->start;
*shader_version = sm4->shader_version;
}
static bool shader_sm4_read_reg_idx(struct vkd3d_sm4_data *priv, const DWORD **ptr, const DWORD *end,

View File

@ -1831,7 +1831,7 @@ enum vkd3d_result vkd3d_dxbc_binary_to_text(struct vkd3d_shader_parser *parser,
vkd3d_string_buffer_init(buffer);
shader_version = &compiler.shader_version;
shader_sm4_read_header(parser->data, &ptr, shader_version);
shader_sm4_read_header(parser, &ptr, shader_version);
vkd3d_string_buffer_printf(buffer, "%s%s_%u_%u%s\n", compiler.colours.version,
shader_get_type_prefix(shader_version->type), shader_version->major,
shader_version->minor, compiler.colours.reset);

View File

@ -388,7 +388,7 @@ static int vkd3d_shader_parser_init(struct vkd3d_shader_parser *parser,
return VKD3D_ERROR_INVALID_ARGUMENT;
}
shader_sm4_read_header(parser->data, &parser->ptr, &parser->shader_version);
shader_sm4_read_header(parser, &parser->ptr, &parser->shader_version);
return VKD3D_OK;
}

View File

@ -891,8 +891,8 @@ struct vkd3d_shader_message_context;
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);
void shader_sm4_free(struct vkd3d_shader_parser *parser);
void shader_sm4_read_header(void *data, const DWORD **ptr,
struct vkd3d_shader_version *shader_version);
void shader_sm4_read_header(struct vkd3d_shader_parser *parser,
const uint32_t **ptr, struct vkd3d_shader_version *shader_version);
void shader_sm4_read_instruction(void *data, const DWORD **ptr,
struct vkd3d_shader_instruction *ins);
bool shader_sm4_is_end(void *data, const DWORD **ptr);