add requested refactoring

This commit is contained in:
Jugurta 2024-08-22 12:57:17 +00:00 committed by GitHub
parent ca1e01ad05
commit 8f25ac55fb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -33,9 +33,11 @@ vk::MemoryPropertyFlags MakePropertyFlags(BufferType type) {
case BufferType::Upload: case BufferType::Upload:
return vk::MemoryPropertyFlagBits::eHostVisible | vk::MemoryPropertyFlagBits::eHostCoherent; return vk::MemoryPropertyFlagBits::eHostVisible | vk::MemoryPropertyFlagBits::eHostCoherent;
case BufferType::Download: case BufferType::Download:
return vk::MemoryPropertyFlagBits::eHostVisible | vk::MemoryPropertyFlagBits::eHostCoherent | vk::MemoryPropertyFlagBits::eHostCached; return vk::MemoryPropertyFlagBits::eHostVisible |
vk::MemoryPropertyFlagBits::eHostCoherent | vk::MemoryPropertyFlagBits::eHostCached;
case BufferType::Stream: case BufferType::Stream:
return vk::MemoryPropertyFlagBits::eDeviceLocal | vk::MemoryPropertyFlagBits::eHostVisible | vk::MemoryPropertyFlagBits::eHostCoherent; return vk::MemoryPropertyFlagBits::eDeviceLocal | vk::MemoryPropertyFlagBits::eHostVisible |
vk::MemoryPropertyFlagBits::eHostCoherent;
default: default:
UNREACHABLE_MSG("Unknown buffer type {}", type); UNREACHABLE_MSG("Unknown buffer type {}", type);
return vk::MemoryPropertyFlagBits::eHostVisible; return vk::MemoryPropertyFlagBits::eHostVisible;
@ -78,9 +80,7 @@ u32 GetMemoryType(const vk::PhysicalDeviceMemoryProperties& properties, BufferTy
} }
// If we reach here, we couldn't find any suitable memory type // If we reach here, we couldn't find any suitable memory type
LOG_CRITICAL(Render_Vulkan, "Failed to find a suitable memory type for buffer type {}", UNREACHABLE_MSG("Failed to find a suitable memory type for buffer type {}", BufferTypeName(type));
BufferTypeName(type));
return 0; // Return 0 as a fallback, though this will likely cause issues
} }
constexpr u64 WATCHES_INITIAL_RESERVE = 0x4000; constexpr u64 WATCHES_INITIAL_RESERVE = 0x4000;