From 53a0c3726c311ea01846f83afa670972f502b619 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Tue, 18 Oct 2022 00:07:41 +0200 Subject: [PATCH] [dxvk] Don't crash immediately on pipeline library compile error Things will blow up down the line but there's no good reason to crash immediately. Also ignore returned pipeline on error so we'll always return null. --- src/dxvk/dxvk_shader.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/dxvk/dxvk_shader.cpp b/src/dxvk/dxvk_shader.cpp index 9bacd838f..baf2ca2a1 100644 --- a/src/dxvk/dxvk_shader.cpp +++ b/src/dxvk/dxvk_shader.cpp @@ -1130,9 +1130,9 @@ namespace dxvk { VkResult vr = vk->vkCreateGraphicsPipelines(vk->device(), VK_NULL_HANDLE, 1, &info, nullptr, &pipeline); if (vr && !(flags & VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT)) - throw DxvkError(str::format("DxvkShaderPipelineLibrary: Failed to create vertex shader pipeline: ", vr)); + Logger::err(str::format("DxvkShaderPipelineLibrary: Failed to create vertex shader pipeline: ", vr)); - return pipeline; + return vr ? VK_NULL_HANDLE : pipeline; } @@ -1201,9 +1201,9 @@ namespace dxvk { VkResult vr = vk->vkCreateGraphicsPipelines(vk->device(), VK_NULL_HANDLE, 1, &info, nullptr, &pipeline); if (vr && !(flags & VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT)) - throw DxvkError(str::format("DxvkShaderPipelineLibrary: Failed to create fragment shader pipeline: ", vr)); + Logger::err(str::format("DxvkShaderPipelineLibrary: Failed to create fragment shader pipeline: ", vr)); - return pipeline; + return vr ? VK_NULL_HANDLE : pipeline; } @@ -1223,9 +1223,9 @@ namespace dxvk { VkResult vr = vk->vkCreateComputePipelines(vk->device(), VK_NULL_HANDLE, 1, &info, nullptr, &pipeline); if (vr && !(flags & VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT)) - throw DxvkError(str::format("DxvkShaderPipelineLibrary: Failed to create compute shader pipeline: ", vr)); + Logger::err(str::format("DxvkShaderPipelineLibrary: Failed to create compute shader pipeline: ", vr)); - return pipeline; + return vr ? VK_NULL_HANDLE : pipeline; }