tests/shader_runner_vulkan: Avoid using ok() for shader compilation failues in create_graphics_pipeline().

Using ok() may result in todo's succeeding when create_shader_stage()
succeeds, but vkCreateGraphicsPipelines() fails. There's not much point
in using ok() here in the first place though, because ultimately the
draw operation is going to fail when shader compilation failed.
This commit is contained in:
Giovanni Mascellani 2024-11-05 22:34:15 +01:00 committed by Henri Verbeet
parent 94900131a8
commit a89ceb6590
Notes: Henri Verbeet 2024-11-11 15:59:39 +01:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1252

View File

@ -602,9 +602,7 @@ static VkPipeline create_graphics_pipeline(struct vulkan_shader_runner *runner,
if (!ret)
{
/* We ok() only when failing here, so that we don't result in a "todo
* succeeded" when the todo applies to pipeline linking. */
todo_if (runner->r.is_todo) ok(false, "Failed to compile shaders.\n");
trace("Failed to compile HLSL shader(s).\n");
return VK_NULL_HANDLE;
}
@ -623,9 +621,9 @@ static VkPipeline create_graphics_pipeline(struct vulkan_shader_runner *runner,
if (runner->r.shader_source[SHADER_TYPE_GS])
ret &= create_shader_stage(runner, &stage_desc[stage_count++], SHADER_TYPE_GS, VK_SHADER_STAGE_GEOMETRY_BIT);
todo_if (runner->r.is_todo) ok(ret, "Failed to compile shaders.\n");
if (!ret)
{
trace("Failed to compile SPIR-V shader(s).\n");
for (i = 0; i < ARRAY_SIZE(stage_desc); ++i)
VK_CALL(vkDestroyShaderModule(device, stage_desc[i].module, NULL));
return VK_NULL_HANDLE;