mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-12 14:18:31 +09:00
[Fix] (MG_State/Program): fix ubo name mistaken for uniform name
This commit is contained in:
@@ -362,7 +362,9 @@ namespace MobileGL {
|
|||||||
GLint GetUniformLocation_State(GLuint program, const GLchar* name) {
|
GLint GetUniformLocation_State(GLuint program, const GLchar* name) {
|
||||||
auto programObject = TryToGetProgramObject(program);
|
auto programObject = TryToGetProgramObject(program);
|
||||||
if (!programObject) return -1;
|
if (!programObject) return -1;
|
||||||
return programObject->GetUniformLocation(name);
|
auto loc = programObject->GetUniformLocation(name);
|
||||||
|
MGLOG_D("%s: loc %02d = %s", __func__, loc, name);
|
||||||
|
return loc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetUniform_State(GLuint program, GLint location, void* params) {
|
void GetUniform_State(GLuint program, GLint location, void* params) {
|
||||||
@@ -821,6 +823,7 @@ namespace MobileGL {
|
|||||||
}
|
}
|
||||||
const auto& name = programObject->GetUniformBlockName(uniformBlockIndex);
|
const auto& name = programObject->GetUniformBlockName(uniformBlockIndex);
|
||||||
CopyStr(bufSize, length, uniformBlockName, name.c_str(), name.length());
|
CopyStr(bufSize, length, uniformBlockName, name.c_str(), name.length());
|
||||||
|
MGLOG_D("%s: \"%s\" at uniformBlockIndex %02d, length = %d", __func__, uniformBlockName, uniformBlockIndex, *length);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ValidateProgram_State(GLuint program) {
|
void ValidateProgram_State(GLuint program) {
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ namespace MobileGL {
|
|||||||
|
|
||||||
|
|
||||||
const String& GetUniformBlockName(Uint index) const {
|
const String& GetUniformBlockName(Uint index) const {
|
||||||
auto& ubo = m_program->getUniform(index);
|
auto& ubo = m_program->getUniformBlock(index);
|
||||||
return ubo.name;
|
return ubo.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user