Skip to content

Commit f36574a

Browse files
committed
added allocation flag check for device address
1 parent 8f5f38e commit f36574a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

include/nbl/video/utilities/IUtilities.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,9 @@ class NBL_API2 IUtilities : public core::IReferenceCounted
390390
auto buffer = m_device->createBuffer(std::move(params));
391391
auto mreqs = buffer->getMemoryReqs();
392392
mreqs.memoryTypeBits &= m_device->getPhysicalDevice()->getDeviceLocalMemoryTypeBits();
393-
auto mem = m_device->allocate(mreqs,buffer.get());
393+
auto allocFlags = (params.usage & asset::IBuffer::EUF_SHADER_DEVICE_ADDRESS_BIT) ?
394+
IDeviceMemoryAllocation::E_MEMORY_ALLOCATE_FLAGS::EMAF_DEVICE_ADDRESS_BIT : IDeviceMemoryAllocation::E_MEMORY_ALLOCATE_FLAGS::EMAF_NONE;
395+
auto mem = m_device->allocate(mreqs,buffer.get(), allocFlags);
394396

395397
auto submitSuccess = autoSubmit(
396398
submit,

0 commit comments

Comments
 (0)