From 6416788856731ee5947aba4e247fb2545ecfe705 Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Sat, 16 Aug 2025 22:54:31 +0800 Subject: [PATCH] [Fix] (MG_State/Program): skip attrib location binding when it is not active at the first place --- MobileGL/MG_State/GLState/ProgramState/ProgramObject.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MobileGL/MG_State/GLState/ProgramState/ProgramObject.cpp b/MobileGL/MG_State/GLState/ProgramState/ProgramObject.cpp index fb1315aa..669717a2 100644 --- a/MobileGL/MG_State/GLState/ProgramState/ProgramObject.cpp +++ b/MobileGL/MG_State/GLState/ProgramState/ProgramObject.cpp @@ -105,6 +105,8 @@ namespace MobileGL { assert(location < m_attribs.size()); if (m_attribs[location] != name) { auto it = std::find(m_attribs.begin(), m_attribs.end(), name); + if (it == m_attribs.end()) + continue; std::swap(m_attribs[location], m_attribs[std::distance(m_attribs.begin(), it)]); } }