Fetch physical device format properties

This commit is contained in:
baldurk
2015-12-04 00:13:35 +01:00
parent 276099d55a
commit c19a0588b9
2 changed files with 6 additions and 0 deletions
+3
View File
@@ -181,6 +181,7 @@ private:
VkPhysicalDeviceFeatures features;
VkPhysicalDeviceProperties props;
VkPhysicalDeviceMemoryProperties memProps;
VkFormatProperties fmtprops[VK_FORMAT_NUM];
};
VkInstance m_Instance; // the instance corresponding to this WrappedVulkan
@@ -229,6 +230,8 @@ private:
{ return m_PhysicalDeviceData.features; }
const VkPhysicalDeviceProperties &GetDeviceProps()
{ return m_PhysicalDeviceData.props; }
const VkFormatProperties &GetFormatProperties(VkFormat f)
{ return m_PhysicalDeviceData.fmtprops[f]; }
uint32_t GetReadbackMemoryIndex(uint32_t resourceRequiredBitmask);
uint32_t GetUploadMemoryIndex(uint32_t resourceRequiredBitmask);
@@ -564,6 +564,9 @@ bool WrappedVulkan::Serialise_vkCreateDevice(
ObjDisp(physicalDevice)->GetPhysicalDeviceFeatures(Unwrap(physicalDevice), &m_PhysicalDeviceData.features);
for(int i=VK_FORMAT_BEGIN_RANGE+1; i < VK_FORMAT_END_RANGE; i++)
ObjDisp(physicalDevice)->GetPhysicalDeviceFormatProperties(Unwrap(physicalDevice), VkFormat(i), &m_PhysicalDeviceData.fmtprops[i]);
m_PhysicalDeviceData.readbackMemIndex = m_PhysicalDeviceData.GetMemoryIndex(~0U, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT, VK_MEMORY_PROPERTY_HOST_WRITE_COMBINED_BIT);
m_PhysicalDeviceData.uploadMemIndex = m_PhysicalDeviceData.GetMemoryIndex(~0U, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT, 0);
m_PhysicalDeviceData.GPULocalMemIndex = m_PhysicalDeviceData.GetMemoryIndex(~0U, VK_MEMORY_PROPERTY_DEVICE_ONLY, 0);