mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-08 12:18:30 +09:00
[Refactor] (MG_Impl/GLImpl): replace Flywheel dispatch sync hack with MOBILEGL_COHERENT_AS_FLUSH
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
// End of Source File Header
|
||||
|
||||
#include "BufferObject.h"
|
||||
#include <algorithm>
|
||||
|
||||
namespace MobileGL::MG_State::GLState {
|
||||
namespace {
|
||||
@@ -167,23 +166,6 @@ namespace MobileGL::MG_State::GLState {
|
||||
NotifySubData(m_mappedRange.start, m_mappedRange.end - m_mappedRange.start);
|
||||
}
|
||||
|
||||
void BufferObject::SyncMappedRangeForGpuRead(Range1D range) {
|
||||
if (!m_isMapped) return;
|
||||
// GPU-resident maps already alias GPU-visible memory; nothing to push.
|
||||
if (m_resource.IsGpuResident()) return;
|
||||
if (!(m_mappingAccess & BufferMappingAccessBit::Persistent)) return;
|
||||
if (!(m_mappingAccess & BufferMappingAccessBit::Write)) return;
|
||||
// Non-FLUSH_EXPLICIT persistent maps are already covered wholesale by
|
||||
// SyncPersistentMappedRange.
|
||||
if (!(m_mappingAccess & BufferMappingAccessBit::FlushExplicit)) return;
|
||||
|
||||
const SizeT start = std::max(range.start, m_mappedRange.start);
|
||||
const SizeT end = std::min({range.end, m_mappedRange.end, m_size});
|
||||
if (start >= end) return;
|
||||
|
||||
NotifySubData(start, end - start);
|
||||
}
|
||||
|
||||
void BufferObject::WritebackFromBackend(DataPtr data, SizeT atOffset) {
|
||||
MOBILEGL_ASSERT(atOffset + data.size <= m_size,
|
||||
"WritebackFromBackend out of bounds: atOffset (%zu) + data.size (%zu) > m_size (%zu)", atOffset,
|
||||
|
||||
Reference in New Issue
Block a user