mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-11-19 07:51:57 +09:00
[Fix] (Buffer): refresh persistent read maps at a client-mapped buffer barrier
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
#include "GL_Drawing.h"
|
#include "GL_Drawing.h"
|
||||||
#include <Config.h>
|
#include <Config.h>
|
||||||
#include <MG_State/GLState/Core.h>
|
#include <MG_State/GLState/Core.h>
|
||||||
|
#include <MG_State/GLState/BufferState/BufferObject.h>
|
||||||
#include <MG_State/EGLState/Core.h>
|
#include <MG_State/EGLState/Core.h>
|
||||||
#include <MG_Backend/BackendObjects.h>
|
#include <MG_Backend/BackendObjects.h>
|
||||||
#include <MG_Impl/Pipe/PipeFill.h>
|
#include <MG_Impl/Pipe/PipeFill.h>
|
||||||
@@ -936,6 +937,15 @@ namespace MobileGL::MG_Impl::GLImpl {
|
|||||||
}
|
}
|
||||||
MGP_FILL(MemoryBarrier);
|
MGP_FILL(MemoryBarrier);
|
||||||
memoryBarrier(barriers);
|
memoryBarrier(barriers);
|
||||||
|
// CLIENT_MAPPED_BUFFER_BARRIER_BIT asks for the shader writes issued so far to reach
|
||||||
|
// the client's persistent maps (GL 4.6 core 7.13). A persistent READ map hands out the
|
||||||
|
// frontend shadow, which only an explicit pull refreshes, and an application may read
|
||||||
|
// it after any command that waited for the GPU (a glGetTexImage, say) rather than after
|
||||||
|
// a fence - so pull here, while the writes are known to be ordered ahead of the read.
|
||||||
|
// Only buffers with a GPU write outstanding pay for it.
|
||||||
|
if ((barriers & GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT) != 0) {
|
||||||
|
MG_State::GLState::SyncPersistentReadMapsFromGpu();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextureBarrier() {
|
void TextureBarrier() {
|
||||||
|
|||||||
@@ -305,7 +305,8 @@ namespace MobileGL {
|
|||||||
// CLIENT_MAPPED_BUFFER_BARRIER_BIT barrier before that fence). The pointer such a map
|
// CLIENT_MAPPED_BUFFER_BARRIER_BIT barrier before that fence). The pointer such a map
|
||||||
// hands out is the frontend shadow, which nothing else pulls the GPU's bytes into, so
|
// hands out is the frontend shadow, which nothing else pulls the GPU's bytes into, so
|
||||||
// these two waits refresh every live persistent read map that has a GPU write
|
// these two waits refresh every live persistent read map that has a GPU write
|
||||||
// outstanding.
|
// outstanding. A CLIENT_MAPPED_BUFFER_BARRIER_BIT barrier refreshes them too, for an
|
||||||
|
// application that reads after some other wait instead of a fence.
|
||||||
void SyncPersistentReadMapsFromGpu();
|
void SyncPersistentReadMapsFromGpu();
|
||||||
} // namespace MG_State::GLState
|
} // namespace MG_State::GLState
|
||||||
} // namespace MobileGL
|
} // namespace MobileGL
|
||||||
|
|||||||
Reference in New Issue
Block a user