Fix for Linux GCC cont'd. Enabled warning level 4 in Visual Studio for compilation of vk_mem_alloc.h. (Cherry pick from v1)

This commit is contained in:
Adam Sawicki 2017-07-04 15:47:00 +02:00
parent 7ec64121d8
commit b0425876ec
2 changed files with 9 additions and 13 deletions

View File

@ -27,8 +27,11 @@
#define VK_USE_PLATFORM_WIN32_KHR
#include <vulkan/vulkan.h>
#pragma warning(push, 4)
#pragma warning(disable: 4127) // warning C4127: conditional expression is constant
#define VMA_IMPLEMENTATION
#include "vk_mem_alloc.h"
#pragma warning(pop)
#define MATHFU_COMPILE_WITHOUT_SIMD_SUPPORT
#include <mathfu/glsl_mappings.h>
@ -1714,7 +1717,7 @@ int main()
RECT rect = { 0, 0, g_SizeX, g_SizeY };
AdjustWindowRectEx(&rect, style, FALSE, exStyle);
HWND hWnd = CreateWindowEx(
CreateWindowEx(
exStyle, WINDOW_CLASS_NAME, APP_TITLE_W, style,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
NULL, NULL, g_hAppInstance, NULL);

View File

@ -528,7 +528,7 @@ typedef struct VmaDefragmentationInfo {
VkDeviceSize maxBytesToMove;
/** \brief Maximum number of allocations that can be moved to different place.
Default is UINT_MAX, which means no limit.
Default is UINT32_MAX, which means no limit.
*/
uint32_t maxAllocationsToMove;
} VmaDefragmentationInfo;
@ -1156,13 +1156,6 @@ public:
m_Count(0),
m_Capacity(0)
{
}
m_Allocator(allocator),
m_pArray(VMA_NULL),
m_Count(0),
m_Capacity(0)
{
}
VmaVector(size_t count, const AllocatorT& allocator) :
@ -2653,7 +2646,7 @@ struct VmaSuballocationItemSizeLess
};
VmaBlock::VmaBlock(VmaAllocator hAllocator) :
m_MemoryTypeIndex(UINT_MAX),
m_MemoryTypeIndex(UINT32_MAX),
m_BlockVectorType(VMA_BLOCK_VECTOR_TYPE_COUNT),
m_hMemory(VK_NULL_HANDLE),
m_Size(0),
@ -4418,7 +4411,7 @@ VkResult VmaAllocator_T::Defragment(
// Main processing.
VkDeviceSize maxBytesToMove = SIZE_MAX;
uint32_t maxAllocationsToMove = UINT_MAX;
uint32_t maxAllocationsToMove = UINT32_MAX;
if(pDefragmentationInfo != VMA_NULL)
{
maxBytesToMove = pDefragmentationInfo->maxBytesToMove;
@ -4849,8 +4842,8 @@ VkResult vmaFindMemoryTypeIndex(
if((pMemoryRequirements->flags & VMA_MEMORY_REQUIREMENT_PERSISTENT_MAP_BIT) != 0)
requiredFlags |= VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
*pMemoryTypeIndex = UINT_MAX;
uint32_t minCost = UINT_MAX;
*pMemoryTypeIndex = UINT32_MAX;
uint32_t minCost = UINT32_MAX;
for(uint32_t memTypeIndex = 0, memTypeBit = 1;
memTypeIndex < allocator->GetMemoryTypeCount();
++memTypeIndex, memTypeBit <<= 1)