Skip to content

Commit 070d518

Browse files
author
devsh
committed
Add Concurrent Sharing Query/Validation
1 parent 606ea55 commit 070d518

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

include/nbl/video/IDeviceMemoryBacked.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,17 @@ class IDeviceMemoryBacked : public IBackendObject
4444
{
4545
return queueFamilyIndexCount>1u;
4646
}
47+
48+
//! Note that this will return false for the special foreign and external families
49+
inline bool canBeUsedByQueueFamily(const uint32_t family) const
50+
{
51+
if (!isConcurrentSharing())
52+
return true;
53+
for (uint8_t f=0; f<queueFamilyIndexCount; f++)
54+
if (queueFamilyIndices[f]==family)
55+
return true;
56+
return false;
57+
}
4758
};
4859
// TODO: change name later on, but right now too much code to refactor
4960
inline const SCreationParams& getCachedCreationParams() const {return m_cachedCreationParams;}

0 commit comments

Comments
 (0)