From af73e166333bfd17aa193583f29e9985c6233a6b Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Thu, 6 Aug 2020 13:23:47 +0430 Subject: [PATCH] vkd3d-shader: Use vkd3d_shader_validate_compile_info() in vkd3d_shader_scan(). Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- libs/vkd3d-shader/vkd3d_shader_main.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d-shader/vkd3d_shader_main.c index 140bdd4c..ab086208 100644 --- a/libs/vkd3d-shader/vkd3d_shader_main.c +++ b/libs/vkd3d-shader/vkd3d_shader_main.c @@ -839,17 +839,8 @@ int vkd3d_shader_scan(const struct vkd3d_shader_compile_info *compile_info, char if (messages) *messages = NULL; - if (compile_info->type != VKD3D_SHADER_STRUCTURE_TYPE_COMPILE_INFO) - { - WARN("Invalid structure type %#x.\n", compile_info->type); - return VKD3D_ERROR_INVALID_ARGUMENT; - } - - if (compile_info->source_type != VKD3D_SHADER_SOURCE_DXBC_TPF) - { - WARN("Unsupported source type %#x.\n", compile_info->source_type); - return VKD3D_ERROR_INVALID_ARGUMENT; - } + if ((ret = vkd3d_shader_validate_compile_info(compile_info)) < 0) + return ret; if ((scan_descriptor_info = vkd3d_find_struct(compile_info->next, SCAN_DESCRIPTOR_INFO))) {