mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-08 20:28:32 +09:00
[Feat] (MG_State/Program): GetShaderiv
This commit is contained in:
@@ -31,7 +31,7 @@ namespace MobileGL {
|
||||
Vector<GLenum> shaderTypes(m_shaders.size());
|
||||
Vector<SharedPtr<glslang::TShader>> shaders(m_shaders.size());
|
||||
for (SizeT i = 0; i < m_shaders.size(); i++) {
|
||||
shaderTypes[i] = GetGLShaderTypeByMGLShaderStage(m_shaders[i]->GetShaderStage());
|
||||
shaderTypes[i] = ConvertGLShaderTypeByMGLShaderStage(m_shaders[i]->GetShaderStage());
|
||||
shaders[i] = m_shaders[i]->GetCompiledShader();
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace MobileGL {
|
||||
// like a real OpenGL driver at linking stage
|
||||
// Will compile for other backends later.
|
||||
ShaderAttrib attrib{
|
||||
.shaderType = GetGLShaderTypeByMGLShaderStage(m_stage),
|
||||
.shaderType = ConvertGLShaderTypeByMGLShaderStage(m_stage),
|
||||
.sourceStr = m_source,
|
||||
.flags = ShaderCompileBits::CompileForOpenGL
|
||||
};
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace MobileGL {
|
||||
Unknown = -1
|
||||
};
|
||||
|
||||
inline static GLenum GetGLShaderTypeByMGLShaderStage(ShaderStage stage) {
|
||||
inline static GLenum ConvertGLShaderTypeByMGLShaderStage(ShaderStage stage) {
|
||||
switch (stage) {
|
||||
case ShaderStage::Vertex:
|
||||
return GL_VERTEX_SHADER;
|
||||
@@ -34,7 +34,7 @@ namespace MobileGL {
|
||||
}
|
||||
}
|
||||
|
||||
inline static ShaderStage GetMGLShaderStageByGLShaderType(GLenum type) {
|
||||
inline static ShaderStage ConvertMGLShaderStageByGLShaderType(GLenum type) {
|
||||
switch (type) {
|
||||
case GL_VERTEX_SHADER:
|
||||
return ShaderStage::Vertex;
|
||||
@@ -68,6 +68,8 @@ namespace MobileGL {
|
||||
SharedPtr<glslang::TShader> GetCompiledShader() const { return m_shader; }
|
||||
const String& GetInfoLog() const { return m_infoLog; }
|
||||
const UnorderedMap<String, Uint>& GetUniformLocations() const { return m_uniforms; }
|
||||
Bool GetCompileStatus() const { return m_compileStatus; }
|
||||
Bool GetDeleteStatus() const { return m_deleteStatus; }
|
||||
private:
|
||||
// bool DoReflection();
|
||||
const Uint m_id = 0;
|
||||
|
||||
Reference in New Issue
Block a user