Vulkan: Add strict flag to memory type selection

This commit is contained in:
Stenzek
2019-10-02 21:27:32 +10:00
parent e6ae204600
commit c557aa4a15
4 changed files with 75 additions and 69 deletions

View File

@ -5,6 +5,7 @@
#pragma once
#include <memory>
#include <optional>
#include <vector>
#include "Common/CommonTypes.h"
@ -99,12 +100,12 @@ public:
float GetMaxSamplerAnisotropy() const { return m_device_properties.limits.maxSamplerAnisotropy; }
// Finds a memory type index for the specified memory properties and the bits returned by
// vkGetImageMemoryRequirements
bool GetMemoryType(u32 bits, VkMemoryPropertyFlags properties, u32* out_type_index);
u32 GetMemoryType(u32 bits, VkMemoryPropertyFlags properties);
std::optional<u32> GetMemoryType(u32 bits, VkMemoryPropertyFlags properties, bool strict,
bool* is_coherent = nullptr);
// Finds a memory type for upload or readback buffers.
u32 GetUploadMemoryType(u32 bits, bool* is_coherent = nullptr);
u32 GetReadbackMemoryType(u32 bits, bool* is_coherent = nullptr, bool* is_cached = nullptr);
u32 GetReadbackMemoryType(u32 bits, bool* is_coherent = nullptr);
private:
using ExtensionList = std::vector<const char*>;