Skip to content

Commit 8604014

Browse files
committed
update default MDI buffer creation constants, add validation for UI's render call - check if renderpass instance is open by requesting cmd's cached inheritance subpass info
1 parent 977aac0 commit 8604014

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/nbl/ext/ImGui/ImGui.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,7 @@ namespace nbl::ext::imgui
873873

874874
void UI::createMDIBuffer(SCreationParameters& m_cachedCreationParams)
875875
{
876-
constexpr static uint32_t minStreamingBufferAllocationSize = 32u, maxStreamingBufferAllocationAlignment = 1024u * 64u, mdiBufferDefaultSize = /* 2MB */ 1024u * 1024u * 2u;
876+
constexpr static uint32_t minStreamingBufferAllocationSize = 128u, maxStreamingBufferAllocationAlignment = 4096u, mdiBufferDefaultSize = /* 2MB */ 1024u * 1024u * 2u;
877877

878878
auto getRequiredAccessFlags = [&](const bitflag<IDeviceMemoryAllocation::E_MEMORY_PROPERTY_FLAGS>& properties)
879879
{
@@ -948,6 +948,17 @@ namespace nbl::ext::imgui
948948
return false;
949949
}
950950

951+
{
952+
const auto info = commandBuffer->getCachedInheritanceInfo();
953+
const bool recordingSubpass = info.subpass != IGPURenderpass::SCreationParams::SSubpassDependency::External;
954+
955+
if(!recordingSubpass)
956+
{
957+
m_cachedCreationParams.utilities->getLogger()->log("Command buffer is not recording a subpass!", ILogger::ELL_ERROR);
958+
return false;
959+
}
960+
}
961+
951962
ImGui::Render(); // note it doesn't touch GPU or graphics API at all, its an internal ImGUI call to update & prepare the data for rendering so we can call GetDrawData()
952963

953964
ImGuiIO& io = ImGui::GetIO();

0 commit comments

Comments
 (0)