You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// - If no fonts are loaded, dear imgui will use the default font. You can also load multiple fonts and use ImGui::PushFont()/PopFont() to select them.
@@ -173,17 +173,14 @@ namespace nbl::ext::imgui
173
173
//ImFont* font = io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\ArialUni.ttf", 18.0f, NULL, io.Fonts->GetGlyphRangesJapanese());
174
174
ImGuiIO& io = ImGui::GetIO();
175
175
176
+
// TODO: don't `pixels` need to be freed somehow!? (Use a uniqueptr with custom deleter lambda)
params.usage |= IGPUImage::EUF_TRANSFER_DST_BIT | IGPUImage::EUF_SAMPLED_BIT | IGPUImage::E_USAGE_FLAGS::EUF_TRANSFER_SRC_BIT;// do you really need the SRC bit?
196
193
197
194
struct
198
195
{
@@ -224,57 +221,80 @@ namespace nbl::ext::imgui
224
221
if (!image)
225
222
{
226
223
logger->log("Could not create font image!", system::ILogger::ELL_ERROR);
227
-
assert(false);
224
+
return IQueue::RESULT::OTHER_ERROR;
228
225
}
226
+
image->setObjectDebugName("Nabla IMGUI extension Font Image");
229
227
230
228
if (!m_device->allocate(image->getMemoryReqs(), image.get()).isValid())
231
229
{
232
230
logger->log("Could not allocate memory for font image!", system::ILogger::ELL_ERROR);
233
-
assert(false);
231
+
return IQueue::RESULT::OTHER_ERROR;
234
232
}
235
-
236
-
image->setObjectDebugName("Nabla IMGUI extension Font Image");
// We cannot use the `AutoSubmit` variant of the util because we need to add a pipeline barrier with a transition onto the command buffer after the upload.
277
+
// old layout is UNDEFINED because we don't want a content preserving transition, we can just put ourselves in transfer right away
278
+
if (!utilities->updateImageViaStagingBuffer(sInfo,pixels,image->getCreationParameters().format,image.get(),transferLayout,regions.range))
279
+
{
280
+
logger->log("Could not upload font image contents", system::ILogger::ELL_ERROR);
// need to be individually resettable such that we can form a valid SIntendedSubmit out of the commandbuffer allocated from the pool
491
+
smart_refctd_ptr<nbl::video::IGPUCommandPool> pool = device->createCommandPool(families.id.transfer, pool_flags_t::RESET_COMMAND_BUFFER_BIT|pool_flags_t::TRANSIENT_BIT);
466
492
if (!pool)
467
493
{
468
494
logger->log("Could not create command pool!", system::ILogger::ELL_ERROR);
0 commit comments