Skip to content

Commit afc1a00

Browse files
committed
Update allocation parameter usage
1 parent 4e4f5e3 commit afc1a00

14 files changed

Lines changed: 20 additions & 19 deletions

include/nbl/ext/OIT/OIT.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class COIT
6969
assert(img);
7070
auto mreq = img->getMemoryReqs();
7171
mreq.memoryTypeBits &= dev->getPhysicalDevice()->getDeviceLocalMemoryTypeBits();
72-
auto imgMem = dev->allocate(mreq, img.get());
72+
auto imgMem = dev->allocate(mreq, { img.get() });
7373

7474
if (!img || !imgMem.isValid())
7575
return nullptr;

include/nbl/ext/ScreenShot/ScreenShot.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ inline core::smart_refctd_ptr<ICPUImageView> createScreenShot(
110110
logger->log("ScreenShot: no down-streaming memory type for texel buffer.", system::ILogger::ELL_ERROR);
111111
return nullptr;
112112
}
113-
auto gpuTexelBufferMem = logicalDevice->allocate(gpuTexelBufferMemReqs, gpuTexelBuffer.get());
113+
auto gpuTexelBufferMem = logicalDevice->allocate(gpuTexelBufferMemReqs, { gpuTexelBuffer.get() });
114114
if (!gpuTexelBufferMem.isValid())
115115
{
116116
if (auto* logger = logicalDevice->getLogger())

include/nbl/scene/CLevelOfDetailLibrary.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class CLevelOfDetailLibrary : public ILevelOfDetailLibrary
5353
auto lodTableInfoBuffer = params.device->createBuffer(std::move(lodTableInfoBufferParams));
5454
auto lodTableInfoMReqs = lodTableInfoBuffer->getMemoryReqs();
5555
lodTableInfoMReqs.memoryTypeBits &= deviceLocalMemTypeBits;
56-
params.device->allocate(lodTableInfoMReqs, lodTableInfoBuffer.get());
56+
params.device->allocate(lodTableInfoMReqs, { lodTableInfoBuffer.get() });
5757

5858
explicitParams.lodTableInfoBuffer = {0ull,tableBufferSize,lodTableInfoBuffer};
5959
explicitParams.lodTableInfoBuffer.buffer->setObjectDebugName("LoD Table Infos");
@@ -65,7 +65,7 @@ class CLevelOfDetailLibrary : public ILevelOfDetailLibrary
6565
auto lodInfoBuffer = params.device->createBuffer(std::move(lodInfoBufferParams));
6666
auto lodInfoMReqs = lodInfoBuffer->getMemoryReqs();
6767
lodInfoMReqs.memoryTypeBits &= deviceLocalMemTypeBits;
68-
params.device->allocate(lodInfoMReqs, lodInfoBuffer.get());
68+
params.device->allocate(lodInfoMReqs, { lodInfoBuffer.get() });
6969

7070
explicitParams.lodInfoBuffer = {0ull,lodBufferSize,lodInfoBuffer};
7171
explicitParams.lodInfoBuffer.buffer->setObjectDebugName("LoD Infos");

include/nbl/scene/CSkinInstanceCache.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class CSkinInstanceCache final : public ISkinInstanceCache
3535
auto buffer = params.device->createBuffer(std::move(creationParams));
3636
auto mreqs = buffer->getMemoryReqs();
3737
mreqs.memoryTypeBits &= params.device->getPhysicalDevice()->getDeviceLocalMemoryTypeBits();
38-
auto gpubufMem = params.device->allocate(mreqs, buffer.get());
38+
auto gpubufMem = params.device->allocate(mreqs, { buffer.get() });
3939
return buffer;
4040
};
4141

include/nbl/scene/ICullingLoDSelectionSystem.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class ICullingLoDSelectionSystem : public virtual core::IReferenceCounted
101101
retval.prefixSumScratch.buffer = gpubuffer;
102102
auto mreqs = gpubuffer->getMemoryReqs();
103103
mreqs.memoryTypeBits &= logicalDevice->getPhysicalDevice()->getDeviceLocalMemoryTypeBits();
104-
auto gpubufMem = logicalDevice->allocate(mreqs, gpubuffer.get());
104+
auto gpubufMem = logicalDevice->allocate(mreqs, { gpubuffer.get() });
105105

106106
retval.pvsInstances.buffer->setObjectDebugName("Culling Scratch Buffer");
107107
}
@@ -136,7 +136,7 @@ class ICullingLoDSelectionSystem : public virtual core::IReferenceCounted
136136
auto buffer = logicalDevice->createBuffer(std::move(params));
137137
auto mreqs = buffer->getMemoryReqs();
138138
mreqs.memoryTypeBits &= logicalDevice->getPhysicalDevice()->getDeviceLocalMemoryTypeBits();
139-
auto gpubufMem = logicalDevice->allocate(mreqs, buffer.get());
139+
auto gpubufMem = logicalDevice->allocate(mreqs, { buffer.get() });
140140
return buffer;
141141
}
142142

