mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-09 12:48:32 +09:00
[Feat] (MG_State/Program): glGetUniformLocation
This commit is contained in:
@@ -15,6 +15,10 @@ namespace MobileGL {
|
||||
void MarkAsDeleted();
|
||||
Vector<SharedPtr<ShaderObject>>& GetAttachedShaders();
|
||||
const String& GetInfoLog() const { return m_infoLog; }
|
||||
Int GetUniformLocation(const String& name) {
|
||||
const auto it = m_uniforms.find(name);
|
||||
return (it == m_uniforms.end()) ? -1 : it->second;
|
||||
}
|
||||
private:
|
||||
void PreLink();
|
||||
void PostLink();
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace MobileGL {
|
||||
const String& GetShaderSource() const { return m_source; }
|
||||
SharedPtr<glslang::TShader> GetCompiledShader() const { return m_shader; }
|
||||
const String& GetInfoLog() const { return m_infoLog; }
|
||||
const UnorderedMap<String, Uint> GetUniformLocations() const { return m_uniforms; }
|
||||
const UnorderedMap<String, Uint>& GetUniformLocations() const { return m_uniforms; }
|
||||
private:
|
||||
bool DoReflection();
|
||||
const Uint m_id = 0;
|
||||
|
||||
Reference in New Issue
Block a user