From 8778d4d1cf2d8f1c8c998f00fcfd9eafe2ff5b01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Sun, 10 Mar 2024 07:43:26 -0700 Subject: [PATCH] Cleanup. --- src/renderer_gl.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/renderer_gl.cpp b/src/renderer_gl.cpp index 9d320e64c..eefb2532a 100644 --- a/src/renderer_gl.cpp +++ b/src/renderer_gl.cpp @@ -1274,6 +1274,13 @@ namespace bgfx { namespace gl static uint64_t s_vertexAttribArraysPendingDisable = 0; static uint64_t s_vertexAttribArraysPendingEnable = 0; + void initLazyEnabledVertexAttributes() + { + s_currentlyEnabledVertexAttribArrays = 0; + s_vertexAttribArraysPendingDisable = 0; + s_vertexAttribArraysPendingEnable = 0; + } + void lazyEnableVertexAttribArray(GLuint index) { if (BX_ENABLED(BX_PLATFORM_EMSCRIPTEN) ) @@ -2265,9 +2272,7 @@ namespace bgfx { namespace gl ErrorState::Enum errorState = ErrorState::Default; - s_currentlyEnabledVertexAttribArrays = 0; - s_vertexAttribArraysPendingDisable = 0; - s_vertexAttribArraysPendingEnable = 0; + initLazyEnabledVertexAttributes(); if (_init.debug || _init.profile)