@@ -136,7 +136,8 @@ class AutoexposureApp final : public examples::SimpleWindowedApplication, public
136
136
return logFail (" Failed to Create Descriptor Pools" );
137
137
138
138
m_lumaPresentDS[0 ] = lumaPresentPool->createDescriptorSet (core::smart_refctd_ptr (lumaPresentDSLayout));
139
- if (!m_lumaPresentDS[0 ])
139
+ m_lumaPresentDS[1 ] = lumaPresentPool->createDescriptorSet (core::smart_refctd_ptr (lumaPresentDSLayout));
140
+ if (!m_lumaPresentDS[0 ] || !m_lumaPresentDS[1 ])
140
141
return logFail (" Could not create Descriptor Set: lumaPresentDS!" );
141
142
m_tonemapperDS[0 ] = tonemapperPool->createDescriptorSet (core::smart_refctd_ptr (tonemapperDSLayout));
142
143
if (!m_tonemapperDS[0 ])
@@ -450,28 +451,8 @@ class AutoexposureApp final : public examples::SimpleWindowedApplication, public
450
451
451
452
m_gpuImgView = m_device->createImageView (std::move (gpuImgViewParams));
452
453
453
- IGPUDescriptorSet::SDescriptorInfo info = {};
454
- info.info .image .imageLayout = IImage::LAYOUT::READ_ONLY_OPTIMAL;
455
- info.desc = m_gpuImgView;
456
-
457
- IGPUDescriptorSet::SWriteDescriptorSet writeDescriptors[] = {
458
- {
459
- .dstSet = m_lumaPresentDS[0 ].get (),
460
- .binding = 0 ,
461
- .arrayElement = 0 ,
462
- .count = 1 ,
463
- .info = &info
464
- }
465
- };
466
-
467
- m_device->updateDescriptorSets (1 , writeDescriptors, 0 , nullptr );
468
-
469
- queue->endCapture ();
470
- }
471
-
472
- // Allocate and create texture for tonemapping
473
- {
474
- IGPUImage::SCreationParams imageParams = {};
454
+ // Allocate and create texture for tonemapping
455
+ imageParams = {};
475
456
imageParams = m_gpuImg->getCreationParameters ();
476
457
// promote format because RGB8 and friends don't actually exist in HW
477
458
{
@@ -495,6 +476,35 @@ class AutoexposureApp final : public examples::SimpleWindowedApplication, public
495
476
};
496
477
497
478
m_gpuTonemapImgView = m_device->createImageView (std::move (gpuTonemapImgViewParams));
479
+
480
+ IGPUDescriptorSet::SDescriptorInfo info1 = {};
481
+ info1.info .image .imageLayout = IImage::LAYOUT::READ_ONLY_OPTIMAL;
482
+ info1.desc = m_gpuImgView;
483
+
484
+ IGPUDescriptorSet::SDescriptorInfo info2 = {};
485
+ info2.info .image .imageLayout = IImage::LAYOUT::READ_ONLY_OPTIMAL;
486
+ info2.desc = m_gpuImgView;
487
+
488
+ IGPUDescriptorSet::SWriteDescriptorSet writeDescriptors[] = {
489
+ {
490
+ .dstSet = m_lumaPresentDS[0 ].get (),
491
+ .binding = 0 ,
492
+ .arrayElement = 0 ,
493
+ .count = 1 ,
494
+ .info = &info1
495
+ },
496
+ {
497
+ .dstSet = m_lumaPresentDS[1 ].get (),
498
+ .binding = 0 ,
499
+ .arrayElement = 0 ,
500
+ .count = 1 ,
501
+ .info = &info2
502
+ }
503
+ };
504
+
505
+ m_device->updateDescriptorSets (2 , writeDescriptors, 0 , nullptr );
506
+
507
+ queue->endCapture ();
498
508
}
499
509
500
510
return true ;
@@ -510,7 +520,7 @@ class AutoexposureApp final : public examples::SimpleWindowedApplication, public
510
520
511
521
auto queue = getGraphicsQueue ();
512
522
auto cmdbuf = m_cmdBufs[0 ].get ();
513
- auto ds = m_lumaPresentDS[0 ].get ();
523
+ auto ds = m_lumaPresentDS[1 ].get ();
514
524
515
525
queue->startCapture ();
516
526
// Render to the swapchain
0 commit comments