@@ -471,6 +471,30 @@ class AutoexposureApp final : public examples::SimpleWindowedApplication, public
471
471
472
472
// Allocate and create texture for tonemapping
473
473
{
474
+ IGPUImage::SCreationParams imageParams = {};
475
+ imageParams = m_gpuImg->getCreationParameters ();
476
+ // promote format because RGB8 and friends don't actually exist in HW
477
+ {
478
+ const IPhysicalDevice::SImageFormatPromotionRequest request = {
479
+ .originalFormat = imageParams.format ,
480
+ .usages = IPhysicalDevice::SFormatImageUsages::SUsage (imageParams.usage )
481
+ };
482
+ imageParams.format = m_physicalDevice->promoteImageFormat (request, imageParams.tiling );
483
+ }
484
+ if (imageParams.type == IGPUImage::ET_3D)
485
+ imageParams.flags |= IGPUImage::ECF_2D_ARRAY_COMPATIBLE_BIT;
486
+ m_gpuTonemapImg = m_device->createImage (std::move (imageParams));
487
+ if (!m_gpuTonemapImg || !m_device->allocate (m_gpuTonemapImg->getMemoryReqs (), m_gpuTonemapImg.get ()).isValid ())
488
+ return false ;
489
+ m_gpuTonemapImg->setObjectDebugName (" Autoexposure Tonemapper Image" );
490
+
491
+ IGPUImageView::SCreationParams gpuTonemapImgViewParams = {
492
+ .image = m_gpuTonemapImg,
493
+ .viewType = IGPUImageView::ET_2D,
494
+ .format = m_gpuTonemapImg->getCreationParameters ().format
495
+ };
496
+
497
+ m_gpuTonemapImgView = m_device->createImageView (std::move (gpuTonemapImgViewParams));
474
498
}
475
499
476
500
return true ;
@@ -479,7 +503,6 @@ class AutoexposureApp final : public examples::SimpleWindowedApplication, public
479
503
// We do a very simple thing, display an image and wait `DisplayImageMs` to show it
480
504
inline void workLoopBody () override
481
505
{
482
-
483
506
// Acquire
484
507
auto acquire = m_surface->acquireNextImage ();
485
508
if (!acquire)
0 commit comments