[Fix] (MG_Impl/VertexArray|Buffer): Fix incorrect name zero operations.

This commit is contained in:
BZLZHH
2025-08-12 16:54:56 +08:00
parent 5127479874
commit 256e947a5d
6 changed files with 19 additions and 8 deletions
+10 -1
View File
@@ -31,7 +31,16 @@ namespace MobileGL::MG_Impl::GLImpl {
return true;
}
Bool ValidateBufferName(Uint index) {
Bool ValidateBufferName(Uint index, Bool allowZero) {
if (index == 0) {
if (allowZero) return true;
MG_State::pGLContext->RecordError(ErrorCode::InvalidValue,
MakeShared<GenericErrorInfo>("MG_Impl/GLImpl/BufferImpl",
"ValidateBufferName",
"Buffer name 0 is not valid."));
return false;
}
Bool isValid = MG_State::pGLContext->ValidateBufferName(index);
if (isValid) return true;
MG_State::pGLContext->RecordError(