Бранимир Караџић 6 år sedan
förälder
incheckning
016f29eea7
2 ändrade filer med 16 tillägg och 20 borttagningar
  1. 1 1
      examples/common/bounds.cpp
  2. 15 19
      src/renderer_vk.cpp

+ 1 - 1
examples/common/bounds.cpp

@@ -2077,7 +2077,7 @@ bool overlap(const Triangle& _triangle, const Cone& _cone)
 		_cone.end,
 		_cone.end,
 	};
 	};
 
 
-	float ta0, tb0;
+	float ta0 = 0.0f, tb0 = 0.0f;
 	const bool i0 = intersect(ta0, tb0, ab, line);
 	const bool i0 = intersect(ta0, tb0, ab, line);
 
 
 	float ta1, tb1;
 	float ta1, tb1;

+ 15 - 19
src/renderer_vk.cpp

@@ -2310,20 +2310,17 @@ VK_IMPORT_DEVICE
 				pi.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR;
 				pi.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR;
 				pi.pNext = NULL;
 				pi.pNext = NULL;
 				pi.waitSemaphoreCount = 0;
 				pi.waitSemaphoreCount = 0;
-				pi.pWaitSemaphores    = NULL; //&m_presentDone[0];
+				pi.pWaitSemaphores    = NULL;
 				pi.swapchainCount = 1;
 				pi.swapchainCount = 1;
 				pi.pSwapchains    = &m_swapchain;
 				pi.pSwapchains    = &m_swapchain;
 				pi.pImageIndices  = &m_backBufferColorIdx;
 				pi.pImageIndices  = &m_backBufferColorIdx;
 				pi.pResults       = NULL;
 				pi.pResults       = NULL;
 				VkResult result = vkQueuePresentKHR(m_queueGraphics, &pi);
 				VkResult result = vkQueuePresentKHR(m_queueGraphics, &pi);
-				if (VK_ERROR_OUT_OF_DATE_KHR == result || VK_SUBOPTIMAL_KHR == result)
+				if (VK_ERROR_OUT_OF_DATE_KHR == result
+				||  VK_SUBOPTIMAL_KHR        == result)
 				{
 				{
 					m_needToRefreshSwapchain = true;
 					m_needToRefreshSwapchain = true;
 				}
 				}
-				else
-				{
-					VK_CHECK(result);
-				}
 			}
 			}
 		}
 		}
 
 
@@ -5719,7 +5716,7 @@ VK_DESTROY
 		uint8_t primIndex = uint8_t(primType >> BGFX_STATE_PT_SHIFT);
 		uint8_t primIndex = uint8_t(primType >> BGFX_STATE_PT_SHIFT);
 		PrimInfo prim = s_primInfo[primIndex];
 		PrimInfo prim = s_primInfo[primIndex];
 
 
-		bool wasCompute = false;
+		bool wasCompute     = false;
 		bool viewHasScissor = false;
 		bool viewHasScissor = false;
 		bool restoreScissor = false;
 		bool restoreScissor = false;
 		Rect viewScissorRect;
 		Rect viewScissorRect;
@@ -5735,22 +5732,21 @@ VK_DESTROY
 		uint32_t statsKeyType[2] = {};
 		uint32_t statsKeyType[2] = {};
 
 
 		VkSemaphore renderWait = m_presentDone[m_backBufferColorIdx];
 		VkSemaphore renderWait = m_presentDone[m_backBufferColorIdx];
-		VkResult result = vkAcquireNextImageKHR(m_device
-				, m_swapchain
-				, UINT64_MAX
-				, renderWait
-				, VK_NULL_HANDLE
-				, &m_backBufferColorIdx
-				);
-		if (VK_ERROR_OUT_OF_DATE_KHR == result || VK_SUBOPTIMAL_KHR == result)
+		VkResult result = vkAcquireNextImageKHR(
+			  m_device
+			, m_swapchain
+			, UINT64_MAX
+			, renderWait
+			, VK_NULL_HANDLE
+			, &m_backBufferColorIdx
+			);
+
+		if (VK_ERROR_OUT_OF_DATE_KHR == result
+		||  VK_SUBOPTIMAL_KHR        == result)
 		{
 		{
 			m_needToRefreshSwapchain = true;
 			m_needToRefreshSwapchain = true;
 			return;
 			return;
 		}
 		}
-		else
-		{
-			VK_CHECK(result);
-		}
 
 
 //		const uint64_t f0 = BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_FACTOR, BGFX_STATE_BLEND_FACTOR);
 //		const uint64_t f0 = BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_FACTOR, BGFX_STATE_BLEND_FACTOR);
 //		const uint64_t f1 = BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_INV_FACTOR, BGFX_STATE_BLEND_INV_FACTOR);
 //		const uint64_t f1 = BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_INV_FACTOR, BGFX_STATE_BLEND_INV_FACTOR);