From d857743075c2883f041c33b310b10b8b9615a5af Mon Sep 17 00:00:00 2001 From: GPUCode <47210458+GPUCode@users.noreply.github.com> Date: Fri, 23 Feb 2024 01:43:44 +0200 Subject: [PATCH] Downgrade blend factor crash to warning (#7459) * pica_to_vk: Downgrade assert to warning * pica_to_gl: Downgrade unreachable to warning --- src/video_core/renderer_opengl/pica_to_gl.h | 2 -- src/video_core/renderer_vulkan/pica_to_vk.h | 5 ++++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/video_core/renderer_opengl/pica_to_gl.h b/src/video_core/renderer_opengl/pica_to_gl.h index 15a53b771..fa9409465 100644 --- a/src/video_core/renderer_opengl/pica_to_gl.h +++ b/src/video_core/renderer_opengl/pica_to_gl.h @@ -148,8 +148,6 @@ inline GLenum BlendFunc(Pica::FramebufferRegs::BlendFactor factor) { // Range check table for input if (index >= blend_func_table.size()) { LOG_CRITICAL(Render_OpenGL, "Unknown blend factor {}", index); - UNREACHABLE(); - return GL_ONE; } diff --git a/src/video_core/renderer_vulkan/pica_to_vk.h b/src/video_core/renderer_vulkan/pica_to_vk.h index 6067c07ae..b0dfe891c 100644 --- a/src/video_core/renderer_vulkan/pica_to_vk.h +++ b/src/video_core/renderer_vulkan/pica_to_vk.h @@ -96,7 +96,10 @@ inline vk::BlendFactor BlendFunc(Pica::FramebufferRegs::BlendFactor factor) { }}; const auto index = static_cast(factor); - ASSERT_MSG(index < blend_func_table.size(), "Unknown blend factor {}", index); + if (index >= blend_func_table.size()) { + LOG_CRITICAL(Render_Vulkan, "Unknown blend factor {}", index); + return vk::BlendFactor::eOne; + } return blend_func_table[index]; }