mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-12 14:18:31 +09:00
[Fix] (MG_State/GL_Program): wrong guard condition in Uniformv_State
This commit is contained in:
@@ -473,7 +473,7 @@ namespace MobileGL {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (location >= programObject->GetUniformCount() || location < -1) {
|
if (location > programObject->GetMaxUniformLocation() || location < -1) {
|
||||||
MG_State::pGLContext->RecordError(
|
MG_State::pGLContext->RecordError(
|
||||||
ErrorCode::InvalidOperation,
|
ErrorCode::InvalidOperation,
|
||||||
MakeShared<GenericErrorInfo>("MG_Impl/GLImpl", __func__,
|
MakeShared<GenericErrorInfo>("MG_Impl/GLImpl", __func__,
|
||||||
|
|||||||
@@ -25,7 +25,9 @@ namespace MobileGL {
|
|||||||
Uint GetMaxUniformLocation() const { return m_maxUniformLocation; }
|
Uint GetMaxUniformLocation() const { return m_maxUniformLocation; }
|
||||||
Int GetUniformLocation(const String& name) {
|
Int GetUniformLocation(const String& name) {
|
||||||
const auto it = m_uniformLocations.find(name);
|
const auto it = m_uniformLocations.find(name);
|
||||||
return (it == m_uniformLocations.end()) ? -1 : (Int)it->second;
|
if (it == m_uniformLocations.end())
|
||||||
|
return -1;
|
||||||
|
return (Int)it->second;
|
||||||
}
|
}
|
||||||
GLenum GetUniformType(Uint index) const { return m_uniformTypes[index]; }
|
GLenum GetUniformType(Uint index) const { return m_uniformTypes[index]; }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user