From 507e8644ae38ddd16b8b824b3c7250434ddec9a4 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sat, 12 Mar 2022 16:45:41 -0600 Subject: [PATCH] vkd3d-shader: Reuse the existing parser for scanning in compile_dxbc_tpf(). --- libs/vkd3d-shader/vkd3d_shader_main.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d-shader/vkd3d_shader_main.c index b2b885aa..11e32ab0 100644 --- a/libs/vkd3d-shader/vkd3d_shader_main.c +++ b/libs/vkd3d-shader/vkd3d_shader_main.c @@ -1181,18 +1181,20 @@ static int compile_dxbc_tpf(const struct vkd3d_shader_compile_info *compile_info scan_descriptor_info.next = scan_info.next; scan_info.next = &scan_descriptor_info; - if ((ret = scan_dxbc(&scan_info, message_context)) < 0) - return ret; - if ((ret = vkd3d_shader_sm4_parser_create(compile_info, message_context, &parser)) < 0) { WARN("Failed to initialise shader parser.\n"); - vkd3d_shader_free_scan_descriptor_info(&scan_descriptor_info); return ret; } vkd3d_shader_dump_shader(compile_info->source_type, parser->shader_version.type, &compile_info->source); + if ((ret = scan_with_parser(&scan_info, message_context, parser)) < 0) + { + vkd3d_shader_parser_destroy(parser); + return ret; + } + if (compile_info->target_type == VKD3D_SHADER_TARGET_D3D_ASM) { vkd3d_shader_free_scan_descriptor_info(&scan_descriptor_info);