From c1488a63a5e64477eccae0b284738b664d7883d8 Mon Sep 17 00:00:00 2001 From: Pyry Haulos Date: Thu, 21 Jan 2016 11:03:32 -0800 Subject: [PATCH] Add helpers for querying format properties Change-Id: Ie39a312edbe56a7e09b1c0412a275a15aae74c22 --- external/vulkancts/framework/vulkan/vkQueryUtil.cpp | 21 +++++++++++++++++++++ external/vulkancts/framework/vulkan/vkQueryUtil.hpp | 2 ++ 2 files changed, 23 insertions(+) diff --git a/external/vulkancts/framework/vulkan/vkQueryUtil.cpp b/external/vulkancts/framework/vulkan/vkQueryUtil.cpp index 6d1fbf4..60e16de 100644 --- a/external/vulkancts/framework/vulkan/vkQueryUtil.cpp +++ b/external/vulkancts/framework/vulkan/vkQueryUtil.cpp @@ -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; diff --git a/external/vulkancts/framework/vulkan/vkQueryUtil.hpp b/external/vulkancts/framework/vulkan/vkQueryUtil.hpp index d142f54..a203b8e 100644 --- a/external/vulkancts/framework/vulkan/vkQueryUtil.hpp +++ b/external/vulkancts/framework/vulkan/vkQueryUtil.hpp @@ -47,6 +47,8 @@ std::vector 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); -- 2.7.4