From: Pyry Haulos Date: Thu, 21 Jan 2016 19:03:32 +0000 (-0800) Subject: Add helpers for querying format properties X-Git-Tag: upstream/0.1.0~812^2~118 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c1488a63a5e64477eccae0b284738b664d7883d8;p=platform%2Fupstream%2FVK-GL-CTS.git Add helpers for querying format properties Change-Id: Ie39a312edbe56a7e09b1c0412a275a15aae74c22 --- 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);