1e5c31af7Sopenharmony_ci/*------------------------------------------------------------------------- 2e5c31af7Sopenharmony_ci * Vulkan Conformance Tests 3e5c31af7Sopenharmony_ci * ------------------------ 4e5c31af7Sopenharmony_ci * 5e5c31af7Sopenharmony_ci * Copyright (c) 2016 The Khronos Group Inc. 6e5c31af7Sopenharmony_ci * 7e5c31af7Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 8e5c31af7Sopenharmony_ci * you may not use this file except in compliance with the License. 9e5c31af7Sopenharmony_ci * You may obtain a copy of the License at 10e5c31af7Sopenharmony_ci * 11e5c31af7Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 12e5c31af7Sopenharmony_ci * 13e5c31af7Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 14e5c31af7Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 15e5c31af7Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16e5c31af7Sopenharmony_ci * See the License for the specific language governing permissions and 17e5c31af7Sopenharmony_ci * limitations under the License. 18e5c31af7Sopenharmony_ci * 19e5c31af7Sopenharmony_ci *//*! 20e5c31af7Sopenharmony_ci * \file 21e5c31af7Sopenharmony_ci * \brief Null handle tests 22e5c31af7Sopenharmony_ci *//*--------------------------------------------------------------------*/ 23e5c31af7Sopenharmony_ci 24e5c31af7Sopenharmony_ci#include "vktApiNullHandleTests.hpp" 25e5c31af7Sopenharmony_ci#include "vktTestCaseUtil.hpp" 26e5c31af7Sopenharmony_ci#include "vktTestGroupUtil.hpp" 27e5c31af7Sopenharmony_ci 28e5c31af7Sopenharmony_ci#include "vkDefs.hpp" 29e5c31af7Sopenharmony_ci#include "vkRef.hpp" 30e5c31af7Sopenharmony_ci#include "vkRefUtil.hpp" 31e5c31af7Sopenharmony_ci#include "vkAllocationCallbackUtil.hpp" 32e5c31af7Sopenharmony_ci 33e5c31af7Sopenharmony_cinamespace vkt 34e5c31af7Sopenharmony_ci{ 35e5c31af7Sopenharmony_cinamespace api 36e5c31af7Sopenharmony_ci{ 37e5c31af7Sopenharmony_cinamespace 38e5c31af7Sopenharmony_ci{ 39e5c31af7Sopenharmony_ci 40e5c31af7Sopenharmony_ciusing namespace vk; 41e5c31af7Sopenharmony_ci 42e5c31af7Sopenharmony_ciinline void release (Context& context, VkBuffer buffer, const VkAllocationCallbacks* pAllocator) 43e5c31af7Sopenharmony_ci{ 44e5c31af7Sopenharmony_ci context.getDeviceInterface().destroyBuffer(context.getDevice(), buffer, pAllocator); 45e5c31af7Sopenharmony_ci} 46e5c31af7Sopenharmony_ci 47e5c31af7Sopenharmony_ciinline void release (Context& context, VkBufferView bufferView, const VkAllocationCallbacks* pAllocator) 48e5c31af7Sopenharmony_ci{ 49e5c31af7Sopenharmony_ci context.getDeviceInterface().destroyBufferView(context.getDevice(), bufferView, pAllocator); 50e5c31af7Sopenharmony_ci} 51e5c31af7Sopenharmony_ci 52e5c31af7Sopenharmony_ci#ifndef CTS_USES_VULKANSC 53e5c31af7Sopenharmony_ciinline void release (Context& context, VkCommandPool commandPool, const VkAllocationCallbacks* pAllocator) 54e5c31af7Sopenharmony_ci{ 55e5c31af7Sopenharmony_ci context.getDeviceInterface().destroyCommandPool(context.getDevice(), commandPool, pAllocator); 56e5c31af7Sopenharmony_ci} 57e5c31af7Sopenharmony_ci 58e5c31af7Sopenharmony_ciinline void release (Context& context, VkDescriptorPool descriptorPool, const VkAllocationCallbacks* pAllocator) 59e5c31af7Sopenharmony_ci{ 60e5c31af7Sopenharmony_ci context.getDeviceInterface().destroyDescriptorPool(context.getDevice(), descriptorPool, pAllocator); 61e5c31af7Sopenharmony_ci} 62e5c31af7Sopenharmony_ci#endif // CTS_USES_VULKANSC 63e5c31af7Sopenharmony_ci 64e5c31af7Sopenharmony_ciinline void release (Context& context, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks* pAllocator) 65e5c31af7Sopenharmony_ci{ 66e5c31af7Sopenharmony_ci context.getDeviceInterface().destroyDescriptorSetLayout(context.getDevice(), descriptorSetLayout, pAllocator); 67e5c31af7Sopenharmony_ci} 68e5c31af7Sopenharmony_ci 69e5c31af7Sopenharmony_ciinline void release (Context& context, VkDevice device, const VkAllocationCallbacks* pAllocator) 70e5c31af7Sopenharmony_ci{ 71e5c31af7Sopenharmony_ci context.getDeviceInterface().destroyDevice(device, pAllocator); 72e5c31af7Sopenharmony_ci} 73e5c31af7Sopenharmony_ci 74e5c31af7Sopenharmony_ciinline void release (Context& context, VkEvent event, const VkAllocationCallbacks* pAllocator) 75e5c31af7Sopenharmony_ci{ 76e5c31af7Sopenharmony_ci context.getDeviceInterface().destroyEvent(context.getDevice(), event, pAllocator); 77e5c31af7Sopenharmony_ci} 78e5c31af7Sopenharmony_ci 79e5c31af7Sopenharmony_ciinline void release (Context& context, VkFence fence, const VkAllocationCallbacks* pAllocator) 80e5c31af7Sopenharmony_ci{ 81e5c31af7Sopenharmony_ci context.getDeviceInterface().destroyFence(context.getDevice(), fence, pAllocator); 82e5c31af7Sopenharmony_ci} 83e5c31af7Sopenharmony_ci 84e5c31af7Sopenharmony_ciinline void release (Context& context, VkFramebuffer framebuffer, const VkAllocationCallbacks* pAllocator) 85e5c31af7Sopenharmony_ci{ 86e5c31af7Sopenharmony_ci context.getDeviceInterface().destroyFramebuffer(context.getDevice(), framebuffer, pAllocator); 87e5c31af7Sopenharmony_ci} 88e5c31af7Sopenharmony_ci 89e5c31af7Sopenharmony_ciinline void release (Context& context, VkImage image, const VkAllocationCallbacks* pAllocator) 90e5c31af7Sopenharmony_ci{ 91e5c31af7Sopenharmony_ci context.getDeviceInterface().destroyImage(context.getDevice(), image, pAllocator); 92e5c31af7Sopenharmony_ci} 93e5c31af7Sopenharmony_ci 94e5c31af7Sopenharmony_ciinline void release (Context& context, VkImageView imageView, const VkAllocationCallbacks* pAllocator) 95e5c31af7Sopenharmony_ci{ 96e5c31af7Sopenharmony_ci context.getDeviceInterface().destroyImageView(context.getDevice(), imageView, pAllocator); 97e5c31af7Sopenharmony_ci} 98e5c31af7Sopenharmony_ci 99e5c31af7Sopenharmony_ciinline void release (Context& context, VkInstance instance, const VkAllocationCallbacks* pAllocator) 100e5c31af7Sopenharmony_ci{ 101e5c31af7Sopenharmony_ci context.getInstanceInterface().destroyInstance(instance, pAllocator); 102e5c31af7Sopenharmony_ci} 103e5c31af7Sopenharmony_ci 104e5c31af7Sopenharmony_ciinline void release (Context& context, VkPipeline pipeline, const VkAllocationCallbacks* pAllocator) 105e5c31af7Sopenharmony_ci{ 106e5c31af7Sopenharmony_ci context.getDeviceInterface().destroyPipeline(context.getDevice(), pipeline, pAllocator); 107e5c31af7Sopenharmony_ci} 108e5c31af7Sopenharmony_ci 109e5c31af7Sopenharmony_ciinline void release (Context& context, VkPipelineCache pipelineCache, const VkAllocationCallbacks* pAllocator) 110e5c31af7Sopenharmony_ci{ 111e5c31af7Sopenharmony_ci context.getDeviceInterface().destroyPipelineCache(context.getDevice(), pipelineCache, pAllocator); 112e5c31af7Sopenharmony_ci} 113e5c31af7Sopenharmony_ci 114e5c31af7Sopenharmony_ciinline void release (Context& context, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks* pAllocator) 115e5c31af7Sopenharmony_ci{ 116e5c31af7Sopenharmony_ci context.getDeviceInterface().destroyPipelineLayout(context.getDevice(), pipelineLayout, pAllocator); 117e5c31af7Sopenharmony_ci} 118e5c31af7Sopenharmony_ci 119e5c31af7Sopenharmony_ci#ifndef CTS_USES_VULKANSC 120e5c31af7Sopenharmony_ciinline void release (Context& context, VkQueryPool queryPool, const VkAllocationCallbacks* pAllocator) 121e5c31af7Sopenharmony_ci{ 122e5c31af7Sopenharmony_ci context.getDeviceInterface().destroyQueryPool(context.getDevice(), queryPool, pAllocator); 123e5c31af7Sopenharmony_ci} 124e5c31af7Sopenharmony_ci#endif // CTS_USES_VULKANSC 125e5c31af7Sopenharmony_ci 126e5c31af7Sopenharmony_ciinline void release (Context& context, VkRenderPass renderPass, const VkAllocationCallbacks* pAllocator) 127e5c31af7Sopenharmony_ci{ 128e5c31af7Sopenharmony_ci context.getDeviceInterface().destroyRenderPass(context.getDevice(), renderPass, pAllocator); 129e5c31af7Sopenharmony_ci} 130e5c31af7Sopenharmony_ci 131e5c31af7Sopenharmony_ciinline void release (Context& context, VkSampler sampler, const VkAllocationCallbacks* pAllocator) 132e5c31af7Sopenharmony_ci{ 133e5c31af7Sopenharmony_ci context.getDeviceInterface().destroySampler(context.getDevice(), sampler, pAllocator); 134e5c31af7Sopenharmony_ci} 135e5c31af7Sopenharmony_ci 136e5c31af7Sopenharmony_ciinline void release (Context& context, VkSemaphore semaphore, const VkAllocationCallbacks* pAllocator) 137e5c31af7Sopenharmony_ci{ 138e5c31af7Sopenharmony_ci context.getDeviceInterface().destroySemaphore(context.getDevice(), semaphore, pAllocator); 139e5c31af7Sopenharmony_ci} 140e5c31af7Sopenharmony_ci 141e5c31af7Sopenharmony_ciinline void release (Context& context, VkShaderModule shaderModule, const VkAllocationCallbacks* pAllocator) 142e5c31af7Sopenharmony_ci{ 143e5c31af7Sopenharmony_ci#ifndef CTS_USES_VULKANSC 144e5c31af7Sopenharmony_ci context.getDeviceInterface().destroyShaderModule(context.getDevice(), shaderModule, pAllocator); 145e5c31af7Sopenharmony_ci#else 146e5c31af7Sopenharmony_ci DE_UNREF(context); 147e5c31af7Sopenharmony_ci DE_UNREF(shaderModule); 148e5c31af7Sopenharmony_ci DE_UNREF(pAllocator); 149e5c31af7Sopenharmony_ci#endif // CTS_USES_VULKANSC 150e5c31af7Sopenharmony_ci} 151e5c31af7Sopenharmony_ci 152e5c31af7Sopenharmony_ciinline void release (Context& context, VkDevice device, VkCommandPool cmdPool, deUint32 numCmdBuffers, const VkCommandBuffer* pCmdBuffers) 153e5c31af7Sopenharmony_ci{ 154e5c31af7Sopenharmony_ci DE_ASSERT(device != DE_NULL); 155e5c31af7Sopenharmony_ci DE_ASSERT(cmdPool != DE_NULL); 156e5c31af7Sopenharmony_ci DE_ASSERT(numCmdBuffers > 0u); 157e5c31af7Sopenharmony_ci context.getDeviceInterface().freeCommandBuffers(device, cmdPool, numCmdBuffers, pCmdBuffers); 158e5c31af7Sopenharmony_ci} 159e5c31af7Sopenharmony_ci 160e5c31af7Sopenharmony_ciinline void release (Context& context, VkDevice device, VkDescriptorPool descriptorPool, deUint32 numDescriptorSets, const VkDescriptorSet* pDescriptorSets) 161e5c31af7Sopenharmony_ci{ 162e5c31af7Sopenharmony_ci DE_ASSERT(device != DE_NULL); 163e5c31af7Sopenharmony_ci DE_ASSERT(descriptorPool != DE_NULL); 164e5c31af7Sopenharmony_ci DE_ASSERT(numDescriptorSets > 0u); 165e5c31af7Sopenharmony_ci context.getDeviceInterface().freeDescriptorSets(device, descriptorPool, numDescriptorSets, pDescriptorSets); 166e5c31af7Sopenharmony_ci} 167e5c31af7Sopenharmony_ci 168e5c31af7Sopenharmony_ci#ifndef CTS_USES_VULKANSC 169e5c31af7Sopenharmony_ciinline void release (Context& context, VkDeviceMemory memory, const VkAllocationCallbacks* pAllocator) 170e5c31af7Sopenharmony_ci{ 171e5c31af7Sopenharmony_ci context.getDeviceInterface().freeMemory(context.getDevice(), memory, pAllocator); 172e5c31af7Sopenharmony_ci} 173e5c31af7Sopenharmony_ci#endif // CTS_USES_VULKANSC 174e5c31af7Sopenharmony_ci 175e5c31af7Sopenharmony_citcu::TestStatus reportStatus (const bool success) 176e5c31af7Sopenharmony_ci{ 177e5c31af7Sopenharmony_ci if (success) 178e5c31af7Sopenharmony_ci return tcu::TestStatus::pass("OK: no observable change"); 179e5c31af7Sopenharmony_ci else 180e5c31af7Sopenharmony_ci return tcu::TestStatus::fail("Implementation allocated/freed the memory"); 181e5c31af7Sopenharmony_ci} 182e5c31af7Sopenharmony_ci 183e5c31af7Sopenharmony_citemplate<typename Object> 184e5c31af7Sopenharmony_citcu::TestStatus test (Context& context) 185e5c31af7Sopenharmony_ci{ 186e5c31af7Sopenharmony_ci const Object nullHandle = DE_NULL; 187e5c31af7Sopenharmony_ci const VkAllocationCallbacks* pNullAllocator = DE_NULL; 188e5c31af7Sopenharmony_ci 189e5c31af7Sopenharmony_ci#ifndef CTS_USES_VULKANSC 190e5c31af7Sopenharmony_ci AllocationCallbackRecorder recordingAllocator (getSystemAllocator(), 1u); 191e5c31af7Sopenharmony_ci#endif // CTS_USES_VULKANSC 192e5c31af7Sopenharmony_ci 193e5c31af7Sopenharmony_ci // Implementation should silently ignore a delete/free of a NULL handle. 194e5c31af7Sopenharmony_ci 195e5c31af7Sopenharmony_ci release(context, nullHandle, pNullAllocator); 196e5c31af7Sopenharmony_ci#ifndef CTS_USES_VULKANSC 197e5c31af7Sopenharmony_ci // In Vulkan SC VkAllocationCallbacks must be NULL 198e5c31af7Sopenharmony_ci release(context, nullHandle, recordingAllocator.getCallbacks()); 199e5c31af7Sopenharmony_ci return reportStatus(recordingAllocator.getNumRecords() == 0); 200e5c31af7Sopenharmony_ci#else 201e5c31af7Sopenharmony_ci return reportStatus(true); 202e5c31af7Sopenharmony_ci#endif // CTS_USES_VULKANSC 203e5c31af7Sopenharmony_ci} 204e5c31af7Sopenharmony_ci 205e5c31af7Sopenharmony_citemplate<> 206e5c31af7Sopenharmony_citcu::TestStatus test<VkCommandBuffer> (Context& context) 207e5c31af7Sopenharmony_ci{ 208e5c31af7Sopenharmony_ci const DeviceInterface& vk = context.getDeviceInterface(); 209e5c31af7Sopenharmony_ci const VkDevice device = context.getDevice(); 210e5c31af7Sopenharmony_ci const deUint32 queueFamilyIndex = context.getUniversalQueueFamilyIndex(); 211e5c31af7Sopenharmony_ci 212e5c31af7Sopenharmony_ci const VkCommandPoolCreateInfo cmdPoolCreateInfo = 213e5c31af7Sopenharmony_ci { 214e5c31af7Sopenharmony_ci VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType; 215e5c31af7Sopenharmony_ci DE_NULL, // const void* pNext; 216e5c31af7Sopenharmony_ci VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, // VkCommandPoolCreateFlags flags; 217e5c31af7Sopenharmony_ci queueFamilyIndex, // uint32_t queueFamilyIndex; 218e5c31af7Sopenharmony_ci }; 219e5c31af7Sopenharmony_ci 220e5c31af7Sopenharmony_ci const VkCommandBuffer pNullHandles[] = { DE_NULL, DE_NULL, DE_NULL }; 221e5c31af7Sopenharmony_ci const deUint32 numHandles = static_cast<deUint32>(DE_LENGTH_OF_ARRAY(pNullHandles)); 222e5c31af7Sopenharmony_ci 223e5c31af7Sopenharmony_ci // Default allocator 224e5c31af7Sopenharmony_ci { 225e5c31af7Sopenharmony_ci const Unique<VkCommandPool> cmdPool (createCommandPool(vk, device, &cmdPoolCreateInfo)); 226e5c31af7Sopenharmony_ci 227e5c31af7Sopenharmony_ci release(context, device, *cmdPool, numHandles, pNullHandles); 228e5c31af7Sopenharmony_ci } 229e5c31af7Sopenharmony_ci 230e5c31af7Sopenharmony_ci // Custom allocator 231e5c31af7Sopenharmony_ci#ifndef CTS_USES_VULKANSC 232e5c31af7Sopenharmony_ci { 233e5c31af7Sopenharmony_ci AllocationCallbackRecorder recordingAllocator (getSystemAllocator(), 1u); 234e5c31af7Sopenharmony_ci const Unique<VkCommandPool> cmdPool (createCommandPool(vk, device, &cmdPoolCreateInfo, recordingAllocator.getCallbacks())); 235e5c31af7Sopenharmony_ci const std::size_t numInitialRecords = recordingAllocator.getNumRecords(); 236e5c31af7Sopenharmony_ci 237e5c31af7Sopenharmony_ci release(context, device, *cmdPool, numHandles, pNullHandles); 238e5c31af7Sopenharmony_ci 239e5c31af7Sopenharmony_ci return reportStatus(numInitialRecords == recordingAllocator.getNumRecords()); 240e5c31af7Sopenharmony_ci } 241e5c31af7Sopenharmony_ci#else 242e5c31af7Sopenharmony_ci return reportStatus(true); 243e5c31af7Sopenharmony_ci#endif // CTS_USES_VULKANSC 244e5c31af7Sopenharmony_ci} 245e5c31af7Sopenharmony_ci 246e5c31af7Sopenharmony_civoid checkSupportFreeDescriptorSets (Context& context) 247e5c31af7Sopenharmony_ci{ 248e5c31af7Sopenharmony_ci#ifdef CTS_USES_VULKANSC 249e5c31af7Sopenharmony_ci if(context.getDeviceVulkanSC10Properties().recycleDescriptorSetMemory == VK_FALSE ) 250e5c31af7Sopenharmony_ci TCU_THROW(NotSupportedError, "vkFreeDescriptorSets not supported"); 251e5c31af7Sopenharmony_ci#else 252e5c31af7Sopenharmony_ci DE_UNREF(context); 253e5c31af7Sopenharmony_ci#endif // CTS_USES_VULKANSC 254e5c31af7Sopenharmony_ci} 255e5c31af7Sopenharmony_ci 256e5c31af7Sopenharmony_citemplate<> 257e5c31af7Sopenharmony_citcu::TestStatus test<VkDescriptorSet> (Context& context) 258e5c31af7Sopenharmony_ci{ 259e5c31af7Sopenharmony_ci const DeviceInterface& vk = context.getDeviceInterface(); 260e5c31af7Sopenharmony_ci const VkDevice device = context.getDevice(); 261e5c31af7Sopenharmony_ci 262e5c31af7Sopenharmony_ci const VkDescriptorPoolSize pPoolSizes[] = 263e5c31af7Sopenharmony_ci { 264e5c31af7Sopenharmony_ci // type, descriptorCount 265e5c31af7Sopenharmony_ci { VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 2u }, // arbitrary values 266e5c31af7Sopenharmony_ci { VK_DESCRIPTOR_TYPE_SAMPLER, 1u }, 267e5c31af7Sopenharmony_ci { VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, 3u }, 268e5c31af7Sopenharmony_ci }; 269e5c31af7Sopenharmony_ci const VkDescriptorPoolCreateInfo descriptorPoolCreateInfo = 270e5c31af7Sopenharmony_ci { 271e5c31af7Sopenharmony_ci VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO, // VkStructureType sType; 272e5c31af7Sopenharmony_ci DE_NULL, // const void* pNext; 273e5c31af7Sopenharmony_ci VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT, // VkDescriptorPoolCreateFlags flags; 274e5c31af7Sopenharmony_ci 2u, // uint32_t maxSets; 275e5c31af7Sopenharmony_ci static_cast<deUint32>(DE_LENGTH_OF_ARRAY(pPoolSizes)), // uint32_t poolSizeCount; 276e5c31af7Sopenharmony_ci pPoolSizes, // const VkDescriptorPoolSize* pPoolSizes; 277e5c31af7Sopenharmony_ci }; 278e5c31af7Sopenharmony_ci 279e5c31af7Sopenharmony_ci const VkDescriptorSet pNullHandles[] = { DE_NULL, DE_NULL, DE_NULL }; 280e5c31af7Sopenharmony_ci const deUint32 numHandles = static_cast<deUint32>(DE_LENGTH_OF_ARRAY(pNullHandles)); 281e5c31af7Sopenharmony_ci 282e5c31af7Sopenharmony_ci // Default allocator 283e5c31af7Sopenharmony_ci { 284e5c31af7Sopenharmony_ci const Unique<VkDescriptorPool> descriptorPool (createDescriptorPool(vk, device, &descriptorPoolCreateInfo)); 285e5c31af7Sopenharmony_ci 286e5c31af7Sopenharmony_ci release(context, device, *descriptorPool, numHandles, pNullHandles); 287e5c31af7Sopenharmony_ci } 288e5c31af7Sopenharmony_ci 289e5c31af7Sopenharmony_ci // Custom allocator 290e5c31af7Sopenharmony_ci#ifndef CTS_USES_VULKANSC 291e5c31af7Sopenharmony_ci { 292e5c31af7Sopenharmony_ci AllocationCallbackRecorder recordingAllocator (getSystemAllocator(), 1u); 293e5c31af7Sopenharmony_ci const Unique<VkDescriptorPool> descriptorPool (createDescriptorPool(vk, device, &descriptorPoolCreateInfo, recordingAllocator.getCallbacks())); 294e5c31af7Sopenharmony_ci const std::size_t numInitialRecords = recordingAllocator.getNumRecords(); 295e5c31af7Sopenharmony_ci 296e5c31af7Sopenharmony_ci release(context, device, *descriptorPool, numHandles, pNullHandles); 297e5c31af7Sopenharmony_ci 298e5c31af7Sopenharmony_ci return reportStatus(numInitialRecords == recordingAllocator.getNumRecords()); 299e5c31af7Sopenharmony_ci } 300e5c31af7Sopenharmony_ci#else 301e5c31af7Sopenharmony_ci return reportStatus(true); 302e5c31af7Sopenharmony_ci#endif // CTS_USES_VULKANSC 303e5c31af7Sopenharmony_ci} 304e5c31af7Sopenharmony_ci 305e5c31af7Sopenharmony_civoid checkEventSupport (Context& context) 306e5c31af7Sopenharmony_ci{ 307e5c31af7Sopenharmony_ci#ifndef CTS_USES_VULKANSC 308e5c31af7Sopenharmony_ci if (context.isDeviceFunctionalitySupported("VK_KHR_portability_subset") && !context.getPortabilitySubsetFeatures().events) 309e5c31af7Sopenharmony_ci TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Events are not supported by this implementation"); 310e5c31af7Sopenharmony_ci#else 311e5c31af7Sopenharmony_ci DE_UNREF(context); 312e5c31af7Sopenharmony_ci#endif // CTS_USES_VULKANSC 313e5c31af7Sopenharmony_ci} 314e5c31af7Sopenharmony_ci 315e5c31af7Sopenharmony_civoid addTestsToGroup (tcu::TestCaseGroup* group) 316e5c31af7Sopenharmony_ci{ 317e5c31af7Sopenharmony_ci addFunctionCase(group, "destroy_buffer", test<VkBuffer>); 318e5c31af7Sopenharmony_ci addFunctionCase(group, "destroy_buffer_view", test<VkBufferView>); 319e5c31af7Sopenharmony_ci#ifndef CTS_USES_VULKANSC 320e5c31af7Sopenharmony_ci // Removed from Vulkan SC test set: vkDestroyCommandPool and vkDestroyDescriptorPool command do not exist in Vulkan SC 321e5c31af7Sopenharmony_ci addFunctionCase(group, "destroy_command_pool", test<VkCommandPool>); 322e5c31af7Sopenharmony_ci addFunctionCase(group, "destroy_descriptor_pool", test<VkDescriptorPool>); 323e5c31af7Sopenharmony_ci#endif // CTS_USES_VULKANSC 324e5c31af7Sopenharmony_ci addFunctionCase(group, "destroy_descriptor_set_layout", test<VkDescriptorSetLayout>); 325e5c31af7Sopenharmony_ci addFunctionCase(group, "destroy_device", test<VkDevice>); 326e5c31af7Sopenharmony_ci addFunctionCase(group, "destroy_event", checkEventSupport, test<VkEvent>); 327e5c31af7Sopenharmony_ci addFunctionCase(group, "destroy_fence", test<VkFence>); 328e5c31af7Sopenharmony_ci addFunctionCase(group, "destroy_framebuffer", test<VkFramebuffer>); 329e5c31af7Sopenharmony_ci addFunctionCase(group, "destroy_image", test<VkImage>); 330e5c31af7Sopenharmony_ci addFunctionCase(group, "destroy_image_view", test<VkImageView>); 331e5c31af7Sopenharmony_ci addFunctionCase(group, "destroy_instance", test<VkInstance>); 332e5c31af7Sopenharmony_ci addFunctionCase(group, "destroy_pipeline", test<VkPipeline>); 333e5c31af7Sopenharmony_ci addFunctionCase(group, "destroy_pipeline_cache", test<VkPipelineCache>); 334e5c31af7Sopenharmony_ci addFunctionCase(group, "destroy_pipeline_layout", test<VkPipelineLayout>); 335e5c31af7Sopenharmony_ci#ifndef CTS_USES_VULKANSC 336e5c31af7Sopenharmony_ci // Removed from Vulkan SC test set: vkDestroyQueryPool command does not exist in Vulkan SC 337e5c31af7Sopenharmony_ci addFunctionCase(group, "destroy_query_pool", test<VkQueryPool>); 338e5c31af7Sopenharmony_ci#endif // CTS_USES_VULKANSC 339e5c31af7Sopenharmony_ci addFunctionCase(group, "destroy_render_pass", test<VkRenderPass>); 340e5c31af7Sopenharmony_ci addFunctionCase(group, "destroy_sampler", test<VkSampler>); 341e5c31af7Sopenharmony_ci addFunctionCase(group, "destroy_semaphore", test<VkSemaphore>); 342e5c31af7Sopenharmony_ci addFunctionCase(group, "destroy_shader_module", test<VkShaderModule>); 343e5c31af7Sopenharmony_ci addFunctionCase(group, "free_command_buffers", test<VkCommandBuffer>); 344e5c31af7Sopenharmony_ci addFunctionCase(group, "free_descriptor_sets", checkSupportFreeDescriptorSets, test<VkDescriptorSet>); 345e5c31af7Sopenharmony_ci#ifndef CTS_USES_VULKANSC 346e5c31af7Sopenharmony_ci // Removed from Vulkan SC test set: vkFreeMemory command does not exist in Vulkan SC 347e5c31af7Sopenharmony_ci addFunctionCase(group, "free_memory", test<VkDeviceMemory>); 348e5c31af7Sopenharmony_ci#endif // CTS_USES_VULKANSC 349e5c31af7Sopenharmony_ci} 350e5c31af7Sopenharmony_ci 351e5c31af7Sopenharmony_ci} // anonymous 352e5c31af7Sopenharmony_ci 353e5c31af7Sopenharmony_citcu::TestCaseGroup* createNullHandleTests (tcu::TestContext& testCtx) 354e5c31af7Sopenharmony_ci{ 355e5c31af7Sopenharmony_ci // Destroying/freeing a VK_NULL_HANDLE should be silently ignored 356e5c31af7Sopenharmony_ci return createTestGroup(testCtx, "null_handle", addTestsToGroup); 357e5c31af7Sopenharmony_ci} 358e5c31af7Sopenharmony_ci 359e5c31af7Sopenharmony_ci} // api 360e5c31af7Sopenharmony_ci} // vkt 361