[Fix]: (MG_Util/ShaderTranspiler): add explicitFragmentOutLocations to program link attribs

This commit is contained in:
2025-11-13 12:20:07 +08:00
parent cf87891b35
commit 2878939712
2 changed files with 6 additions and 3 deletions
@@ -174,7 +174,7 @@ namespace MobileGL {
return std::unexpected(r); return std::unexpected(r);
} }
for (auto [name, loc]: attrib.explicitAttribLocations) { for (auto [name, loc]: attrib.explicitVertexInLocations) {
MGLOG_D("%s: got explicitly set - layout(location = %d) %s;", __func__, loc, name.c_str()); MGLOG_D("%s: got explicitly set - layout(location = %d) %s;", __func__, loc, name.c_str());
} }
@@ -183,7 +183,9 @@ namespace MobileGL {
for (unsigned stage = 0; stage < EShLangCount; stage++) { for (unsigned stage = 0; stage < EShLangCount; stage++) {
if (program->getIntermediate((EShLanguage)stage) == nullptr) if (program->getIntermediate((EShLanguage)stage) == nullptr)
continue; continue;
resolver = MakeUnique<TMglGlslIoResolver>(*program, (EShLanguage)stage, attrib.explicitAttribLocations); resolver = MakeUnique<TMglGlslIoResolver>(*program, (EShLanguage)stage,
attrib.explicitVertexInLocations,
attrib.explicitFragmentOutLocations);
break; break;
} }
auto ioMapper = UniquePtr<glslang::TIoMapper>(glslang::GetGlslIoMapper()); auto ioMapper = UniquePtr<glslang::TIoMapper>(glslang::GetGlslIoMapper());
+2 -1
View File
@@ -21,7 +21,8 @@ namespace MobileGL {
struct ProgramAttrib { struct ProgramAttrib {
Vector<SharedPtr<glslang::TShader>> shaders; Vector<SharedPtr<glslang::TShader>> shaders;
UnorderedMap<String, Uint> explicitAttribLocations; UnorderedMap<String, Uint> explicitVertexInLocations;
UnorderedMap<String, Uint> explicitFragmentOutLocations;
}; };
struct ProgramBinaryAttrib { struct ProgramBinaryAttrib {