From 2c2ecdfca90e0f4736ac4c2bba7305dec12ffdc3 Mon Sep 17 00:00:00 2001 From: Jeff Bolz Date: Sun, 5 Apr 2020 02:02:52 -0500 Subject: [PATCH] Add tests for VK_EXT_private_data Component: Vulkan New Tests: dEQP-VK.api.object_management.private_data.* New Tests: dEQP-VK.wsi.*.private_data.* Change-Id: I465e0969cc5f1e82dc2e1face019412ecfb44e27 (cherry picked from commit 44ef9e08c4592207c0f3d81ed385bac078f1925a) --- android/cts/master/vk-master-2020-03-01.txt | 58 ++++ android/cts/master/vk-master.txt | 58 ++++ .../vulkancts/framework/vulkan/vkObjTypeImpl.inl | 47 +++ .../vulkan/api/vktApiObjectManagementTests.cpp | 328 ++++++++++++++++++++- .../modules/vulkan/wsi/vktWsiSwapchainTests.cpp | 197 ++++++++++++- external/vulkancts/mustpass/master/vk-default.txt | 94 ++++++ external/vulkancts/scripts/gen_framework.py | 17 ++ 7 files changed, 779 insertions(+), 20 deletions(-) create mode 100644 external/vulkancts/framework/vulkan/vkObjTypeImpl.inl mode change 100644 => 100755 external/vulkancts/scripts/gen_framework.py diff --git a/android/cts/master/vk-master-2020-03-01.txt b/android/cts/master/vk-master-2020-03-01.txt index f85adec..253d65d 100644 --- a/android/cts/master/vk-master-2020-03-01.txt +++ b/android/cts/master/vk-master-2020-03-01.txt @@ -27,6 +27,46 @@ dEQP-VK.api.info.vulkan1p2_limits_validation.ext_line_rasterization dEQP-VK.api.device_init.create_instance_extension_name_abuse dEQP-VK.api.device_init.create_instance_layer_name_abuse dEQP-VK.api.device_init.enumerate_devices_alloc_leak +dEQP-VK.api.object_management.private_data.device_memory_small +dEQP-VK.api.object_management.private_data.buffer_uniform_small +dEQP-VK.api.object_management.private_data.buffer_uniform_large +dEQP-VK.api.object_management.private_data.buffer_storage_small +dEQP-VK.api.object_management.private_data.buffer_storage_large +dEQP-VK.api.object_management.private_data.buffer_view_uniform_r8g8b8a8_unorm +dEQP-VK.api.object_management.private_data.buffer_view_storage_r8g8b8a8_unorm +dEQP-VK.api.object_management.private_data.image_1d +dEQP-VK.api.object_management.private_data.image_2d +dEQP-VK.api.object_management.private_data.image_3d +dEQP-VK.api.object_management.private_data.image_view_1d +dEQP-VK.api.object_management.private_data.image_view_1d_arr +dEQP-VK.api.object_management.private_data.image_view_2d +dEQP-VK.api.object_management.private_data.image_view_2d_arr +dEQP-VK.api.object_management.private_data.image_view_cube +dEQP-VK.api.object_management.private_data.image_view_cube_arr +dEQP-VK.api.object_management.private_data.image_view_3d +dEQP-VK.api.object_management.private_data.semaphore +dEQP-VK.api.object_management.private_data.event +dEQP-VK.api.object_management.private_data.fence +dEQP-VK.api.object_management.private_data.fence_signaled +dEQP-VK.api.object_management.private_data.query_pool +dEQP-VK.api.object_management.private_data.sampler +dEQP-VK.api.object_management.private_data.shader_module +dEQP-VK.api.object_management.private_data.pipeline_cache +dEQP-VK.api.object_management.private_data.pipeline_layout_empty +dEQP-VK.api.object_management.private_data.pipeline_layout_single +dEQP-VK.api.object_management.private_data.render_pass +dEQP-VK.api.object_management.private_data.graphics_pipeline +dEQP-VK.api.object_management.private_data.compute_pipeline +dEQP-VK.api.object_management.private_data.descriptor_set_layout_empty +dEQP-VK.api.object_management.private_data.descriptor_set_layout_single +dEQP-VK.api.object_management.private_data.descriptor_pool +dEQP-VK.api.object_management.private_data.descriptor_pool_free_descriptor_set +dEQP-VK.api.object_management.private_data.descriptor_set +dEQP-VK.api.object_management.private_data.framebuffer +dEQP-VK.api.object_management.private_data.command_pool +dEQP-VK.api.object_management.private_data.command_pool_transient +dEQP-VK.api.object_management.private_data.command_buffer_primary +dEQP-VK.api.object_management.private_data.command_buffer_secondary dEQP-VK.api.buffer.basic.size_max_uint64 dEQP-VK.api.buffer_marker.graphics.external_host_mem.top_of_pipe.sequential.4 dEQP-VK.api.buffer_marker.graphics.external_host_mem.top_of_pipe.sequential.64 @@ -156795,6 +156835,15 @@ dEQP-VK.wsi.android.swapchain.render.10swapchains dEQP-VK.wsi.android.swapchain.render.10swapchains2 dEQP-VK.wsi.android.swapchain.acquire.too_many dEQP-VK.wsi.android.swapchain.acquire.too_many_timeout +dEQP-VK.wsi.android.swapchain.private_data.min_image_count +dEQP-VK.wsi.android.swapchain.private_data.image_format +dEQP-VK.wsi.android.swapchain.private_data.image_array_layers +dEQP-VK.wsi.android.swapchain.private_data.image_usage +dEQP-VK.wsi.android.swapchain.private_data.image_sharing_mode +dEQP-VK.wsi.android.swapchain.private_data.pre_transform +dEQP-VK.wsi.android.swapchain.private_data.composite_alpha +dEQP-VK.wsi.android.swapchain.private_data.present_mode +dEQP-VK.wsi.android.swapchain.private_data.clipped dEQP-VK.wsi.macos.surface.query_presentation_support dEQP-VK.wsi.macos.surface.query_surface_counters dEQP-VK.wsi.macos.swapchain.create.image_swapchain_create_info @@ -156808,6 +156857,15 @@ dEQP-VK.wsi.macos.swapchain.render.10swapchains dEQP-VK.wsi.macos.swapchain.render.10swapchains2 dEQP-VK.wsi.macos.swapchain.acquire.too_many dEQP-VK.wsi.macos.swapchain.acquire.too_many_timeout +dEQP-VK.wsi.macos.swapchain.private_data.min_image_count +dEQP-VK.wsi.macos.swapchain.private_data.image_format +dEQP-VK.wsi.macos.swapchain.private_data.image_array_layers +dEQP-VK.wsi.macos.swapchain.private_data.image_usage +dEQP-VK.wsi.macos.swapchain.private_data.image_sharing_mode +dEQP-VK.wsi.macos.swapchain.private_data.pre_transform +dEQP-VK.wsi.macos.swapchain.private_data.composite_alpha +dEQP-VK.wsi.macos.swapchain.private_data.present_mode +dEQP-VK.wsi.macos.swapchain.private_data.clipped dEQP-VK.wsi.display.surface_counters dEQP-VK.wsi.display_control.swapchain_counter dEQP-VK.wsi.display_control.display_power_control diff --git a/android/cts/master/vk-master.txt b/android/cts/master/vk-master.txt index 082b732..a14c096 100644 --- a/android/cts/master/vk-master.txt +++ b/android/cts/master/vk-master.txt @@ -4125,6 +4125,46 @@ dEQP-VK.api.object_management.alloc_callback_fail_multiple.compute_pipeline dEQP-VK.api.object_management.alloc_callback_fail_multiple.descriptor_set dEQP-VK.api.object_management.alloc_callback_fail_multiple.command_buffer_primary dEQP-VK.api.object_management.alloc_callback_fail_multiple.command_buffer_secondary +dEQP-VK.api.object_management.private_data.device_memory_small +dEQP-VK.api.object_management.private_data.buffer_uniform_small +dEQP-VK.api.object_management.private_data.buffer_uniform_large +dEQP-VK.api.object_management.private_data.buffer_storage_small +dEQP-VK.api.object_management.private_data.buffer_storage_large +dEQP-VK.api.object_management.private_data.buffer_view_uniform_r8g8b8a8_unorm +dEQP-VK.api.object_management.private_data.buffer_view_storage_r8g8b8a8_unorm +dEQP-VK.api.object_management.private_data.image_1d +dEQP-VK.api.object_management.private_data.image_2d +dEQP-VK.api.object_management.private_data.image_3d +dEQP-VK.api.object_management.private_data.image_view_1d +dEQP-VK.api.object_management.private_data.image_view_1d_arr +dEQP-VK.api.object_management.private_data.image_view_2d +dEQP-VK.api.object_management.private_data.image_view_2d_arr +dEQP-VK.api.object_management.private_data.image_view_cube +dEQP-VK.api.object_management.private_data.image_view_cube_arr +dEQP-VK.api.object_management.private_data.image_view_3d +dEQP-VK.api.object_management.private_data.semaphore +dEQP-VK.api.object_management.private_data.event +dEQP-VK.api.object_management.private_data.fence +dEQP-VK.api.object_management.private_data.fence_signaled +dEQP-VK.api.object_management.private_data.query_pool +dEQP-VK.api.object_management.private_data.sampler +dEQP-VK.api.object_management.private_data.shader_module +dEQP-VK.api.object_management.private_data.pipeline_cache +dEQP-VK.api.object_management.private_data.pipeline_layout_empty +dEQP-VK.api.object_management.private_data.pipeline_layout_single +dEQP-VK.api.object_management.private_data.render_pass +dEQP-VK.api.object_management.private_data.graphics_pipeline +dEQP-VK.api.object_management.private_data.compute_pipeline +dEQP-VK.api.object_management.private_data.descriptor_set_layout_empty +dEQP-VK.api.object_management.private_data.descriptor_set_layout_single +dEQP-VK.api.object_management.private_data.descriptor_pool +dEQP-VK.api.object_management.private_data.descriptor_pool_free_descriptor_set +dEQP-VK.api.object_management.private_data.descriptor_set +dEQP-VK.api.object_management.private_data.framebuffer +dEQP-VK.api.object_management.private_data.command_pool +dEQP-VK.api.object_management.private_data.command_pool_transient +dEQP-VK.api.object_management.private_data.command_buffer_primary +dEQP-VK.api.object_management.private_data.command_buffer_secondary dEQP-VK.api.buffer.suballocation.transfer_src.transfer_dst.uniform_texel.storage_texel.uniform.storage.index.vertex.indirect.create.zero dEQP-VK.api.buffer.suballocation.transfer_src.transfer_dst.uniform_texel.storage_texel.uniform.storage.index.vertex.indirect.create.binding dEQP-VK.api.buffer.suballocation.transfer_src.transfer_dst.uniform_texel.storage_texel.uniform.storage.index.vertex.indirect.create.binding_residency @@ -480067,6 +480107,15 @@ dEQP-VK.wsi.android.swapchain.get_images.incomplete dEQP-VK.wsi.android.swapchain.get_images.count dEQP-VK.wsi.android.swapchain.acquire.too_many dEQP-VK.wsi.android.swapchain.acquire.too_many_timeout +dEQP-VK.wsi.android.swapchain.private_data.min_image_count +dEQP-VK.wsi.android.swapchain.private_data.image_format +dEQP-VK.wsi.android.swapchain.private_data.image_array_layers +dEQP-VK.wsi.android.swapchain.private_data.image_usage +dEQP-VK.wsi.android.swapchain.private_data.image_sharing_mode +dEQP-VK.wsi.android.swapchain.private_data.pre_transform +dEQP-VK.wsi.android.swapchain.private_data.composite_alpha +dEQP-VK.wsi.android.swapchain.private_data.present_mode +dEQP-VK.wsi.android.swapchain.private_data.clipped dEQP-VK.wsi.android.incremental_present.scale_none.immediate.identity.opaque.reference dEQP-VK.wsi.android.incremental_present.scale_none.immediate.identity.opaque.incremental_present dEQP-VK.wsi.android.incremental_present.scale_none.immediate.identity.pre_multiplied.reference @@ -480850,6 +480899,15 @@ dEQP-VK.wsi.macos.swapchain.get_images.incomplete dEQP-VK.wsi.macos.swapchain.get_images.count dEQP-VK.wsi.macos.swapchain.acquire.too_many dEQP-VK.wsi.macos.swapchain.acquire.too_many_timeout +dEQP-VK.wsi.macos.swapchain.private_data.min_image_count +dEQP-VK.wsi.macos.swapchain.private_data.image_format +dEQP-VK.wsi.macos.swapchain.private_data.image_array_layers +dEQP-VK.wsi.macos.swapchain.private_data.image_usage +dEQP-VK.wsi.macos.swapchain.private_data.image_sharing_mode +dEQP-VK.wsi.macos.swapchain.private_data.pre_transform +dEQP-VK.wsi.macos.swapchain.private_data.composite_alpha +dEQP-VK.wsi.macos.swapchain.private_data.present_mode +dEQP-VK.wsi.macos.swapchain.private_data.clipped dEQP-VK.wsi.macos.incremental_present.scale_none.immediate.identity.opaque.reference dEQP-VK.wsi.macos.incremental_present.scale_none.immediate.identity.opaque.incremental_present dEQP-VK.wsi.macos.incremental_present.scale_none.immediate.identity.pre_multiplied.reference diff --git a/external/vulkancts/framework/vulkan/vkObjTypeImpl.inl b/external/vulkancts/framework/vulkan/vkObjTypeImpl.inl new file mode 100644 index 0000000..18435cc --- /dev/null +++ b/external/vulkancts/framework/vulkan/vkObjTypeImpl.inl @@ -0,0 +1,47 @@ +/* WARNING: This is auto-generated file. Do not modify, since changes will + * be lost! Modify the generating script instead. + */ +namespace vk +{ +template VkObjectType getObjectType (void); +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_INSTANCE; } +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_PHYSICAL_DEVICE; } +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_DEVICE; } +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_QUEUE; } +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_SEMAPHORE; } +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_COMMAND_BUFFER; } +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_FENCE; } +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_DEVICE_MEMORY; } +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_BUFFER; } +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_IMAGE; } +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_EVENT; } +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_QUERY_POOL; } +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_BUFFER_VIEW; } +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_IMAGE_VIEW; } +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_SHADER_MODULE; } +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_PIPELINE_CACHE; } +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_PIPELINE_LAYOUT; } +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_RENDER_PASS; } +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_PIPELINE; } +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT; } +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_SAMPLER; } +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_DESCRIPTOR_POOL; } +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_DESCRIPTOR_SET; } +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_FRAMEBUFFER; } +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_COMMAND_POOL; } +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION; } +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE; } +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_SURFACE_KHR; } +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_SWAPCHAIN_KHR; } +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_DISPLAY_KHR; } +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_DISPLAY_MODE_KHR; } +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT; } +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT; } +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_VALIDATION_CACHE_EXT; } +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR; } +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_PERFORMANCE_CONFIGURATION_INTEL; } +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NV; } +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_PRIVATE_DATA_SLOT_EXT; } +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_DEFERRED_OPERATION_KHR; } +template<> inline VkObjectType getObjectType (void) { return VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV; } +} diff --git a/external/vulkancts/modules/vulkan/api/vktApiObjectManagementTests.cpp b/external/vulkancts/modules/vulkan/api/vktApiObjectManagementTests.cpp index 5e867f5..fdd6bb8 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiObjectManagementTests.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiObjectManagementTests.cpp @@ -35,8 +35,11 @@ #include "vkPlatform.hpp" #include "vkStrUtil.hpp" #include "vkAllocationCallbackUtil.hpp" +#include "vkObjTypeImpl.inl" #include "vkObjUtil.hpp" +#include "vktTestGroupUtil.hpp" + #include "tcuVector.hpp" #include "tcuResultCollector.hpp" #include "tcuCommandLine.hpp" @@ -2333,6 +2336,276 @@ tcu::TestStatus createMultipleSharedResourcesTest (Context& context, typename Ob return tcu::TestStatus::pass("Ok"); } + +// Class to wrap singleton devices used by private_data tests +class SingletonDevice +{ + Move createPrivateDataDevice(const Context &context, int idx) + { + const int requestedSlots[NUM_DEVICES][2] = + { + {0, 0}, + {1, 0}, + {1, 1}, + {4, 4}, + {1, 100}, + }; + + const float queuePriority = 1.0; + const VkDeviceQueueCreateInfo queues[] = + { + { + VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO, + DE_NULL, + (VkDeviceQueueCreateFlags)0, + context.getUniversalQueueFamilyIndex(), + 1u, // queueCount + &queuePriority, // pQueuePriorities + } + }; + + VkDevicePrivateDataCreateInfoEXT pdci0 = + { + VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO_EXT, // VkStructureType sType; + DE_NULL, // const void* pNext; + 0u, // uint32_t privateDataSlotRequestCount; + }; + VkDevicePrivateDataCreateInfoEXT pdci1 = + { + VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO_EXT, // VkStructureType sType; + DE_NULL, // const void* pNext; + 0u, // uint32_t privateDataSlotRequestCount; + }; + void *pNext = DE_NULL; + + if (requestedSlots[idx][0]) + { + pNext = &pdci0; + pdci0.privateDataSlotRequestCount = requestedSlots[idx][0]; + if (requestedSlots[idx][1]) + { + pdci0.pNext = &pdci1; + pdci1.privateDataSlotRequestCount = requestedSlots[idx][1]; + } + } + + VkPhysicalDevicePrivateDataFeaturesEXT privateDataFeatures = + { + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES_EXT, // VkStructureType sType; + pNext, // void* pNext; + VK_TRUE, // VkBool32 privateData; + }; + pNext = &privateDataFeatures; + + const char *extName = "VK_EXT_private_data"; + + const VkDeviceCreateInfo deviceInfo = + { + VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO, + pNext, + (VkDeviceCreateFlags)0, + DE_LENGTH_OF_ARRAY(queues), + queues, + 0u, // enabledLayerNameCount + DE_NULL, // ppEnabledLayerNames + 1u, // enabledExtensionNameCount + &extName, // ppEnabledExtensionNames + DE_NULL, // pEnabledFeatures + }; + + Move device = createCustomDevice(context.getTestContext().getCommandLine().isValidationEnabled(), + context.getPlatformInterface(), context.getInstance(), context.getInstanceInterface(), context.getPhysicalDevice(), &deviceInfo, DE_NULL); + return device; + } + + SingletonDevice (const Context& context, int idx) + : m_logicalDevice (createPrivateDataDevice(context, idx)) + { + } + + +public: + + static const int NUM_DEVICES = 5; + + static const Unique& getDevice(const Context& context, int idx) + { + if (!m_singletonDevice[idx]) + m_singletonDevice[idx] = SharedPtr(new SingletonDevice(context, idx)); + + DE_ASSERT(m_singletonDevice[idx]); + return m_singletonDevice[idx]->m_logicalDevice; + } + + static void destroy() + { + for (int idx = 0; idx < NUM_DEVICES; ++idx) + m_singletonDevice[idx].clear(); + } + +private: + const Unique m_logicalDevice; + static SharedPtr m_singletonDevice[NUM_DEVICES]; +}; + +SharedPtr SingletonDevice::m_singletonDevice[NUM_DEVICES]; + +template static deUint64 HandleToInt(T t) { return t.getInternal(); } +template static deUint64 HandleToInt(T *t) { return (deUint64)(deUintptr)(t); } + +template +tcu::TestStatus createPrivateDataTest (Context& context, typename Object::Parameters params) +{ + if (!context.getPrivateDataFeaturesEXT().privateData) + TCU_THROW(NotSupportedError, "privateData not supported"); + + for (int d = 0; d < SingletonDevice::NUM_DEVICES; ++d) + { + const Unique& device = SingletonDevice::getDevice(context, d); + const Environment env (context.getPlatformInterface(), + context.getUsedApiVersion(), + context.getInstanceInterface(), + context.getInstance(), + context.getDeviceInterface(), + *device, + context.getUniversalQueueFamilyIndex(), + context.getBinaryCollection(), + DE_NULL, + 4u, + context.getTestContext().getCommandLine()); + + const typename Object::Resources res (env, params); + + const VkPrivateDataSlotCreateInfoEXT createInfo = + { + VK_STRUCTURE_TYPE_PRIVATE_DATA_SLOT_CREATE_INFO_EXT, // VkStructureType sType; + DE_NULL, // const void* pNext; + 0u, // VkPrivateDataSlotCreateFlagsEXT flags; + }; + + const int numSlots = 100; + + typedef Unique PrivateDataSlotUp; + typedef SharedPtr PrivateDataSlotSp; + vector slots; + + // interleave allocating objects and slots + for (int i = 0; i < numSlots / 2; ++i) + { + Move s = createPrivateDataSlotEXT(env.vkd, *device, &createInfo, DE_NULL); + slots.push_back(PrivateDataSlotSp(new PrivateDataSlotUp(s))); + } + + Unique obj0 (Object::create(env, res, params)); + Unique obj1 (Object::create(env, res, params)); + + for (int i = numSlots / 2; i < numSlots; ++i) + { + Move s = createPrivateDataSlotEXT(env.vkd, *device, &createInfo, DE_NULL); + slots.push_back(PrivateDataSlotSp(new PrivateDataSlotUp(s))); + } + + Unique obj2 (Object::create(env, res, params)); + Unique obj3 (Object::create(env, res, params)); + + Unique *objs[4] = { &obj0, &obj1, &obj2, &obj3 }; + + for (int r = 0; r < 3; ++r) + { + deUint64 data; + + // Test private data for the objects + for (int o = 0; o < 4; ++o) + { + auto &obj = *objs[o]; + for (int i = 0; i < numSlots; ++i) + { + data = 1234; + env.vkd.getPrivateDataEXT(*device, getObjectType(), HandleToInt(obj.get()), **slots[i], &data); + if (data != 0) + return tcu::TestStatus::fail("Expected initial value of zero"); + } + } + for (int o = 0; o < 4; ++o) + { + auto &obj = *objs[o]; + for (int i = 0; i < numSlots; ++i) + VK_CHECK(env.vkd.setPrivateDataEXT(*device, getObjectType(), HandleToInt(obj.get()), **slots[i], i*i*i + o*o + 1)); + } + for (int o = 0; o < 4; ++o) + { + auto &obj = *objs[o]; + for (int i = 0; i < numSlots; ++i) + { + data = 1234; + env.vkd.getPrivateDataEXT(*device, getObjectType(), HandleToInt(obj.get()), **slots[i], &data); + if (data != (deUint64)(i*i*i + o*o + 1)) + return tcu::TestStatus::fail("Didn't read back set value"); + } + } + + + // Test private data for the private data objects + for (int o = 0; o < numSlots; ++o) + { + auto &obj = **slots[o]; + for (int i = 0; i < numSlots; ++i) + { + data = 1234; + env.vkd.getPrivateDataEXT(*device, VK_OBJECT_TYPE_PRIVATE_DATA_SLOT_EXT, HandleToInt(obj), **slots[i], &data); + if (data != 0) + return tcu::TestStatus::fail("Expected initial value of zero"); + } + } + for (int o = 0; o < numSlots; ++o) + { + auto &obj = **slots[o]; + for (int i = 0; i < numSlots; ++i) + VK_CHECK(env.vkd.setPrivateDataEXT(*device, VK_OBJECT_TYPE_PRIVATE_DATA_SLOT_EXT, HandleToInt(obj), **slots[i], i*i*i + o*o + 1)); + } + for (int o = 0; o < numSlots; ++o) + { + auto &obj = **slots[o]; + for (int i = 0; i < numSlots; ++i) + { + data = 1234; + env.vkd.getPrivateDataEXT(*device, VK_OBJECT_TYPE_PRIVATE_DATA_SLOT_EXT, HandleToInt(obj), **slots[i], &data); + if (data != (deUint64)(i*i*i + o*o + 1)) + return tcu::TestStatus::fail("Didn't read back set value"); + } + } + + // Test private data for the device + for (int i = 0; i < numSlots; ++i) + { + data = 1234; + env.vkd.getPrivateDataEXT(*device, VK_OBJECT_TYPE_DEVICE, (deUint64)(deUintptr)(*device), **slots[i], &data); + if (data != 0) + return tcu::TestStatus::fail("Expected initial value of zero for device"); + } + for (int i = 0; i < numSlots; ++i) + VK_CHECK(env.vkd.setPrivateDataEXT(*device, VK_OBJECT_TYPE_DEVICE, (deUint64)(deUintptr)(*device), **slots[i], i*i*i + r*r + 1)); + for (int i = 0; i < numSlots; ++i) + { + data = 1234; + env.vkd.getPrivateDataEXT(*device, VK_OBJECT_TYPE_DEVICE, (deUint64)(deUintptr)(*device), **slots[i], &data); + if (data != (deUint64)(i*i*i + r*r + 1)) + return tcu::TestStatus::fail("Didn't read back set value from device"); + } + + // Destroy and realloc slots for the next iteration + slots.clear(); + for (int i = 0; i < numSlots; ++i) + { + Move s = createPrivateDataSlotEXT(env.vkd, *device, &createInfo, DE_NULL); + slots.push_back(PrivateDataSlotSp(new PrivateDataSlotUp(s))); + } + } + } + + return tcu::TestStatus::pass("Ok"); +} + template tcu::TestStatus createMaxConcurrentTest (Context& context, typename Object::Parameters params) { @@ -2811,23 +3084,21 @@ struct CaseDescriptions }; template -void addCases (const MovePtr& group, const CaseDescription& cases) +void addCases (tcu::TestCaseGroup *group, const CaseDescription& cases) { for (const NamedParameters* cur = cases.paramsBegin; cur != cases.paramsEnd; ++cur) - addFunctionCase(group.get(), cur->name, "", cases.function, cur->parameters); + addFunctionCase(group, cur->name, "", cases.function, cur->parameters); } template -void addCasesWithProgs (const MovePtr& group, const CaseDescription& cases) +void addCasesWithProgs (tcu::TestCaseGroup *group, const CaseDescription& cases) { for (const NamedParameters* cur = cases.paramsBegin; cur != cases.paramsEnd; ++cur) - addFunctionCaseWithPrograms(group.get(), cur->name, "", Object::initPrograms, cases.function, cur->parameters); + addFunctionCaseWithPrograms(group, cur->name, "", Object::initPrograms, cases.function, cur->parameters); } -tcu::TestCaseGroup* createGroup (tcu::TestContext& testCtx, const char* name, const char* desc, const CaseDescriptions& cases) +static void createTests (tcu::TestCaseGroup* group, CaseDescriptions cases) { - MovePtr group (new tcu::TestCaseGroup(testCtx, name, desc)); - addCases (group, cases.instance); addCases (group, cases.device); addCases (group, cases.deviceGroup); @@ -2853,7 +3124,20 @@ tcu::TestCaseGroup* createGroup (tcu::TestContext& testCtx, const char* name, co addCases (group, cases.framebuffer); addCases (group, cases.commandPool); addCases (group, cases.commandBuffer); +} +static void cleanupGroup (tcu::TestCaseGroup* group, CaseDescriptions cases) +{ + DE_UNREF(group); + DE_UNREF(cases); + // Destroy singleton object + SingletonDevice::destroy(); +} + +tcu::TestCaseGroup* createGroup (tcu::TestContext& testCtx, const char* name, const char* desc, const CaseDescriptions& cases) +{ + MovePtr group (new tcu::TestCaseGroup(testCtx, name, desc)); + createTests(group.get(), cases); return group.release(); } @@ -3300,6 +3584,36 @@ tcu::TestCaseGroup* createObjectManagementTests (tcu::TestContext& testCtx) }; objectMgmtTests->addChild(createGroup(testCtx, "alloc_callback_fail_multiple", "Allocation callback failure creating multiple objects with one call", s_allocCallbackFailMultipleObjectsGroup)); + const CaseDescriptions s_privateDataResourcesGroup = + { + EMPTY_CASE_DESC(Instance), // Does not make sense + EMPTY_CASE_DESC(Device), // Device is tested in each object test + EMPTY_CASE_DESC(DeviceGroup), // Device is tested in each object test + CASE_DESC(createPrivateDataTest , s_deviceMemCases), + CASE_DESC(createPrivateDataTest , s_bufferCases), + CASE_DESC(createPrivateDataTest , s_bufferViewCases), + CASE_DESC(createPrivateDataTest , s_imageCases), + CASE_DESC(createPrivateDataTest , s_imageViewCases), + CASE_DESC(createPrivateDataTest , s_semaphoreCases), + CASE_DESC(createPrivateDataTest , s_eventCases), + CASE_DESC(createPrivateDataTest , s_fenceCases), + CASE_DESC(createPrivateDataTest , s_queryPoolCases), + CASE_DESC(createPrivateDataTest , s_shaderModuleCases), + CASE_DESC(createPrivateDataTest , s_pipelineCacheCases), + CASE_DESC(createPrivateDataTest , s_pipelineLayoutCases), + CASE_DESC(createPrivateDataTest , s_renderPassCases), + CASE_DESC(createPrivateDataTest , s_graphicsPipelineCases), + CASE_DESC(createPrivateDataTest , s_computePipelineCases), + CASE_DESC(createPrivateDataTest , s_descriptorSetLayoutCases), + CASE_DESC(createPrivateDataTest , s_samplerCases), + CASE_DESC(createPrivateDataTest , s_descriptorPoolCases), + CASE_DESC(createPrivateDataTest , s_descriptorSetCases), + CASE_DESC(createPrivateDataTest , s_framebufferCases), + CASE_DESC(createPrivateDataTest , s_commandPoolCases), + CASE_DESC(createPrivateDataTest , s_commandBufferCases), + }; + objectMgmtTests->addChild(createTestGroup(testCtx, "private_data", "Multiple objects with private data", createTests, s_privateDataResourcesGroup, cleanupGroup)); + return objectMgmtTests.release(); } diff --git a/external/vulkancts/modules/vulkan/wsi/vktWsiSwapchainTests.cpp b/external/vulkancts/modules/vulkan/wsi/vktWsiSwapchainTests.cpp index 11b87bd..a8e63c2 100644 --- a/external/vulkancts/modules/vulkan/wsi/vktWsiSwapchainTests.cpp +++ b/external/vulkancts/modules/vulkan/wsi/vktWsiSwapchainTests.cpp @@ -41,6 +41,7 @@ #include "vkWsiUtil.hpp" #include "vkAllocationCallbackUtil.hpp" #include "vkCmdUtil.hpp" +#include "vkObjTypeImpl.inl" #include "vkObjUtil.hpp" #include "tcuCommandLine.hpp" @@ -74,6 +75,7 @@ using tcu::UVec2; using de::MovePtr; using de::UniquePtr; +using de::SharedPtr; using std::string; using std::vector; @@ -154,24 +156,45 @@ Move createDeviceWithWsi (const PlatformInterface& vkp, queueInfos.push_back(info); } + const void * pNext = nullptr; const VkPhysicalDeviceFeatures features = getDeviceFeaturesForWsi(); - const char* const extensions[] = { "VK_KHR_swapchain" }; + + VkDevicePrivateDataCreateInfoEXT pdci = + { + VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO_EXT, // VkStructureType sType; + DE_NULL, // const void* pNext; + 4u, // uint32_t privateDataSlotRequestCount; + }; + VkPhysicalDevicePrivateDataFeaturesEXT privateDataFeatures = + { + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES_EXT, // VkStructureType sType; + &pdci, // void* pNext; + VK_TRUE, // VkBool32 privateData; + }; + + vector extensions; + extensions.push_back("VK_KHR_swapchain"); + if (isExtensionSupported(supportedExtensions, RequiredExtension("VK_EXT_private_data"))) + { + extensions.push_back("VK_EXT_private_data"); + pNext = &privateDataFeatures; + } const VkDeviceCreateInfo deviceParams = { VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO, - DE_NULL, + pNext, (VkDeviceCreateFlags)0, static_cast(queueInfos.size()), queueInfos.data(), 0u, // enabledLayerCount DE_NULL, // ppEnabledLayerNames - DE_LENGTH_OF_ARRAY(extensions), // enabledExtensionCount - DE_ARRAY_BEGIN(extensions), // ppEnabledExtensionNames + (deUint32)extensions.size(), // enabledExtensionCount + &extensions[0], // ppEnabledExtensionNames &features }; - for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(extensions); ++ndx) + for (int ndx = 0; ndx < (int)extensions.size(); ++ndx) { if (!isExtensionSupported(supportedExtensions, RequiredExtension(extensions[ndx]))) TCU_THROW(NotSupportedError, (string(extensions[ndx]) + " is not supported").c_str()); @@ -309,7 +332,7 @@ MovePtr createDisplay (const vk::Platform& platform, catch (const tcu::NotSupportedError& e) { if (isExtensionSupported(supportedExtensions, RequiredExtension(getExtensionName(wsiType))) && - platform.hasDisplay(wsiType)) + platform.hasDisplay(wsiType)) { // If VK_KHR_{platform}_surface was supported, vk::Platform implementation // must support creating native display & window for that WSI type. @@ -741,6 +764,141 @@ tcu::TestStatus createSwapchainTest (Context& context, TestParameters params) return tcu::TestStatus::pass("No sub-case failed"); } +template static deUint64 HandleToInt(T t) { return t.getInternal(); } + +tcu::TestStatus createSwapchainPrivateDataTest (Context& context, TestParameters params) +{ + if (!context.getPrivateDataFeaturesEXT().privateData) + TCU_THROW(NotSupportedError, "privateData not supported"); + + tcu::TestLog& log = context.getTestContext().getLog(); + const InstanceHelper instHelper (context, params.wsiType); + const NativeObjects native (context, instHelper.supportedExtensions, params.wsiType); + const Unique surface (createSurface(instHelper.vki, instHelper.instance, params.wsiType, native.getDisplay(), native.getWindow())); + const MultiQueueDeviceHelper devHelper (context, instHelper.vki, instHelper.instance, *surface); + const vector cases (generateSwapchainParameterCases(params.wsiType, params.dimension, instHelper.vki, devHelper.physicalDevice, *surface)); + + for (size_t caseNdx = 0; caseNdx < cases.size(); ++caseNdx) + { + std::ostringstream subcase; + subcase << "Sub-case " << (caseNdx+1) << " / " << cases.size() << ": "; + + VkSwapchainCreateInfoKHR curParams = cases[caseNdx]; + + if (curParams.imageSharingMode == VK_SHARING_MODE_CONCURRENT) + { + const deUint32 numFamilies = static_cast(devHelper.queueFamilyIndices.size()); + if (numFamilies < 2u) + TCU_THROW(NotSupportedError, "Only " + de::toString(numFamilies) + " queue families available for VK_SHARING_MODE_CONCURRENT"); + curParams.queueFamilyIndexCount = numFamilies; + } + else + { + // Take only the first queue. + if (devHelper.queueFamilyIndices.empty()) + TCU_THROW(NotSupportedError, "No queue families compatible with the given surface"); + curParams.queueFamilyIndexCount = 1u; + } + curParams.pQueueFamilyIndices = devHelper.queueFamilyIndices.data(); + curParams.surface = *surface; + + log << TestLog::Message << subcase.str() << curParams << TestLog::EndMessage; + + // The Vulkan 1.1.87 spec contains the following VU for VkSwapchainCreateInfoKHR: + // + // * imageFormat, imageUsage, imageExtent, and imageArrayLayers must be supported for VK_IMAGE_TYPE_2D + // VK_IMAGE_TILING_OPTIMAL images as reported by vkGetPhysicalDeviceImageFormatProperties. + VkImageFormatProperties properties; + const VkResult propertiesResult = instHelper.vki.getPhysicalDeviceImageFormatProperties(devHelper.physicalDevice, + curParams.imageFormat, + VK_IMAGE_TYPE_2D, + VK_IMAGE_TILING_OPTIMAL, + curParams.imageUsage, + 0, // flags + &properties); + + log << TestLog::Message << subcase.str() + << "vkGetPhysicalDeviceImageFormatProperties => " + << getResultStr(propertiesResult) << TestLog::EndMessage; + + switch (propertiesResult) { + case VK_SUCCESS: + { + const Unique swapchain (createSwapchainKHR(devHelper.vkd, *devHelper.device, &curParams)); + + const int numSlots = 100; + typedef Unique PrivateDataSlotUp; + typedef SharedPtr PrivateDataSlotSp; + vector slots; + + const VkPrivateDataSlotCreateInfoEXT createInfo = + { + VK_STRUCTURE_TYPE_PRIVATE_DATA_SLOT_CREATE_INFO_EXT, // VkStructureType sType; + DE_NULL, // const void* pNext; + 0u, // VkPrivateDataSlotCreateFlagsEXT flags; + }; + + for (int i = 0; i < numSlots; ++i) + { + Move s = createPrivateDataSlotEXT(devHelper.vkd, *devHelper.device, &createInfo, DE_NULL); + slots.push_back(PrivateDataSlotSp(new PrivateDataSlotUp(s))); + } + + // Based on code in vktApiObjectManagementTests.cpp + for (int r = 0; r < 3; ++r) + { + deUint64 data; + + for (int i = 0; i < numSlots; ++i) + { + data = 1234; + devHelper.vkd.getPrivateDataEXT(*devHelper.device, getObjectType(), HandleToInt(swapchain.get()), **slots[i], &data); + // Don't test default value of zero on Android, due to spec erratum + if (params.wsiType != TYPE_ANDROID) + { + if (data != 0) + return tcu::TestStatus::fail("Expected initial value of zero"); + } + } + + for (int i = 0; i < numSlots; ++i) + VK_CHECK(devHelper.vkd.setPrivateDataEXT(*devHelper.device, getObjectType(), HandleToInt(swapchain.get()), **slots[i], i*i*i + 1)); + + for (int i = 0; i < numSlots; ++i) + { + data = 1234; + devHelper.vkd.getPrivateDataEXT(*devHelper.device, getObjectType(), HandleToInt(swapchain.get()), **slots[i], &data); + if (data != (deUint64)(i*i*i + 1)) + return tcu::TestStatus::fail("Didn't read back set value"); + } + + // Destroy and realloc slots for the next iteration + slots.clear(); + for (int i = 0; i < numSlots; ++i) + { + Move s = createPrivateDataSlotEXT(devHelper.vkd, *devHelper.device, &createInfo, DE_NULL); + slots.push_back(PrivateDataSlotSp(new PrivateDataSlotUp(s))); + } + } + + + } + break; + case VK_ERROR_FORMAT_NOT_SUPPORTED: + log << TestLog::Message << subcase.str() + << "Skip because vkGetPhysicalDeviceImageFormatProperties returned VK_ERROR_FORMAT_NOT_SUPPORTED" << TestLog::EndMessage; + break; + default: + log << TestLog::Message << subcase.str() + << "Fail because vkGetPhysicalDeviceImageFormatProperties returned " + << getResultStr(propertiesResult) << TestLog::EndMessage; + return tcu::TestStatus::fail("Unexpected result from vkGetPhysicalDeviceImageFormatProperties"); + } + } + + return tcu::TestStatus::pass("No sub-case failed"); +} + tcu::TestStatus createSwapchainSimulateOOMTest (Context& context, TestParameters params) { const size_t maxCases = 300u; @@ -974,6 +1132,18 @@ void populateSwapchainGroup (tcu::TestCaseGroup* testGroup, GroupParameters para addFunctionCase(testGroup, "image_swapchain_create_info", "Test VkImageSwapchainCreateInfoKHR", testImageSwapchainCreateInfo, params.wsiType); } +void populateSwapchainPrivateDataGroup (tcu::TestCaseGroup* testGroup, GroupParameters params) +{ + for (int dimensionNdx = 0; dimensionNdx < TEST_DIMENSION_LAST; ++dimensionNdx) + { + const TestDimension testDimension = (TestDimension)dimensionNdx; + if (testDimension == TEST_DIMENSION_IMAGE_EXTENT) + continue; + + addFunctionCase(testGroup, getTestDimensionName(testDimension), "", params.function, TestParameters(params.wsiType, testDimension)); + } +} + VkSwapchainCreateInfoKHR getBasicSwapchainParameters (Type wsiType, const InstanceInterface& vki, VkPhysicalDevice physicalDevice, @@ -2475,13 +2645,14 @@ void populateAcquireGroup (tcu::TestCaseGroup* testGroup, Type wsiType) void createSwapchainTests (tcu::TestCaseGroup* testGroup, vk::wsi::Type wsiType) { - addTestGroup(testGroup, "create", "Create VkSwapchain with various parameters", populateSwapchainGroup, GroupParameters(wsiType, createSwapchainTest)); - addTestGroup(testGroup, "simulate_oom", "Simulate OOM using callbacks during swapchain construction", populateSwapchainGroup, GroupParameters(wsiType, createSwapchainSimulateOOMTest)); - addTestGroup(testGroup, "render", "Rendering Tests", populateRenderGroup, wsiType); - addTestGroup(testGroup, "modify", "Modify VkSwapchain", populateModifyGroup, wsiType); - addTestGroup(testGroup, "destroy", "Destroy VkSwapchain", populateDestroyGroup, wsiType); - addTestGroup(testGroup, "get_images", "Get swapchain images", populateGetImagesGroup, wsiType); - addTestGroup(testGroup, "acquire", "Ancquire next swapchain image", populateAcquireGroup, wsiType); + addTestGroup(testGroup, "create", "Create VkSwapchain with various parameters", populateSwapchainGroup, GroupParameters(wsiType, createSwapchainTest)); + addTestGroup(testGroup, "simulate_oom", "Simulate OOM using callbacks during swapchain construction", populateSwapchainGroup, GroupParameters(wsiType, createSwapchainSimulateOOMTest)); + addTestGroup(testGroup, "render", "Rendering Tests", populateRenderGroup, wsiType); + addTestGroup(testGroup, "modify", "Modify VkSwapchain", populateModifyGroup, wsiType); + addTestGroup(testGroup, "destroy", "Destroy VkSwapchain", populateDestroyGroup, wsiType); + addTestGroup(testGroup, "get_images", "Get swapchain images", populateGetImagesGroup, wsiType); + addTestGroup(testGroup, "acquire", "Ancquire next swapchain image", populateAcquireGroup, wsiType); + addTestGroup(testGroup, "private_data", "Create VkSwapchain and use VK_EXT_private_data", populateSwapchainPrivateDataGroup, GroupParameters(wsiType, createSwapchainPrivateDataTest)); } } // wsi diff --git a/external/vulkancts/mustpass/master/vk-default.txt b/external/vulkancts/mustpass/master/vk-default.txt index 3a4b975..b957985 100644 --- a/external/vulkancts/mustpass/master/vk-default.txt +++ b/external/vulkancts/mustpass/master/vk-default.txt @@ -4123,6 +4123,46 @@ dEQP-VK.api.object_management.alloc_callback_fail_multiple.compute_pipeline dEQP-VK.api.object_management.alloc_callback_fail_multiple.descriptor_set dEQP-VK.api.object_management.alloc_callback_fail_multiple.command_buffer_primary dEQP-VK.api.object_management.alloc_callback_fail_multiple.command_buffer_secondary +dEQP-VK.api.object_management.private_data.device_memory_small +dEQP-VK.api.object_management.private_data.buffer_uniform_small +dEQP-VK.api.object_management.private_data.buffer_uniform_large +dEQP-VK.api.object_management.private_data.buffer_storage_small +dEQP-VK.api.object_management.private_data.buffer_storage_large +dEQP-VK.api.object_management.private_data.buffer_view_uniform_r8g8b8a8_unorm +dEQP-VK.api.object_management.private_data.buffer_view_storage_r8g8b8a8_unorm +dEQP-VK.api.object_management.private_data.image_1d +dEQP-VK.api.object_management.private_data.image_2d +dEQP-VK.api.object_management.private_data.image_3d +dEQP-VK.api.object_management.private_data.image_view_1d +dEQP-VK.api.object_management.private_data.image_view_1d_arr +dEQP-VK.api.object_management.private_data.image_view_2d +dEQP-VK.api.object_management.private_data.image_view_2d_arr +dEQP-VK.api.object_management.private_data.image_view_cube +dEQP-VK.api.object_management.private_data.image_view_cube_arr +dEQP-VK.api.object_management.private_data.image_view_3d +dEQP-VK.api.object_management.private_data.semaphore +dEQP-VK.api.object_management.private_data.event +dEQP-VK.api.object_management.private_data.fence +dEQP-VK.api.object_management.private_data.fence_signaled +dEQP-VK.api.object_management.private_data.query_pool +dEQP-VK.api.object_management.private_data.sampler +dEQP-VK.api.object_management.private_data.shader_module +dEQP-VK.api.object_management.private_data.pipeline_cache +dEQP-VK.api.object_management.private_data.pipeline_layout_empty +dEQP-VK.api.object_management.private_data.pipeline_layout_single +dEQP-VK.api.object_management.private_data.render_pass +dEQP-VK.api.object_management.private_data.graphics_pipeline +dEQP-VK.api.object_management.private_data.compute_pipeline +dEQP-VK.api.object_management.private_data.descriptor_set_layout_empty +dEQP-VK.api.object_management.private_data.descriptor_set_layout_single +dEQP-VK.api.object_management.private_data.descriptor_pool +dEQP-VK.api.object_management.private_data.descriptor_pool_free_descriptor_set +dEQP-VK.api.object_management.private_data.descriptor_set +dEQP-VK.api.object_management.private_data.framebuffer +dEQP-VK.api.object_management.private_data.command_pool +dEQP-VK.api.object_management.private_data.command_pool_transient +dEQP-VK.api.object_management.private_data.command_buffer_primary +dEQP-VK.api.object_management.private_data.command_buffer_secondary dEQP-VK.api.buffer.suballocation.transfer_src.transfer_dst.uniform_texel.storage_texel.uniform.storage.index.vertex.indirect.create.zero dEQP-VK.api.buffer.suballocation.transfer_src.transfer_dst.uniform_texel.storage_texel.uniform.storage.index.vertex.indirect.create.binding dEQP-VK.api.buffer.suballocation.transfer_src.transfer_dst.uniform_texel.storage_texel.uniform.storage.index.vertex.indirect.create.binding_residency @@ -479982,6 +480022,15 @@ dEQP-VK.wsi.xlib.swapchain.get_images.incomplete dEQP-VK.wsi.xlib.swapchain.get_images.count dEQP-VK.wsi.xlib.swapchain.acquire.too_many dEQP-VK.wsi.xlib.swapchain.acquire.too_many_timeout +dEQP-VK.wsi.xlib.swapchain.private_data.min_image_count +dEQP-VK.wsi.xlib.swapchain.private_data.image_format +dEQP-VK.wsi.xlib.swapchain.private_data.image_array_layers +dEQP-VK.wsi.xlib.swapchain.private_data.image_usage +dEQP-VK.wsi.xlib.swapchain.private_data.image_sharing_mode +dEQP-VK.wsi.xlib.swapchain.private_data.pre_transform +dEQP-VK.wsi.xlib.swapchain.private_data.composite_alpha +dEQP-VK.wsi.xlib.swapchain.private_data.present_mode +dEQP-VK.wsi.xlib.swapchain.private_data.clipped dEQP-VK.wsi.xlib.incremental_present.scale_none.immediate.identity.opaque.reference dEQP-VK.wsi.xlib.incremental_present.scale_none.immediate.identity.opaque.incremental_present dEQP-VK.wsi.xlib.incremental_present.scale_none.immediate.identity.pre_multiplied.reference @@ -480405,6 +480454,15 @@ dEQP-VK.wsi.xcb.swapchain.get_images.incomplete dEQP-VK.wsi.xcb.swapchain.get_images.count dEQP-VK.wsi.xcb.swapchain.acquire.too_many dEQP-VK.wsi.xcb.swapchain.acquire.too_many_timeout +dEQP-VK.wsi.xcb.swapchain.private_data.min_image_count +dEQP-VK.wsi.xcb.swapchain.private_data.image_format +dEQP-VK.wsi.xcb.swapchain.private_data.image_array_layers +dEQP-VK.wsi.xcb.swapchain.private_data.image_usage +dEQP-VK.wsi.xcb.swapchain.private_data.image_sharing_mode +dEQP-VK.wsi.xcb.swapchain.private_data.pre_transform +dEQP-VK.wsi.xcb.swapchain.private_data.composite_alpha +dEQP-VK.wsi.xcb.swapchain.private_data.present_mode +dEQP-VK.wsi.xcb.swapchain.private_data.clipped dEQP-VK.wsi.xcb.incremental_present.scale_none.immediate.identity.opaque.reference dEQP-VK.wsi.xcb.incremental_present.scale_none.immediate.identity.opaque.incremental_present dEQP-VK.wsi.xcb.incremental_present.scale_none.immediate.identity.pre_multiplied.reference @@ -480827,6 +480885,15 @@ dEQP-VK.wsi.wayland.swapchain.get_images.incomplete dEQP-VK.wsi.wayland.swapchain.get_images.count dEQP-VK.wsi.wayland.swapchain.acquire.too_many dEQP-VK.wsi.wayland.swapchain.acquire.too_many_timeout +dEQP-VK.wsi.wayland.swapchain.private_data.min_image_count +dEQP-VK.wsi.wayland.swapchain.private_data.image_format +dEQP-VK.wsi.wayland.swapchain.private_data.image_array_layers +dEQP-VK.wsi.wayland.swapchain.private_data.image_usage +dEQP-VK.wsi.wayland.swapchain.private_data.image_sharing_mode +dEQP-VK.wsi.wayland.swapchain.private_data.pre_transform +dEQP-VK.wsi.wayland.swapchain.private_data.composite_alpha +dEQP-VK.wsi.wayland.swapchain.private_data.present_mode +dEQP-VK.wsi.wayland.swapchain.private_data.clipped dEQP-VK.wsi.wayland.incremental_present.scale_none.immediate.identity.opaque.reference dEQP-VK.wsi.wayland.incremental_present.scale_none.immediate.identity.opaque.incremental_present dEQP-VK.wsi.wayland.incremental_present.scale_none.immediate.identity.pre_multiplied.reference @@ -481250,6 +481317,15 @@ dEQP-VK.wsi.android.swapchain.get_images.incomplete dEQP-VK.wsi.android.swapchain.get_images.count dEQP-VK.wsi.android.swapchain.acquire.too_many dEQP-VK.wsi.android.swapchain.acquire.too_many_timeout +dEQP-VK.wsi.android.swapchain.private_data.min_image_count +dEQP-VK.wsi.android.swapchain.private_data.image_format +dEQP-VK.wsi.android.swapchain.private_data.image_array_layers +dEQP-VK.wsi.android.swapchain.private_data.image_usage +dEQP-VK.wsi.android.swapchain.private_data.image_sharing_mode +dEQP-VK.wsi.android.swapchain.private_data.pre_transform +dEQP-VK.wsi.android.swapchain.private_data.composite_alpha +dEQP-VK.wsi.android.swapchain.private_data.present_mode +dEQP-VK.wsi.android.swapchain.private_data.clipped dEQP-VK.wsi.android.incremental_present.scale_none.immediate.identity.opaque.reference dEQP-VK.wsi.android.incremental_present.scale_none.immediate.identity.opaque.incremental_present dEQP-VK.wsi.android.incremental_present.scale_none.immediate.identity.pre_multiplied.reference @@ -482393,6 +482469,15 @@ dEQP-VK.wsi.win32.swapchain.get_images.incomplete dEQP-VK.wsi.win32.swapchain.get_images.count dEQP-VK.wsi.win32.swapchain.acquire.too_many dEQP-VK.wsi.win32.swapchain.acquire.too_many_timeout +dEQP-VK.wsi.win32.swapchain.private_data.min_image_count +dEQP-VK.wsi.win32.swapchain.private_data.image_format +dEQP-VK.wsi.win32.swapchain.private_data.image_array_layers +dEQP-VK.wsi.win32.swapchain.private_data.image_usage +dEQP-VK.wsi.win32.swapchain.private_data.image_sharing_mode +dEQP-VK.wsi.win32.swapchain.private_data.pre_transform +dEQP-VK.wsi.win32.swapchain.private_data.composite_alpha +dEQP-VK.wsi.win32.swapchain.private_data.present_mode +dEQP-VK.wsi.win32.swapchain.private_data.clipped dEQP-VK.wsi.win32.incremental_present.scale_none.immediate.identity.opaque.reference dEQP-VK.wsi.win32.incremental_present.scale_none.immediate.identity.opaque.incremental_present dEQP-VK.wsi.win32.incremental_present.scale_none.immediate.identity.pre_multiplied.reference @@ -482816,6 +482901,15 @@ dEQP-VK.wsi.macos.swapchain.get_images.incomplete dEQP-VK.wsi.macos.swapchain.get_images.count dEQP-VK.wsi.macos.swapchain.acquire.too_many dEQP-VK.wsi.macos.swapchain.acquire.too_many_timeout +dEQP-VK.wsi.macos.swapchain.private_data.min_image_count +dEQP-VK.wsi.macos.swapchain.private_data.image_format +dEQP-VK.wsi.macos.swapchain.private_data.image_array_layers +dEQP-VK.wsi.macos.swapchain.private_data.image_usage +dEQP-VK.wsi.macos.swapchain.private_data.image_sharing_mode +dEQP-VK.wsi.macos.swapchain.private_data.pre_transform +dEQP-VK.wsi.macos.swapchain.private_data.composite_alpha +dEQP-VK.wsi.macos.swapchain.private_data.present_mode +dEQP-VK.wsi.macos.swapchain.private_data.clipped dEQP-VK.wsi.macos.incremental_present.scale_none.immediate.identity.opaque.reference dEQP-VK.wsi.macos.incremental_present.scale_none.immediate.identity.opaque.incremental_present dEQP-VK.wsi.macos.incremental_present.scale_none.immediate.identity.pre_multiplied.reference diff --git a/external/vulkancts/scripts/gen_framework.py b/external/vulkancts/scripts/gen_framework.py old mode 100644 new mode 100755 index 3d52a00..fa3bab3 --- a/external/vulkancts/scripts/gen_framework.py +++ b/external/vulkancts/scripts/gen_framework.py @@ -1162,6 +1162,22 @@ def writeStrUtilImpl (api, filename): yield "}" writeInlFile(filename, INL_HEADER, makeStrUtilImpl()) + +def writeObjTypeImpl (api, filename): + def makeObjTypeImpl (): + + yield "namespace vk" + yield "{" + + yield "template VkObjectType getObjectType (void);" + + for line in indentLines(["template<> inline VkObjectType\tgetObjectType<%s>\t(void) { return %s;\t}" % (handle.name, prefixName("VK_OBJECT_TYPE_", handle.name)) for handle in api.handles if not handle.isAlias]): + yield line + + yield "}" + + writeInlFile(filename, INL_HEADER, makeObjTypeImpl()) + class ConstructorFunction: def __init__ (self, type, name, objectType, ifaceArgs, arguments): self.type = type @@ -2188,3 +2204,4 @@ if __name__ == "__main__": writeMandatoryFeatures ( os.path.join(VULKAN_DIR, "vkMandatoryFeatures.inl")) writeExtensionList ( os.path.join(VULKAN_DIR, "vkInstanceExtensions.inl"), 'INSTANCE') writeExtensionList ( os.path.join(VULKAN_DIR, "vkDeviceExtensions.inl"), 'DEVICE') + writeObjTypeImpl (api, os.path.join(VULKAN_DIR, "vkObjTypeImpl.inl")) -- 2.7.4