Skip to content

Commit 482063a

Browse files
revert a dangerous api change
1 parent 44c213b commit 482063a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

include/nbl/video/IDeviceMemoryAllocation.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,14 @@ class IDeviceMemoryAllocation : public virtual core::IReferenceCounted
102102
size_t offset = 0ull;
103103
size_t length = 0ull;
104104
};
105-
inline bool map(const MemoryRange& range, const core::bitflag<E_MAPPING_CPU_ACCESS_FLAGS> accessHint=IDeviceMemoryAllocation::EMCAF_READ_AND_WRITE)
105+
inline void* map(const MemoryRange& range, const core::bitflag<E_MAPPING_CPU_ACCESS_FLAGS> accessHint=IDeviceMemoryAllocation::EMCAF_READ_AND_WRITE)
106106
{
107107
if (isCurrentlyMapped())
108-
return false;
108+
return nullptr;
109109
if(accessHint.hasFlags(EMCAF_READ) && !m_memoryPropertyFlags.hasFlags(EMPF_HOST_READABLE_BIT))
110-
return false;
110+
return nullptr;
111111
if(accessHint.hasFlags(EMCAF_WRITE) && !m_memoryPropertyFlags.hasFlags(EMPF_HOST_WRITABLE_BIT))
112-
return false;
112+
return nullptr;
113113
m_mappedPtr = reinterpret_cast<uint8_t*>(map_impl(range,accessHint));
114114
if (m_mappedPtr)
115115
m_mappedPtr -= range.offset;

0 commit comments

Comments
 (0)