mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-10 21:28:32 +09:00
[Fix] (MG_Test/Program): fix hardcoded stage-index relationship
This commit is contained in:
@@ -112,6 +112,12 @@ namespace MobileGL {
|
||||
|
||||
Vector<Vector<unsigned>>& GetGeneratedSpirv() { return m_generatedSpirv; }
|
||||
|
||||
Int GetShaderIndexByStage(ShaderStage stage) const {
|
||||
auto it = std::find_if(m_shaders.begin(), m_shaders.end(),
|
||||
[stage](const SharedPtr<ShaderObject>& shader) { return shader->GetShaderStage() == stage; });
|
||||
return it == m_shaders.end() ? -1 : std::distance(m_shaders.begin(), it);
|
||||
}
|
||||
|
||||
Uint GetExternalIndex() const { return m_externalIndex; }
|
||||
|
||||
// const UnorderedMap<String, Uint>& GetAttribLocationMap() const { return
|
||||
|
||||
Reference in New Issue
Block a user