@@ -75,18 +75,15 @@ VkResult LveSwapChain::acquireNextImage(uint32_t *imageIndex) {
75
75
imageAvailableSemaphores[currentFrame], // must be a not signaled
76
76
// semaphore
77
77
VK_NULL_HANDLE, imageIndex);
78
+ // std::cout << "frame: " << currentFrame << " SwapChain image: " <<
79
+ // *imageIndex
80
+ // << " Result: " << result << std::endl;
78
81
79
82
return result;
80
83
}
81
84
82
85
VkResult LveSwapChain::submitCommandBuffers (const VkCommandBuffer *buffers,
83
86
uint32_t *imageIndex) {
84
- if (imagesInFlight[*imageIndex] != VK_NULL_HANDLE) {
85
- vkWaitForFences (device.device (), 1 , &imagesInFlight[*imageIndex], VK_TRUE,
86
- UINT64_MAX);
87
- }
88
- imagesInFlight[*imageIndex] = inFlightFences[currentFrame];
89
-
90
87
VkSubmitInfo submitInfo = {};
91
88
submitInfo.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO;
92
89
@@ -143,6 +140,11 @@ void LveSwapChain::createSwapChain() {
143
140
imageCount > swapChainSupport.capabilities .maxImageCount ) {
144
141
imageCount = swapChainSupport.capabilities .maxImageCount ;
145
142
}
143
+ std::cout << " swapChainSupport maxImageCount: "
144
+ << swapChainSupport.capabilities .maxImageCount << std::endl;
145
+ std::cout << " swapChainSupport minImageCount: "
146
+ << swapChainSupport.capabilities .minImageCount << std::endl;
147
+ std::cout << " imageCount: " << imageCount << std::endl;
146
148
147
149
VkSwapchainCreateInfoKHR createInfo = {};
148
150
createInfo.sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR;
@@ -188,10 +190,18 @@ void LveSwapChain::createSwapChain() {
188
190
// we'll first query the final number of images with vkGetSwapchainImagesKHR,
189
191
// then resize the container and finally call it again to retrieve the
190
192
// handles.
191
- vkGetSwapchainImagesKHR (device.device (), swapChain, &imageCount, nullptr );
193
+ VkResult getSwapChainRes;
194
+ getSwapChainRes =
195
+ vkGetSwapchainImagesKHR (device.device (), swapChain, &imageCount, nullptr );
196
+
197
+ std::cout << " First getSwapChainImages Result: " << getSwapChainRes
198
+ << " , imageCount: " << imageCount << std::endl;
192
199
swapChainImages.resize (imageCount);
193
- vkGetSwapchainImagesKHR (device.device (), swapChain, &imageCount,
194
- swapChainImages.data ());
200
+
201
+ getSwapChainRes = vkGetSwapchainImagesKHR (
202
+ device.device (), swapChain, &imageCount, swapChainImages.data ());
203
+ std::cout << " Second getSwapChainImages Result: " << getSwapChainRes
204
+ << " , imageCount: " << imageCount << std::endl;
195
205
196
206
swapChainImageFormat = surfaceFormat.format ;
197
207
swapChainExtent = extent;
@@ -336,7 +346,7 @@ void LveSwapChain::createSyncObjects() {
336
346
imageAvailableSemaphores.resize (MAX_FRAMES_IN_FLIGHT);
337
347
renderFinishedSemaphores.resize (MAX_FRAMES_IN_FLIGHT);
338
348
inFlightFences.resize (MAX_FRAMES_IN_FLIGHT);
339
- imagesInFlight. resize ( imageCount (), VK_NULL_HANDLE) ;
349
+ std::cout << " image count : " << imageCount () << std::endl ;
340
350
341
351
VkSemaphoreCreateInfo semaphoreInfo = {};
342
352
semaphoreInfo.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO;
0 commit comments