From ee29a397daa9c22d11dc438bd56429b851ca063a Mon Sep 17 00:00:00 2001 From: BZLZHH Date: Sat, 21 Jun 2025 19:35:16 +0800 Subject: [PATCH] [Fix] (Diligent/PSO): Use GLSL For Vulkan mode somewhere. --- MG/MG_GL/Implementations/GL/Drawing/GL_Drawing.cpp | 7 ++++++- MG/MG_GL/Implementations/GL/Program/GL_Program.cpp | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/MG/MG_GL/Implementations/GL/Drawing/GL_Drawing.cpp b/MG/MG_GL/Implementations/GL/Drawing/GL_Drawing.cpp index 64ffb72b..1b7f713a 100644 --- a/MG/MG_GL/Implementations/GL/Drawing/GL_Drawing.cpp +++ b/MG/MG_GL/Implementations/GL/Drawing/GL_Drawing.cpp @@ -249,7 +249,12 @@ namespace MG_GL::GL { auto& programInfo = MG_Diligent::g_ProgramMap[program]; auto& programObj = MG_State_T::programState->programs_[program]; - if (programObj.uniformValues.empty() || !programInfo.pDefaultUBO) { + if (!programInfo.pDefaultUBO) { + MG_Util::Debug::LogE("Program %u does not have a default UBO. Skipping uniform update.", program); + return; + } + if (programObj.uniformValues.empty()) { + MG_Util::Debug::LogE("Program %u has no uniforms. Skipping uniform update.", program); return; } diff --git a/MG/MG_GL/Implementations/GL/Program/GL_Program.cpp b/MG/MG_GL/Implementations/GL/Program/GL_Program.cpp index 72db55e7..1b1eb033 100644 --- a/MG/MG_GL/Implementations/GL/Program/GL_Program.cpp +++ b/MG/MG_GL/Implementations/GL/Program/GL_Program.cpp @@ -61,7 +61,8 @@ namespace MG_GL::GL { auto spirv = MG_Util::Program::CompileGLSLToSPIRV( MG_State_T::programState->shaders_[reflectionShaderId].type, itSource->second, - infoLog + infoLog, + true ); if (spirv.empty()) { MG_Util::Debug::LogE("GLSL to SPIR-V compilation failed for shader %u: %s", reflectionShaderId, infoLog.c_str());