mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-07 19:58:32 +09:00
[Feat] (MG_Impl/VertexArrayState): Allow VAO at index 0.
This commit is contained in:
@@ -107,7 +107,7 @@ namespace MobileGL {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!VertexArrayImpl::ValidateVertexArrayName(array, true)) return;
|
||||
if (!VertexArrayImpl::ValidateVertexArrayName(array)) return;
|
||||
|
||||
if (!MG_State::pGLContext->ValidateVertexArrayObject(array)) {
|
||||
MG_State::pGLContext->CreateVertexArrayObject(array);
|
||||
@@ -128,7 +128,7 @@ namespace MobileGL {
|
||||
GLuint vao = arrays[i];
|
||||
if (vao == 0) continue;
|
||||
|
||||
if (!VertexArrayImpl::ValidateVertexArrayName(vao, true)) continue;
|
||||
if (!VertexArrayImpl::ValidateVertexArrayName(vao)) continue;
|
||||
|
||||
if (MG_State::pGLContext->GetBoundVertexArray() &&
|
||||
MG_State::pGLContext->GetBoundVertexArray() == MG_State::pGLContext->GetVertexArrayObject(vao)) {
|
||||
|
||||
@@ -7,16 +7,7 @@
|
||||
namespace MobileGL::MG_Impl::GLImpl {
|
||||
namespace VertexArrayImpl {
|
||||
|
||||
Bool ValidateVertexArrayName(Uint index, Bool allowZero) {
|
||||
if (index == 0) {
|
||||
if (allowZero) return true;
|
||||
|
||||
MG_State::pGLContext->RecordError(
|
||||
ErrorCode::InvalidValue, MakeShared<GenericErrorInfo>("MG_Impl/GLImpl", "ValidateVertexArrayName",
|
||||
"Vertex array name 0 is not supported."));
|
||||
return false;
|
||||
}
|
||||
|
||||
Bool ValidateVertexArrayName(Uint index) {
|
||||
Bool isValid = MG_State::pGLContext->ValidateVertexArrayName(index);
|
||||
if (!isValid) {
|
||||
MG_State::pGLContext->RecordError(
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
namespace MobileGL::MG_Impl::GLImpl {
|
||||
namespace VertexArrayImpl {
|
||||
Bool ValidateVertexArrayName(Uint index, Bool allowZero = false);
|
||||
Bool ValidateVertexArrayName(Uint index);
|
||||
Bool ValidateVertexArrayObject(Uint index);
|
||||
Bool ValidateVertexAttributeIndex(Uint index);
|
||||
Bool ValidateVertexAttribPointerParams(Uint index, SizeT size, DataType type, Int stride);
|
||||
|
||||
Reference in New Issue
Block a user