@@ -816,7 +816,7 @@ namespace nbl::ext::imgui
816
816
817
817
auto mdiBuffer = smart_refctd_ptr<IGPUBuffer>(m_mdi.streamingTDBufferST ->getBuffer ());
818
818
{
819
- std::chrono::steady_clock::time_point timeout ( std::chrono::seconds (0x45 ));
819
+ auto timeout ( std::chrono::steady_clock::now () + std::chrono::seconds (1u ));
820
820
821
821
size_t unallocatedSize = m_mdi.streamingTDBufferST ->multi_allocate (timeout, MDI_ALLOCATION_COUNT, multiAllocParams.offsets .data (), multiAllocParams.byteSizes .data (), MDI_ALIGNMENTS.data ());
822
822
@@ -846,16 +846,14 @@ namespace nbl::ext::imgui
846
846
exit (0x45 ); // TODO: handle OOB memory requests, probably need to extend the mdi buffer/let user pass more size at init
847
847
}
848
848
}
849
+
850
+ auto waitInfo = info.getFutureScratchSemaphore ();
851
+ m_mdi.streamingTDBufferST ->multi_deallocate (MDI_ALLOCATION_COUNT, multiAllocParams.offsets .data (), multiAllocParams.byteSizes .data (), waitInfo);
849
852
}
850
853
851
854
const uint32_t drawCount = multiAllocParams.byteSizes [MDI::EBC_DRAW_INDIRECT_STRUCTURES] / sizeof (VkDrawIndexedIndirectCommand);
852
855
{
853
856
auto binding = mdiBuffer->getBoundMemory ();
854
-
855
- if (!binding.memory ->isCurrentlyMapped ())
856
- if (!binding.memory ->map ({ 0ull , binding.memory ->getAllocationSize () }, IDeviceMemoryAllocation::EMCAF_READ))
857
- logger->log (" Could not map device memory!" , system::ILogger::ELL_WARNING);
858
-
859
857
assert (binding.memory ->isCurrentlyMapped ());
860
858
861
859
auto * const indirectsMappedPointer = reinterpret_cast <VkDrawIndexedIndirectCommand*>(reinterpret_cast <uint8_t *>(m_mdi.streamingTDBufferST ->getBufferPointer ()) + multiAllocParams.offsets [MDI::EBC_DRAW_INDIRECT_STRUCTURES]);
@@ -996,9 +994,6 @@ namespace nbl::ext::imgui
996
994
// TODO: handle them?
997
995
exit (0x45 );
998
996
}
999
-
1000
- auto waitInfo = info.getFutureScratchSemaphore ();
1001
- m_mdi.streamingTDBufferST ->multi_deallocate (MDI_ALLOCATION_COUNT, multiAllocParams.offsets .data (), multiAllocParams.byteSizes .data (), waitInfo);
1002
997
}
1003
998
1004
999
return true ;
0 commit comments