From 6b25e7a7e323c3c4966fbc3e6cfbb794079001b6 Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Sat, 22 Aug 2026 21:45:13 -0400 Subject: [PATCH] [Fix] (GLState): report the storage flags glBufferData implies --- MobileGL/MG_State/GLState/BufferState/BufferObject.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/MobileGL/MG_State/GLState/BufferState/BufferObject.cpp b/MobileGL/MG_State/GLState/BufferState/BufferObject.cpp index 1ca335b7..276f01fa 100644 --- a/MobileGL/MG_State/GLState/BufferState/BufferObject.cpp +++ b/MobileGL/MG_State/GLState/BufferState/BufferObject.cpp @@ -118,7 +118,13 @@ namespace MobileGL::MG_State::GLState { // record that so backends skip uploading the stale shadow bytes. m_hasDefinedContent = (data != nullptr) || size == 0; m_isImmutableStorage = false; - m_storageFlags = 0; + // GL 4.6 core 6.2 defines glBufferData as glBufferStorage with + // DYNAMIC_STORAGE_BIT | MAP_READ_BIT | MAP_WRITE_BIT, so GL_BUFFER_STORAGE_FLAGS has to + // report those three afterwards. Reporting 0 - the value that belongs to a buffer whose + // store has never been specified - told an application that a perfectly writable + // glBufferData buffer accepted neither glBufferSubData nor a map. Only the IMMUTABLE flag + // distinguishes the two cases, and it is cleared just above. + m_storageFlags = GL_DYNAMIC_STORAGE_BIT | GL_MAP_READ_BIT | GL_MAP_WRITE_BIT; NotifyRespecify(); }