@@ -551,22 +551,26 @@ int main()
551
551
_NBL_DEBUG_BREAK_IF (true );
552
552
}
553
553
554
- for (uint32_t i = 0u ; i < actualMdiCnt; i++)
554
+ uint32_t aabbIdx = 0u ;
555
+ for (auto packedMeshBufferData : pmbd)
555
556
{
556
- batchCullDataEnd->aabbMinEdge .x = aabbs[i].MinEdge .X ;
557
- batchCullDataEnd->aabbMinEdge .y = aabbs[i].MinEdge .Y ;
558
- batchCullDataEnd->aabbMinEdge .z = aabbs[i].MinEdge .Z ;
557
+ for (uint32_t i = 0u ; i < packedMeshBufferData.mdiParameterCount ; i++)
558
+ {
559
+ batchCullDataEnd->aabbMinEdge .x = aabbs[aabbIdx].MinEdge .X ;
560
+ batchCullDataEnd->aabbMinEdge .y = aabbs[aabbIdx].MinEdge .Y ;
561
+ batchCullDataEnd->aabbMinEdge .z = aabbs[aabbIdx].MinEdge .Z ;
559
562
560
- batchCullDataEnd->aabbMaxEdge .x = aabbs[i ].MaxEdge .X ;
561
- batchCullDataEnd->aabbMaxEdge .y = aabbs[i ].MaxEdge .Y ;
562
- batchCullDataEnd->aabbMaxEdge .z = aabbs[i ].MaxEdge .Z ;
563
+ batchCullDataEnd->aabbMaxEdge .x = aabbs[aabbIdx ].MaxEdge .X ;
564
+ batchCullDataEnd->aabbMaxEdge .y = aabbs[aabbIdx ].MaxEdge .Y ;
565
+ batchCullDataEnd->aabbMaxEdge .z = aabbs[aabbIdx ].MaxEdge .Z ;
563
566
564
- batchCullDataEnd->drawCommandGUID = pmbd[i].mdiParameterOffset + i;
565
- assert (pmbd[i].mdiParameterOffset + i <= pmbd[i].mdiParameterCount );
567
+ batchCullDataEnd->drawCommandGUID = packedMeshBufferData.mdiParameterOffset + i;
566
568
567
- draw3DLine->enqueueBox (dbgLines, aabbs[i ], 1 .0f , 0 .0f , 0 .0f , 1 .0f , core::matrix3x4SIMD ());
569
+ draw3DLine->enqueueBox (dbgLines, aabbs[aabbIdx ], 1 .0f , 0 .0f , 0 .0f , 1 .0f , core::matrix3x4SIMD ());
568
570
569
- batchCullDataEnd++;
571
+ batchCullDataEnd++;
572
+ aabbIdx++;
573
+ }
570
574
}
571
575
572
576
sceneData.pushConstantsData .push_back (mdiListOffset);
@@ -893,8 +897,9 @@ int main()
893
897
memcpy (uboData.NormalMat , camera->getViewMatrix ().pointer (), sizeof (core::matrix3x4SIMD));
894
898
driver->updateBufferRangeViaStagingBuffer (sceneData.ubo .get (), 0u , sizeof (SBasicViewParameters), &uboData);
895
899
896
- // TODO: Cull MDIs
900
+ // cull MDIs
897
901
cullBatches (vpFromFirstFrame);
902
+ COpenGLExtensionHandler::pGlMemoryBarrier (GL_COMMAND_BARRIER_BIT | GL_SHADER_STORAGE_BARRIER_BIT);
898
903
899
904
driver->setRenderTarget (visBuffer);
900
905
driver->clearZBuffer ();
0 commit comments