@@ -44,20 +44,13 @@ core::smart_refctd_ptr<DrawAABB> DrawAABB::create(SCreationParameters&& params)
44
44
logger->log (" Failed to create indices buffer!" , ILogger::ELL_ERROR);
45
45
return nullptr ;
46
46
}
47
- auto verticesBuffer = createVerticesBuffer (params);
48
- if (!verticesBuffer)
49
- {
50
- logger->log (" Failed to create vertices buffer!" , ILogger::ELL_ERROR);
51
- return nullptr ;
52
- }
53
47
54
- return core::smart_refctd_ptr<DrawAABB>(new DrawAABB (std::move (params), singlePipeline, batchPipeline, indicesBuffer, verticesBuffer ));
48
+ return core::smart_refctd_ptr<DrawAABB>(new DrawAABB (std::move (params), singlePipeline, batchPipeline, indicesBuffer));
55
49
}
56
50
57
- DrawAABB::DrawAABB (SCreationParameters&& params, core::smart_refctd_ptr<video::IGPUGraphicsPipeline> singlePipeline, smart_refctd_ptr<IGPUGraphicsPipeline> batchPipeline,
58
- smart_refctd_ptr<IGPUBuffer> indicesBuffer, smart_refctd_ptr<IGPUBuffer> verticesBuffer)
51
+ DrawAABB::DrawAABB (SCreationParameters&& params, core::smart_refctd_ptr<video::IGPUGraphicsPipeline> singlePipeline, smart_refctd_ptr<IGPUGraphicsPipeline> batchPipeline, smart_refctd_ptr<IGPUBuffer> indicesBuffer)
59
52
: m_cachedCreationParams(std::move(params)), m_singlePipeline(std::move(singlePipeline)), m_batchPipeline(std::move(batchPipeline)),
60
- m_indicesBuffer (std::move(indicesBuffer)), m_verticesBuffer(std::move(verticesBuffer))
53
+ m_indicesBuffer (std::move(indicesBuffer))
61
54
{
62
55
}
63
56
@@ -271,36 +264,6 @@ smart_refctd_ptr<IGPUBuffer> DrawAABB::createIndicesBuffer(SCreationParameters&
271
264
return indicesBuffer;
272
265
}
273
266
274
- smart_refctd_ptr<IGPUBuffer> DrawAABB::createVerticesBuffer (SCreationParameters& params)
275
- {
276
- const auto unitAABB = core::aabbox3d<float >({ 0 , 0 , 0 }, { 1 , 1 , 1 });
277
- float32_t3 pMin = { 0 , 0 , 0 };
278
- float32_t3 pMax = { 1 , 1 , 1 };
279
-
280
- std::array<hlsl::float32_t3, VerticesCount> unitAABBVertices;
281
- unitAABBVertices[0 ] = float32_t3 (pMin.x , pMin.y , pMin.z );
282
- unitAABBVertices[1 ] = float32_t3 (pMax.x , pMin.y , pMin.z );
283
- unitAABBVertices[2 ] = float32_t3 (pMin.x , pMin.y , pMax.z );
284
- unitAABBVertices[3 ] = float32_t3 (pMax.x , pMin.y , pMax.z );
285
- unitAABBVertices[4 ] = float32_t3 (pMin.x , pMax.y , pMin.z );
286
- unitAABBVertices[5 ] = float32_t3 (pMax.x , pMax.y , pMin.z );
287
- unitAABBVertices[6 ] = float32_t3 (pMin.x , pMax.y , pMax.z );
288
- unitAABBVertices[7 ] = float32_t3 (pMax.x , pMax.y , pMax.z );
289
-
290
- IGPUBuffer::SCreationParams bufparams;
291
- bufparams.size = sizeof (float32_t3) * unitAABBVertices.size ();
292
- bufparams.usage = IGPUBuffer::EUF_STORAGE_BUFFER_BIT | IGPUBuffer::EUF_TRANSFER_DST_BIT | IGPUBuffer::EUF_SHADER_DEVICE_ADDRESS_BIT;
293
-
294
- smart_refctd_ptr<IGPUBuffer> vertexBuffer;
295
- params.utilities ->createFilledDeviceLocalBufferOnDedMem (
296
- SIntendedSubmitInfo{ .queue = params.transfer },
297
- std::move (bufparams),
298
- unitAABBVertices.data ()
299
- ).move_into (vertexBuffer);
300
-
301
- return vertexBuffer;
302
- }
303
-
304
267
core::smart_refctd_ptr<video::IGPUPipelineLayout> DrawAABB::createPipelineLayoutFromPCRange (video::ILogicalDevice* device, const asset::SPushConstantRange& pcRange)
305
268
{
306
269
return device->createPipelineLayout ({ &pcRange , 1 }, nullptr , nullptr , nullptr , nullptr );
@@ -324,7 +287,6 @@ bool DrawAABB::renderSingle(IGPUCommandBuffer* commandBuffer, const hlsl::shapes
324
287
commandBuffer->bindIndexBuffer (indexBinding, asset::EIT_32BIT);
325
288
326
289
SSinglePushConstants pc;
327
- pc.pVertexBuffer = m_verticesBuffer->getDeviceAddress ();
328
290
329
291
hlsl::float32_t4x4 instanceTransform = getTransformFromAABB (aabb);
330
292
pc.instance .transform = hlsl::mul (cameraMat, instanceTransform);
@@ -385,7 +347,6 @@ bool DrawAABB::render(IGPUCommandBuffer* commandBuffer, ISemaphore::SWaitInfo wa
385
347
assert (!streaming->needsManualFlushOrInvalidate ());
386
348
387
349
SPushConstants pc;
388
- pc.pVertexBuffer = m_verticesBuffer->getDeviceAddress ();
389
350
pc.pInstanceBuffer = m_cachedCreationParams.streamingBuffer ->getBuffer ()->getDeviceAddress () + instancesByteOffset;
390
351
391
352
commandBuffer->pushConstants (m_batchPipeline->getLayout (), ESS_VERTEX, 0 , sizeof (SPushConstants), &pc);
0 commit comments