Fixed MSVC warnings.

This commit is contained in:
Branimir Karadžić
2025-08-23 19:54:01 -07:00
parent cbe6789a93
commit 30331f4142
2 changed files with 5 additions and 5 deletions

View File

@@ -4379,7 +4379,7 @@ VK_IMPORT_DEVICE
{
// Check LRU cache.
int memoryType = selectMemoryType(requirements->memoryTypeBits, propertyFlags, 0);
bool found = m_memoryLru.find(requirements->size, memoryType, memory);
bool found = m_memoryLru.find(bx::narrowCast<uint32_t>(requirements->size), memoryType, memory);
if (found)
{
return VK_SUCCESS;
@@ -4404,7 +4404,7 @@ VK_IMPORT_DEVICE
BGFX_PROFILER_SCOPE("vkAllocateMemory", kColorResource);
ma.memoryTypeIndex = searchIndex;
memory->memoryTypeIndex = searchIndex;
memory->size = ma.allocationSize;
memory->size = bx::narrowCast<uint32_t>(ma.allocationSize);
memory->offset = 0;
result = vkAllocateMemory(m_device, &ma, m_allocatorCb, &memory->mem);
}
@@ -4750,7 +4750,7 @@ VK_DESTROY
// with a handful of tiny allocations.
if (alloc.size >= _size && _size * 2 >= alloc.size)
{
uint32_t waste = alloc.size - _size;
uint32_t waste = bx::narrowCast<uint32_t>(alloc.size - _size);
if (waste < bestWaste)
{
bestIdx = slot;