Browse Source

Fixed MSVC warnings.

Branimir Karadžić 1 year ago
parent
commit
6dfd865300
1 changed files with 6 additions and 6 deletions
  1. 6 6
      src/renderer_vk.cpp

+ 6 - 6
src/renderer_vk.cpp

@@ -6246,7 +6246,7 @@ VK_DESTROY
 					mappedMemory += imageInfos[ii].size;
 					mappedMemory += imageInfos[ii].size;
 					bufferCopyInfo[ii].bufferOffset += stagingBuffer.m_offset;
 					bufferCopyInfo[ii].bufferOffset += stagingBuffer.m_offset;
 					BX_ASSERT(
 					BX_ASSERT(
-						  bx::uint32_mod(bufferCopyInfo[ii].bufferOffset, dstBlockInfo.blockSize) == 0
+						  bx::uint32_mod(bx::narrowCast<uint32_t>(bufferCopyInfo[ii].bufferOffset), dstBlockInfo.blockSize) == 0
 						, "Alignment for subimage %u is not aligned correctly (%u)."
 						, "Alignment for subimage %u is not aligned correctly (%u)."
 						, ii, bufferCopyInfo[ii].bufferOffset, dstBlockInfo.blockSize
 						, ii, bufferCopyInfo[ii].bufferOffset, dstBlockInfo.blockSize
 						);
 						);
@@ -6538,7 +6538,7 @@ VK_DESTROY
 		for (uint32_t ii = 0; ii < _bufferImageCopyCount; ++ii)
 		for (uint32_t ii = 0; ii < _bufferImageCopyCount; ++ii)
 		{
 		{
 			BX_ASSERT(
 			BX_ASSERT(
-				  bx::uint32_mod(_bufferImageCopy[ii].bufferOffset, blockInfo.blockSize) == 0
+				  bx::uint32_mod(bx::narrowCast<uint32_t>(_bufferImageCopy[ii].bufferOffset), blockInfo.blockSize) == 0
 				, "Misaligned texture of type %s to offset %u, which is not a multiple of %u."
 				, "Misaligned texture of type %s to offset %u, which is not a multiple of %u."
 				, bimg::getName(format), _bufferImageCopy[ii].bufferOffset, blockInfo.blockSize
 				, bimg::getName(format), _bufferImageCopy[ii].bufferOffset, blockInfo.blockSize
 				);
 				);
@@ -8596,10 +8596,10 @@ VK_DESTROY
 						restoreScissor = false;
 						restoreScissor = false;
 
 
 						// Clamp the rect to what's valid according to Vulkan.
 						// Clamp the rect to what's valid according to Vulkan.
-						rect.m_width = bx::min(rect.m_width, fb.m_width - rect.m_x);
-						rect.m_height = bx::min(rect.m_height, fb.m_height - rect.m_y);
-						if (_render->m_view[view].m_rect.m_width != rect.m_width
-						 || _render->m_view[view].m_rect.m_height != rect.m_height)
+						rect.m_width  = bx::min(rect.m_width,  bx::narrowCast<uint16_t>(fb.m_width)  - rect.m_x);
+						rect.m_height = bx::min(rect.m_height, bx::narrowCast<uint16_t>(fb.m_height) - rect.m_y);
+						if (_render->m_view[view].m_rect.m_width  != rect.m_width
+						||  _render->m_view[view].m_rect.m_height != rect.m_height)
 						{
 						{
 							BX_TRACE("Clamp render pass from %dx%d to %dx%d"
 							BX_TRACE("Clamp render pass from %dx%d to %dx%d"
 								, _render->m_view[view].m_rect.m_width
 								, _render->m_view[view].m_rect.m_width