From: Slawomir Cygan Date: Fri, 2 Mar 2018 16:37:20 +0000 (+0100) Subject: Check VkPhysicalDevicePushDescriptorPropertiesKHR X-Git-Tag: upstream/1.3.5~2724 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6aa6deca35f8b89e06044a4a1bff35101b5752d0;p=platform%2Fupstream%2FVK-GL-CTS.git Check VkPhysicalDevicePushDescriptorPropertiesKHR This adds test for getting VkPhysicalDevicePushDescriptorPropertiesKHR using vkGetPhysicalDeviceProperties2. The test also verifies maxPushDescriptors against spec requiremnts. Components: Vulkan VK-GL-CTS Issue: 1053 Affects: dEQP-VK.api.info.get_physical_device_properties2.properties Change-Id: I44ee1b0a3005d149cc7fb3c60414a412e36c45a4 --- diff --git a/external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp b/external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp index e31f610..1b7a616 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp @@ -2662,6 +2662,16 @@ string toString (const VkPhysicalDeviceVariablePointerFeatures& value) return s.str(); } +string toString(const VkPhysicalDevicePushDescriptorPropertiesKHR& value) +{ + std::ostringstream s; + s << "VkPhysicalDevicePushDescriptorPropertiesKHR = {\n"; + s << "\tsType = " << value.sType << '\n'; + s << "\tmaxPushDescriptors = " << value.maxPushDescriptors << '\n'; + s << '}'; + return s.str(); +} + bool checkExtension (vector& properties, const char* extension) { for (size_t ndx = 0; ndx < properties.size(); ++ndx) @@ -2978,6 +2988,40 @@ tcu::TestStatus deviceProperties2 (Context& context) << TestLog::Message << toString(pointClippingProperties[0]) << TestLog::EndMessage << TestLog::Message << toString(protectedMemoryPropertiesKHR[0]) << TestLog::EndMessage << TestLog::Message << toString(subgroupProperties[0]) << TestLog::EndMessage; + } + + const vector extensions = enumerateDeviceExtensionProperties(vki, physicalDevice, DE_NULL); + + if (isExtensionSupported(extensions, RequiredExtension("VK_KHR_push_descriptor"))) + { + const int count = 2u; + VkPhysicalDevicePushDescriptorPropertiesKHR pushDescriptorProperties[count]; + + for (int ndx = 0; ndx < count; ++ndx) + { + deMemset(&pushDescriptorProperties[ndx], 0, sizeof(VkPhysicalDevicePushDescriptorPropertiesKHR)); + + pushDescriptorProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR; + pushDescriptorProperties[ndx].pNext = DE_NULL; + + extProperties.pNext = &pushDescriptorProperties[ndx]; + + vki.getPhysicalDeviceProperties2(physicalDevice, &extProperties); + + pushDescriptorProperties[ndx].pNext = DE_NULL; + } + + if (deMemCmp(&pushDescriptorProperties[0], &pushDescriptorProperties[1], sizeof(VkPhysicalDevicePushDescriptorPropertiesKHR)) != 0) + { + TCU_FAIL("Mismatch in vkGetPhysicalDeviceProperties2 in VkPhysicalDevicePushDescriptorPropertiesKHR "); + } + + log << TestLog::Message << toString(pushDescriptorProperties[0]) << TestLog::EndMessage; + + if (pushDescriptorProperties[0].maxPushDescriptors < 32) + { + TCU_FAIL("VkPhysicalDevicePushDescriptorPropertiesKHR.maxPushDescriptors must be at least 32"); + } } return tcu::TestStatus::pass("Querying device properties succeeded");