Guard VmaWriteMagicValue / VmaValidateMagicValue on VMA_DEBUG_MARGIN > 0
Avoids some compiler warnings in the default case (VMA_DEBUG_MARGIN == 0)
This commit is contained in:
parent
daa6a551f8
commit
0021c38ac8
1 changed files with 6 additions and 0 deletions
|
@ -3725,16 +3725,21 @@ static inline bool VmaIsBufferImageGranularityConflict(
|
|||
|
||||
static void VmaWriteMagicValue(void* pData, VkDeviceSize offset)
|
||||
{
|
||||
#if VMA_DEBUG_MARGIN > 0
|
||||
uint32_t* pDst = (uint32_t*)((char*)pData + offset);
|
||||
const size_t numberCount = VMA_DEBUG_MARGIN / sizeof(uint32_t);
|
||||
for(size_t i = 0; i < numberCount; ++i, ++pDst)
|
||||
{
|
||||
*pDst = VMA_CORRUPTION_DETECTION_MAGIC_VALUE;
|
||||
}
|
||||
#else
|
||||
// no-op
|
||||
#endif
|
||||
}
|
||||
|
||||
static bool VmaValidateMagicValue(const void* pData, VkDeviceSize offset)
|
||||
{
|
||||
#if VMA_DEBUG_MARGIN > 0
|
||||
const uint32_t* pSrc = (const uint32_t*)((const char*)pData + offset);
|
||||
const size_t numberCount = VMA_DEBUG_MARGIN / sizeof(uint32_t);
|
||||
for(size_t i = 0; i < numberCount; ++i, ++pSrc)
|
||||
|
@ -3744,6 +3749,7 @@ static bool VmaValidateMagicValue(const void* pData, VkDeviceSize offset)
|
|||
return false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue