mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-12 06:08:30 +09:00
[Fix] (MG_Backend/DirectGLES): a declined map renewal left the respecify pointing at immutable storage
This commit is contained in:
@@ -610,10 +610,22 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
|||||||
// where a respecification would put them.
|
// where a respecification would put them.
|
||||||
if (bufferObject.IsBackendPersistentMapped()) return;
|
if (bufferObject.IsBackendPersistentMapped()) return;
|
||||||
// Renewal declined (a zero-sized store, or the map could not be
|
// Renewal declined (a zero-sized store, or the map could not be
|
||||||
// retaken): the buffer is back on its CPU shadow and needs the
|
// retaken): the buffer is back on its CPU shadow and needs an ordinary
|
||||||
// ordinary respecification below.
|
// store again. Not this id's, though - it carries IMMUTABLE storage
|
||||||
|
// (glBufferStorageEXT), which glBufferData below would refuse. Drop it
|
||||||
|
// and let the lazy EnsureBufferResource path mint a mutable one with a
|
||||||
|
// full upload; nothing points into the old mapping any more, because
|
||||||
|
// the frontend has just given the adoption back.
|
||||||
resource->persistentMapped = false;
|
resource->persistentMapped = false;
|
||||||
resource->persistentPtr = nullptr;
|
resource->persistentPtr = nullptr;
|
||||||
|
if (resource->id != 0 && CanTouchGLNow() &&
|
||||||
|
resource->contextGeneration == g_bufferContextGeneration) {
|
||||||
|
ScrubBufferBindingShadowsForId(resource->id);
|
||||||
|
g_GLESFuncs.glDeleteBuffers(1, &resource->id);
|
||||||
|
}
|
||||||
|
resource->id = 0;
|
||||||
|
resource->storageInitialized = false;
|
||||||
|
resource->storageSize = 0;
|
||||||
}
|
}
|
||||||
if (!CanTouchGLNow() || resource->id == 0 ||
|
if (!CanTouchGLNow() || resource->id == 0 ||
|
||||||
resource->contextGeneration != g_bufferContextGeneration) {
|
resource->contextGeneration != g_bufferContextGeneration) {
|
||||||
|
|||||||
Reference in New Issue
Block a user