You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: include/nbl/video/IDeviceMemoryAllocation.h
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -91,6 +91,7 @@ class IDeviceMemoryAllocation : public virtual core::IReferenceCounted
91
91
//! Utility function, tell us if writes by the CPU or GPU need extra visibility operations to become visible for reading on the other processor
92
92
/** Only execute flushes or invalidations if the allocation requires them, and batch them (flush one combined range instead of two or more)
93
93
for greater efficiency. To execute a flush or invalidation, use IDriver::flushMappedAllocationRanges and IDriver::invalidateMappedAllocationRanges respectively. */
94
+
// TODO: Visible is a misnomer, collides with Vulkan memory model nomenclature where visibility only concerns reads, where as this is both read and write (visibility and availability)
// overflowSubmit no longer blocks for the last submit to have completed, so we must do it ourselves here
@@ -396,21 +407,20 @@ class NBL_API2 IUtilities : public core::IReferenceCounted
396
407
continue; // keep trying again
397
408
}
398
409
// some platforms expose non-coherent host-visible GPU memory, so writes need to be flushed explicitly
399
-
if (m_defaultUploadBuffer.get()->needsManualFlushOrInvalidate())
400
-
{
401
-
auto flushRange = AlignedMappedMemoryRange(m_defaultUploadBuffer.get()->getBuffer()->getBoundMemory().memory,localOffset,subSize,limits.nonCoherentAtomSize);
// this doesn't actually free the memory, the memory is queued up to be freed only after the `scratchSemaphore` reaches a value a future submit will signal
auto flushRange = AlignedMappedMemoryRange(m_downstreamingBuffer->getBuffer()->getBoundMemory().memory,m_copyRange.offset,m_copyRange.length,nonCoherentAtomSize);
548
+
auto flushRange = ILogicalDevice::MappedMemoryRange(downstreamingBuffer->getBoundMemory().memory,m_copyRange.offset,m_copyRange.length,ILogicalDevice::MappedMemoryRange::align_non_coherent_tag);
assert(!regionsToCopy.empty() && "allocationSize is not enough to support the smallest possible transferable units to image, may be caused if your queueFam's minImageTransferGranularity is large or equal to <0,0,0>.");
129
140
130
141
// some platforms expose non-coherent host-visible GPU memory, so writes need to be flushed explicitly
131
-
if (m_defaultUploadBuffer.get()->needsManualFlushOrInvalidate())
// this doesn't actually free the memory, the memory is queued up to be freed only after the GPU fence/event is signalled
140
150
m_defaultUploadBuffer.get()->multi_deallocate(1u,&localOffset,&allocationSize,intendedNextSubmit.getFutureScratchSemaphore()); // can queue with a reset but not yet pending fence, just fine
0 commit comments