[Fix] (MG_Util/GLSLTool): get rid of unnecessary whitespace removal

This commit is contained in:
2025-06-30 15:32:59 +08:00
parent a6bcded3e4
commit 067d517527
2 changed files with 168 additions and 173 deletions
@@ -281,7 +281,11 @@ namespace MG_GL::GL {
void LinkProgram(GLuint program) { void LinkProgram(GLuint program) {
MG_Util::Debug::LogD("glLinkProgram, program: %u", program); MG_Util::Debug::LogD("glLinkProgram, program: %u", program);
GLenum result = MG_State::FinalizeProgramPipeline(program); GLenum result = MG_State::FinalizeProgramPipeline(program);
if (result == GL_NO_ERROR) { if (result != GL_NO_ERROR) {
MG_State::SetError(result);
MG_Util::Debug::LogE("Error linking program: %s", MG_Util::Debug::GLEnumToString(result));
return;
}
auto& programInfo = MG_Diligent::g_ProgramMap[program]; auto& programInfo = MG_Diligent::g_ProgramMap[program];
auto& programObj = MG_State_T::programState->programs_[program]; auto& programObj = MG_State_T::programState->programs_[program];
@@ -447,10 +451,6 @@ namespace MG_GL::GL {
programObj.linked = true; programObj.linked = true;
programObj.linkStatus = GL_TRUE; programObj.linkStatus = GL_TRUE;
return;
}
MG_State::SetError(result);
MG_Util::Debug::LogE("Error linking program: %s", MG_Util::Debug::GLEnumToString(result));
} }
void UseProgram(GLuint program) { void UseProgram(GLuint program) {
-5
View File
@@ -558,11 +558,6 @@ namespace MG_Util::Program {
for (auto& span : removalSpans) { for (auto& span : removalSpans) {
source.erase(span.first, span.second); source.erase(span.first, span.second);
} }
source = std::regex_replace(
source,
std::regex(R"((\r\n|\n|\r){2,})"),
"$1"
);
} }
std::string uboBlock = "\nlayout(std140) uniform MG_DEFAULT_UBO\n{\n"; std::string uboBlock = "\nlayout(std140) uniform MG_DEFAULT_UBO\n{\n";