vkd3d-shader/tpf: Propagate validation errors after parsing.

Also, trace the program when validation fails after parsing, mostly
to make debugging easier.
This commit is contained in:
Giovanni Mascellani 2024-09-27 13:29:22 +02:00 committed by Henri Verbeet
parent 0f91149260
commit 8acaa3a62c
Notes: Henri Verbeet 2024-09-30 21:06:59 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1130

View File

@ -2947,9 +2947,6 @@ int tpf_parse(const struct vkd3d_shader_compile_info *compile_info, uint64_t con
&& !sm4.has_control_point_phase && !sm4.p.failed)
shader_sm4_validate_default_phase_index_ranges(&sm4);
if (!sm4.p.failed)
vkd3d_shader_parser_validate(&sm4.p, config_flags);
if (sm4.p.failed)
{
WARN("Failed to parse shader.\n");
@ -2957,6 +2954,17 @@ int tpf_parse(const struct vkd3d_shader_compile_info *compile_info, uint64_t con
return VKD3D_ERROR_INVALID_SHADER;
}
if ((ret = vkd3d_shader_parser_validate(&sm4.p, config_flags)) < 0)
{
WARN("Failed to validate shader after parsing, ret %d.\n", ret);
if (TRACE_ON())
vkd3d_shader_trace(program);
vsir_program_cleanup(program);
return ret;
}
return VKD3D_OK;
}