Add helpers for querying format properties
authorPyry Haulos <phaulos@google.com>
Thu, 21 Jan 2016 19:03:32 +0000 (11:03 -0800)
committerPyry Haulos <phaulos@google.com>
Thu, 21 Jan 2016 19:03:32 +0000 (11:03 -0800)
Change-Id: Ie39a312edbe56a7e09b1c0412a275a15aae74c22

external/vulkancts/framework/vulkan/vkQueryUtil.cpp
external/vulkancts/framework/vulkan/vkQueryUtil.hpp

index 6d1fbf4dbbffb40418780767cdd25c0336b3ed71..60e16de7a488307c8654a3e9e5e6de348075aac7 100644 (file)
@@ -108,12 +108,33 @@ VkPhysicalDeviceMemoryProperties getPhysicalDeviceMemoryProperties (const Instan
        return properties;
 }
 
+VkFormatProperties getPhysicalDeviceFormatProperties (const InstanceInterface& vk, VkPhysicalDevice physicalDevice, VkFormat format)
+{
+       VkFormatProperties      properties;
+
+       deMemset(&properties, 0, sizeof(properties));
+
+       vk.getPhysicalDeviceFormatProperties(physicalDevice, format, &properties);
+       return properties;
+}
+
+VkImageFormatProperties getPhysicalDeviceImageFormatProperties (const InstanceInterface& vk, VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags)
+{
+       VkImageFormatProperties properties;
+
+       deMemset(&properties, 0, sizeof(properties));
+
+       vk.getPhysicalDeviceImageFormatProperties(physicalDevice, format, type, tiling, usage, flags, &properties);
+       return properties;
+}
+
 VkMemoryRequirements getBufferMemoryRequirements (const DeviceInterface& vk, VkDevice device, VkBuffer buffer)
 {
        VkMemoryRequirements req;
        vk.getBufferMemoryRequirements(device, buffer, &req);
        return req;
 }
+
 VkMemoryRequirements getImageMemoryRequirements (const DeviceInterface& vk, VkDevice device, VkImage image)
 {
        VkMemoryRequirements req;
index d142f541c4409e60cc571b4c7625aad836041d58..a203b8e3482bd7a9160de5b49e5056aa1a465f6d 100644 (file)
@@ -47,6 +47,8 @@ std::vector<VkQueueFamilyProperties>  getPhysicalDeviceQueueFamilyProperties  (con
 VkPhysicalDeviceFeatures                               getPhysicalDeviceFeatures                               (const InstanceInterface& vk, VkPhysicalDevice physicalDevice);
 VkPhysicalDeviceProperties                             getPhysicalDeviceProperties                             (const InstanceInterface& vk, VkPhysicalDevice physicalDevice);
 VkPhysicalDeviceMemoryProperties               getPhysicalDeviceMemoryProperties               (const InstanceInterface& vk, VkPhysicalDevice physicalDevice);
+VkFormatProperties                                             getPhysicalDeviceFormatProperties               (const InstanceInterface& vk, VkPhysicalDevice physicalDevice, VkFormat format);
+VkImageFormatProperties                                        getPhysicalDeviceImageFormatProperties  (const InstanceInterface& vk, VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags);
 
 VkMemoryRequirements                                   getBufferMemoryRequirements                             (const DeviceInterface& vk, VkDevice device, VkBuffer buffer);
 VkMemoryRequirements                                   getImageMemoryRequirements                              (const DeviceInterface& vk, VkDevice device, VkImage image);