mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-09 04:38:30 +09:00
[Refactor] (MG_Impl/Texture): Optimize code.
This commit is contained in:
@@ -241,5 +241,19 @@ namespace MobileGL::MG_Impl::GLImpl {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Bool ValidateTextureTargetUniformity(SharedPtr<MG_State::GLState::ITextureObject> textureObject,
|
||||
TextureTarget target) {
|
||||
if (!textureObject) return true; // should be created later
|
||||
TextureTarget prevTarget = textureObject->GetTarget();
|
||||
if (prevTarget != target) {
|
||||
MG_State::pGLContext->RecordError(
|
||||
ErrorCode::InvalidOperation,
|
||||
MakeShared<GenericErrorInfo>("MG_Impl/GLImpl", "ValidateTextureTargetUniformity",
|
||||
"Texture target does not match the previously created texture"));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
} // namespace TextureImpl
|
||||
} // namespace MobileGL::MG_Impl::GLImpl
|
||||
|
||||
Reference in New Issue
Block a user