From a89ceb659000718a354289da2583c3669a3b7ef5 Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Tue, 5 Nov 2024 22:34:15 +0100 Subject: [PATCH] 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. --- tests/shader_runner_vulkan.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/shader_runner_vulkan.c b/tests/shader_runner_vulkan.c index 079af6bf..45854ec6 100644 --- a/tests/shader_runner_vulkan.c +++ b/tests/shader_runner_vulkan.c @@ -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;