vkd3d-shader: Use vkd3d_shader_validate_compile_info() in vkd3d_shader_scan().

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2020-08-06 13:23:47 +04:30 committed by Alexandre Julliard
parent 805e13d975
commit af73e16633

View File

@ -839,17 +839,8 @@ int vkd3d_shader_scan(const struct vkd3d_shader_compile_info *compile_info, char
if (messages) if (messages)
*messages = NULL; *messages = NULL;
if (compile_info->type != VKD3D_SHADER_STRUCTURE_TYPE_COMPILE_INFO) if ((ret = vkd3d_shader_validate_compile_info(compile_info)) < 0)
{ return ret;
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 ((scan_descriptor_info = vkd3d_find_struct(compile_info->next, SCAN_DESCRIPTOR_INFO))) if ((scan_descriptor_info = vkd3d_find_struct(compile_info->next, SCAN_DESCRIPTOR_INFO)))
{ {