@@ -390,17 +390,23 @@ smart_refctd_ptr<IGPUImageView> UI::createFontAtlasTexture(const SCreationParame
390
390
}
391
391
392
392
constexpr auto NBL_FORMAT_FONT = EF_R8G8B8A8_UNORM;
393
+
394
+ // CCustomAllocatorCPUBuffer is kinda crap and doesn't support stateful allocators
395
+ uint8_t * pixels = nullptr ;
396
+ auto freeMemory = core::makeRAIIExiter ([&pixels]()->void
397
+ {
398
+ if (pixels)
399
+ IM_FREE (pixels);
400
+ }
401
+ );
393
402
394
403
// make buffer with image contents
395
404
core::smart_refctd_ptr<ICPUImage> cpuImage;
396
405
{
397
- uint8_t * pixels = nullptr ;
398
406
int32_t width, height;
399
407
fontAtlas->GetTexDataAsRGBA32 (&pixels, &width, &height);
400
408
if (!pixels)
401
409
return nullptr ;
402
- // CCustomAllocatorCPUBuffer is kinda crap and doesn't support stateful allocators
403
- auto freeMemory = core::makeRAIIExiter ([&pixels]()->void {IM_FREE (pixels);});
404
410
if (width<=0 || height<=0 )
405
411
return nullptr ;
406
412
const asset::VkExtent3D extent = {static_cast <uint32_t >(width),static_cast <uint32_t >(height),1u };
@@ -447,6 +453,7 @@ smart_refctd_ptr<IGPUImageView> UI::createFontAtlasTexture(const SCreationParame
447
453
logger.log (" Could not set font ICPUImage contents!" ,ILogger::ELL_ERROR);
448
454
return nullptr ;
449
455
}
456
+ cpuImage->setContentHash (cpuImage->computeContentHash ());
450
457
}
451
458
452
459
// note its by default but you can still change it at runtime, both the texture & sampler id
@@ -513,7 +520,9 @@ smart_refctd_ptr<IGPUImageView> UI::createFontAtlasTexture(const SCreationParame
513
520
CAssetConverter::SConvertParams params = {};
514
521
params.transfer = &transfer;
515
522
params.utilities = creationParams.utilities .get ();
523
+ queue->startCapture ();
516
524
auto result = reservation.convert (params);
525
+ queue->endCapture ();
517
526
// block immediately
518
527
if (result.copy ()!=IQueue::RESULT::SUCCESS)
519
528
{
0 commit comments