From a129206e7ef9c7815fce26f7447fe5354fde803a Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Wed, 1 Sep 2021 15:45:08 +0200 Subject: [PATCH] vkd3d-shader: Pass a vkd3d_shader_parser structure to vkd3d_shader_trace(). Mostly to avoid passing around void pointers. Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- libs/vkd3d-shader/trace.c | 4 ++-- libs/vkd3d-shader/vkd3d_shader_main.c | 10 +--------- libs/vkd3d-shader/vkd3d_shader_private.h | 10 +++++++++- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/libs/vkd3d-shader/trace.c b/libs/vkd3d-shader/trace.c index 26bc7885..78ec1c18 100644 --- a/libs/vkd3d-shader/trace.c +++ b/libs/vkd3d-shader/trace.c @@ -1900,12 +1900,12 @@ enum vkd3d_result vkd3d_dxbc_binary_to_text(void *data, return result; } -void vkd3d_shader_trace(void *data) +void vkd3d_shader_trace(struct vkd3d_shader_parser *parser) { const char *p, *q, *end; struct vkd3d_shader_code code; - if (vkd3d_dxbc_binary_to_text(data, NULL, &code) != VKD3D_OK) + if (vkd3d_dxbc_binary_to_text(parser->data, NULL, &code) != VKD3D_OK) return; end = (const char *)code.code + code.size; diff --git a/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d-shader/vkd3d_shader_main.c index e28cfad8..0cfe1eaf 100644 --- a/libs/vkd3d-shader/vkd3d_shader_main.c +++ b/libs/vkd3d-shader/vkd3d_shader_main.c @@ -367,14 +367,6 @@ void vkd3d_shader_dump_shader(enum vkd3d_shader_source_type source_type, shader_get_source_type_suffix(source_type), shader->code, shader->size); } -struct vkd3d_shader_parser -{ - struct vkd3d_shader_desc shader_desc; - struct vkd3d_shader_version shader_version; - void *data; - const DWORD *ptr; -}; - static int vkd3d_shader_parser_init(struct vkd3d_shader_parser *parser, const struct vkd3d_shader_compile_info *compile_info, struct vkd3d_shader_message_context *message_context) { @@ -960,7 +952,7 @@ static int scan_dxbc(const struct vkd3d_shader_compile_info *compile_info, } if (TRACE_ON()) - vkd3d_shader_trace(parser.data); + vkd3d_shader_trace(&parser); while (!shader_sm4_is_end(parser.data, &parser.ptr)) { diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index e195c12a..6c40efa9 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -874,7 +874,15 @@ static inline bool vkd3d_shader_register_is_output(const struct vkd3d_shader_reg return reg->type == VKD3DSPR_OUTPUT || reg->type == VKD3DSPR_COLOROUT; } -void vkd3d_shader_trace(void *data); +struct vkd3d_shader_parser +{ + struct vkd3d_shader_desc shader_desc; + struct vkd3d_shader_version shader_version; + void *data; + const uint32_t *ptr; +}; + +void vkd3d_shader_trace(struct vkd3d_shader_parser *parser); const char *shader_get_type_prefix(enum vkd3d_shader_type type);