@@ -275,6 +275,21 @@ class AutoexposureApp final : public examples::SimpleWindowedApplication, public
275
275
return false ;
276
276
m_gpuImg->setObjectDebugName (" Autoexposure Image" );
277
277
278
+ // set window size
279
+ const auto imageExtent = m_gpuImg->getCreationParameters ().extent ;
280
+ const VkExtent2D newWindowResolution = { imageExtent.width , imageExtent.height };
281
+
282
+ if (newWindowResolution.width != m_window->getWidth () || newWindowResolution.height != m_window->getHeight ())
283
+ {
284
+ // Resize the window
285
+ m_winMgr->setWindowSize (m_window.get (), newWindowResolution.width , newWindowResolution.height );
286
+ // Don't want to rely on the Swapchain OUT_OF_DATE causing an implicit re-create in the `acquireNextImage` because the
287
+ // swapchain may report OUT_OF_DATE after the next VBlank after the resize, not getting the message right away.
288
+ m_surface->recreateSwapchain ();
289
+ }
290
+ // Now show the window (ideally should happen just after present, but don't want to mess with acquire/recreation)
291
+ m_winMgr->show (m_window.get ());
292
+
278
293
// we don't want to overcomplicate the example with multi-queue
279
294
auto queue = getGraphicsQueue ();
280
295
auto cmdbuf = m_cmdBufs[0 ].get ();
@@ -314,14 +329,14 @@ class AutoexposureApp final : public examples::SimpleWindowedApplication, public
314
329
IGPUImage::LAYOUT::TRANSFER_DST_OPTIMAL,
315
330
cpuImgParams.image ->getRegions ()
316
331
);
317
-
318
332
IGPUImageView::SCreationParams gpuImgViewParams = {
319
333
.image = m_gpuImg,
320
334
.viewType = IGPUImageView::ET_2D_ARRAY,
321
335
.format = m_gpuImg->getCreationParameters ().format
322
336
};
323
337
324
338
m_gpuImgView = m_device->createImageView (std::move (gpuImgViewParams));
339
+ queue->endCapture ();
325
340
}
326
341
327
342
return true ;
@@ -334,7 +349,7 @@ class AutoexposureApp final : public examples::SimpleWindowedApplication, public
334
349
335
350
inline bool keepRunning () override
336
351
{
337
- return false ;
352
+ return true ;
338
353
}
339
354
340
355
inline bool onAppTerminated () override
0 commit comments