@@ -149,7 +149,7 @@ class ICullingLoDSelectionSystem : public virtual core::IReferenceCounted
149149
auto buffer = logicalDevice->createBuffer(std::move(params));
150150
auto mreqs = buffer->getMemoryReqs();
151151
mreqs.memoryTypeBits &= logicalDevice->getPhysicalDevice()->getDeviceLocalMemoryTypeBits();
152-
auto gpubufMem = logicalDevice->allocate(mreqs, buffer.get());
152+
auto gpubufMem = logicalDevice->allocate(mreqs, { buffer.get() });
153153
return buffer;
154154
}
155155

include/nbl/video/utilities/CDrawIndirectAllocator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class CDrawIndirectAllocator final : public IDrawIndirectAllocator
5252
explicit_params.drawCommandBuffer.buffer = params.device->createBuffer(std::move(creationParams));
5353
auto mreqsDrawCmdBuf = explicit_params.drawCommandBuffer.buffer->getMemoryReqs();
5454
mreqsDrawCmdBuf.memoryTypeBits &= params.device->getPhysicalDevice()->getDeviceLocalMemoryTypeBits();
55-
auto gpubufMem = params.device->allocate(mreqsDrawCmdBuf, explicit_params.drawCommandBuffer.buffer.get());
55+
auto gpubufMem = params.device->allocate(mreqsDrawCmdBuf, { explicit_params.drawCommandBuffer.buffer.get() });
5656

5757
explicit_params.drawCountBuffer.offset = 0ull;
5858
explicit_params.drawCountBuffer.size = core::roundUp<size_t>(params.drawCountCapacity*sizeof(uint32_t),limits.minSSBOAlignment);
@@ -62,7 +62,7 @@ class CDrawIndirectAllocator final : public IDrawIndirectAllocator
6262
explicit_params.drawCountBuffer.buffer = params.device->createBuffer(std::move(creationParams));
6363
auto mreqsDrawCountBuf = explicit_params.drawCountBuffer.buffer->getMemoryReqs();
6464
mreqsDrawCountBuf.memoryTypeBits &= params.device->getPhysicalDevice()->getDeviceLocalMemoryTypeBits();
65-
auto gpubufMem = params.device->allocate(mreqsDrawCountBuf, explicit_params.drawCountBuffer.buffer.get());
65+
auto gpubufMem = params.device->allocate(mreqsDrawCountBuf, { explicit_params.drawCountBuffer.buffer.get() });
6666
}
6767
else
6868
explicit_params.drawCountBuffer.buffer = nullptr;

include/nbl/video/utilities/CPropertyPool.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class CPropertyPool final : public IPropertyPool
5959
blocks[i].buffer = device->createBuffer(std::move(params));
6060
auto bufferReqs = blocks[i].buffer->getMemoryReqs();
6161
bufferReqs.memoryTypeBits &= device->getPhysicalDevice()->getDeviceLocalMemoryTypeBits();
62-
auto gpubufferMem = device->allocate(bufferReqs, blocks[i].buffer.get());
62+
auto gpubufferMem = device->allocate(bufferReqs, { blocks[i].buffer.get() });
6363
}
6464
return create(device, blocks, capacity, contiguous, allocator<uint8_t>());
6565
}

src/nbl/ext/DebugDraw/CDraw3DLine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ void CDraw3DLine::updateVertexBuffer(IUtilities* utilities, IGPUQueue* queue, co
9595
m_linesBuffer = m_device->createBuffer(std::move(creationParams));
9696
auto mreqs = m_linesBuffer->getMemoryReqs();
9797
mreqs.memoryTypeBits &= m_device->getPhysicalDevice()->getDeviceLocalMemoryTypeBits();
98-
auto linesMem = m_device->allocate(mreqs, m_linesBuffer.get());
98+
auto linesMem = m_device->allocate(mreqs, { m_linesBuffer.get() });
9999
assert(m_linesBuffer && linesMem.isValid());
100100
}
101101
SBufferRange<IGPUBuffer> range;

src/nbl/ext/DebugDraw/CDrawAABB.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ bool DrawAABB::createStreamingBuffer(SCreationParameters& params)
188188
auto memoryReqs = buffer->getMemoryReqs();
189189
memoryReqs.memoryTypeBits &= params.utilities->getLogicalDevice()->getPhysicalDevice()->getUpStreamingMemoryTypeBits();
190190

191-
auto allocation = params.utilities->getLogicalDevice()->allocate(memoryReqs, buffer.get(), SCachedCreationParameters::RequiredAllocateFlags);
191+
auto allocation = params.utilities->getLogicalDevice()->allocate(memoryReqs, { buffer.get(), SCachedCreationParameters::RequiredAllocateFlags });
192192
{
193193
const bool allocated = allocation.isValid();
194194
assert(allocated);
@@ -282,7 +282,7 @@ smart_refctd_ptr<IGPUBuffer> DrawAABB::createIndicesBuffer(SCreationParameters&
282282
video::IDeviceMemoryBacked::SDeviceMemoryRequirements reqs = indicesBuffer->getMemoryReqs();
283283
reqs.memoryTypeBits &= device->getPhysicalDevice()->getDeviceLocalMemoryTypeBits();
284284

285-
auto bufMem = device->allocate(reqs, indicesBuffer.get());
285+
auto bufMem = device->allocate(reqs, { indicesBuffer.get() });
286286
if (!bufMem.isValid())
287287
{
288288
params.utilities->getLogger()->log("Failed to allocate device memory compatible with index buffer!\n");

0 commit comments

Comments
 (0)