Downgrade blend factor crash to warning (#7459)

* pica_to_vk: Downgrade assert to warning

* pica_to_gl: Downgrade unreachable to warning
This commit is contained in:
GPUCode 2024-02-23 01:43:44 +02:00 committed by GitHub
parent b5042a5257
commit d857743075
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View File

@ -148,8 +148,6 @@ inline GLenum BlendFunc(Pica::FramebufferRegs::BlendFactor factor) {
// Range check table for input // Range check table for input
if (index >= blend_func_table.size()) { if (index >= blend_func_table.size()) {
LOG_CRITICAL(Render_OpenGL, "Unknown blend factor {}", index); LOG_CRITICAL(Render_OpenGL, "Unknown blend factor {}", index);
UNREACHABLE();
return GL_ONE; return GL_ONE;
} }

View File

@ -96,7 +96,10 @@ inline vk::BlendFactor BlendFunc(Pica::FramebufferRegs::BlendFactor factor) {
}}; }};
const auto index = static_cast<std::size_t>(factor); const auto index = static_cast<std::size_t>(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]; return blend_func_table[index];
} }