[Fix] (Diligent/PSO): Miscellaneous fix.

This commit is contained in:
BZLZHH
2025-06-15 11:52:34 +08:00
parent df95930481
commit 6a1b1a5ed9
2 changed files with 6 additions and 10 deletions
@@ -371,7 +371,7 @@ namespace MG_Diligent {
shaderSource = MG_Util::Program::BindInputLayoutLocationsForGLSL(spirv, shaderSource = MG_Util::Program::BindInputLayoutLocationsForGLSL(spirv,
programObj.attribLocations); programObj.attribLocations);
MG_Util::Program::RenameGLSLBuiltinsForVulkan(shaderSource); // MG_Util::Program::RenameGLSLBuiltinsForVulkan(shaderSource);
} else { } else {
shaderSource = it->second.source; shaderSource = it->second.source;
} }
@@ -381,17 +381,13 @@ namespace MG_Diligent {
MG_Util::Program::GenerateDefaultUBOForGLSL_Multi(shaderSourcesMap, programInfo.uniformBufferNames); MG_Util::Program::GenerateDefaultUBOForGLSL_Multi(shaderSourcesMap, programInfo.uniformBufferNames);
for (auto shader : programInfo.AttachedShaders) { for (auto shaderId : programInfo.AttachedShadersID) {
GLuint shaderId = 0; auto shader = MG_Diligent::g_ShaderMap[shaderId];
for (auto const& [key, val] : MG_Diligent::g_ShaderMap) {
if (val == shader) {
shaderId = key;
break;
}
}
MG_Util::Debug::LogD("Processing shader ID: %u", shaderId); MG_Util::Debug::LogD("Processing shader ID: %u", shaderId);
auto& shaderObj = MG_State_T::programState->shaders_[shaderId]; auto& shaderObj = MG_State_T::programState->shaders_[shaderId];
MG_Util::Debug::LogD("Shader source for %u before SPIR-V compilation:\n%s", shaderId,
shaderSourcesMap[shaderId].c_str());
std::string compilationLog; std::string compilationLog;
auto spirv = auto spirv =
+1 -1
View File
@@ -465,7 +465,7 @@ void ProgramState::CleanupShaders_() {
} }
if (!inUse) { if (!inUse) {
MG_Util::Debug::LogD("MG_State: Program: CleanupShaders_ deleting shader %u", it->first); MG_Util::Debug::LogD("MG_State: Program: CleanupShaders_ deleting shader %u", it->first);
freeShaderIds_.insert(it->first); // freeShaderIds_.insert(it->first);
it = shaders_.erase(it); it = shaders_.erase(it);
continue; continue;
} }