diff options
27 files changed, 264 insertions, 266 deletions
diff --git a/android/cts/master/src/vk-master-2019-03-01.txt b/android/cts/master/src/vk-master-2019-03-01.txt index dc73e8109..0ea20e0e5 100644 --- a/android/cts/master/src/vk-master-2019-03-01.txt +++ b/android/cts/master/src/vk-master-2019-03-01.txt @@ -3713,7 +3713,6 @@ dEQP-VK.api.device_init.create_device_various_queue_counts dEQP-VK.api.device_init.create_device_features2 dEQP-VK.api.device_init.create_device_unsupported_features dEQP-VK.api.device_init.create_device_queue2 -dEQP-VK.api.device_init.create_device_queue2_unmatched_flags dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail dEQP-VK.api.object_management.single.instance dEQP-VK.api.object_management.single.device diff --git a/android/cts/master/vk-master-2019-03-01/api.txt b/android/cts/master/vk-master-2019-03-01/api.txt index e321ff508..2bbb089b0 100644 --- a/android/cts/master/vk-master-2019-03-01/api.txt +++ b/android/cts/master/vk-master-2019-03-01/api.txt @@ -3697,7 +3697,6 @@ dEQP-VK.api.device_init.create_device_various_queue_counts dEQP-VK.api.device_init.create_device_features2 dEQP-VK.api.device_init.create_device_unsupported_features dEQP-VK.api.device_init.create_device_queue2 -dEQP-VK.api.device_init.create_device_queue2_unmatched_flags dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail dEQP-VK.api.object_management.single.instance dEQP-VK.api.object_management.single.device diff --git a/android/cts/master/vk-master/api.txt b/android/cts/master/vk-master/api.txt index dbf892b9b..4ab9f3be8 100644 --- a/android/cts/master/vk-master/api.txt +++ b/android/cts/master/vk-master/api.txt @@ -3755,7 +3755,6 @@ dEQP-VK.api.device_init.create_device_global_priority_query dEQP-VK.api.device_init.create_device_features2 dEQP-VK.api.device_init.create_device_unsupported_features dEQP-VK.api.device_init.create_device_queue2 -dEQP-VK.api.device_init.create_device_queue2_unmatched_flags dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail dEQP-VK.api.object_management.single.instance dEQP-VK.api.object_management.single.device diff --git a/external/vulkancts/modules/vulkan/api/vktApiBufferMarkerTests.cpp b/external/vulkancts/modules/vulkan/api/vktApiBufferMarkerTests.cpp index f502902ba..0a0b08055 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiBufferMarkerTests.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiBufferMarkerTests.cpp @@ -324,7 +324,7 @@ tcu::TestStatus bufferMarkerSequential(Context& context, BaseTestParams params) VK_ACCESS_HOST_READ_BIT, }; - vk.cmdPipelineBarrier(*cmdBuffer, params.stage, VK_PIPELINE_STAGE_HOST_BIT, 0, 1, &memoryDep, 0, DE_NULL, 0, DE_NULL); + vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_HOST_BIT, 0, 1, &memoryDep, 0, DE_NULL, 0, DE_NULL); VK_CHECK(vk.endCommandBuffer(*cmdBuffer)); @@ -488,7 +488,7 @@ tcu::TestStatus bufferMarkerMemoryDep(Context& context, MemoryDepParams params) DescriptorPoolBuilder descriptorPoolBuilder; descriptorPoolBuilder.addType(VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1u); - descriptorPool = descriptorPoolBuilder.build(vk, device, 0, 1u); + descriptorPool = descriptorPoolBuilder.build(vk, device, VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT, 1u); DescriptorSetLayoutBuilder setLayoutBuilder; @@ -891,7 +891,7 @@ tcu::TestStatus bufferMarkerMemoryDep(Context& context, MemoryDepParams params) { vk.cmdWriteBufferMarkerAMD(*cmdBuffer, params.base.stage, *markerBuffer, sizeof(deUint32) * slot, value); - writeStages |= params.base.stage; + writeStages |= VK_PIPELINE_STAGE_TRANSFER_BIT; writeAccess |= VK_ACCESS_TRANSFER_WRITE_BIT; } else diff --git a/external/vulkancts/modules/vulkan/api/vktApiCommandBuffersTests.cpp b/external/vulkancts/modules/vulkan/api/vktApiCommandBuffersTests.cpp index d01f2882a..067cc697a 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiCommandBuffersTests.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiCommandBuffersTests.cpp @@ -3413,11 +3413,8 @@ tcu::TestStatus executeSecondaryBufferTwiceTest(Context& context) // record secondary command buffer VK_CHECK(vk.beginCommandBuffer(cmdBuffers[ndx], &secCmdBufBeginInfo)); { - // allow execution of event during every stage of pipeline - VkPipelineStageFlags stageMask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT; - // wait for event - vk.cmdWaitEvents(cmdBuffers[ndx], 1, &eventOne.get(), stageMask, stageMask, 0, DE_NULL, 0u, DE_NULL, 0u, DE_NULL); + vk.cmdWaitEvents(cmdBuffers[ndx], 1, &eventOne.get(), VK_PIPELINE_STAGE_HOST_BIT, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, 0, DE_NULL, 0u, DE_NULL, 0u, DE_NULL); } // end recording of secondary buffers endCommandBuffer(vk, cmdBuffers[ndx]); diff --git a/external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp b/external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp index 684adb61f..9e7e47a75 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp @@ -1609,7 +1609,7 @@ tcu::TestStatus CopyImageToImageMipmap::iterate (void) } } - const VkImageMemoryBarrier imageBarriers[] = + VkImageMemoryBarrier imageBarriers[] = { // source image { diff --git a/external/vulkancts/modules/vulkan/api/vktApiDeviceInitializationTests.cpp b/external/vulkancts/modules/vulkan/api/vktApiDeviceInitializationTests.cpp index 8a62550b5..5a926e66e 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiDeviceInitializationTests.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiDeviceInitializationTests.cpp @@ -1604,102 +1604,6 @@ tcu::TestStatus createDeviceQueue2Test (Context& context) return tcu::TestStatus::pass("Pass"); } -tcu::TestStatus createDeviceQueue2UnmatchedFlagsTest (Context& context) -{ - if (!context.contextSupports(vk::ApiVersion(1, 1, 0))) - TCU_THROW(NotSupportedError, "Vulkan 1.1 is not supported"); - - const PlatformInterface& platformInterface = context.getPlatformInterface(); - const VkInstance instance = context.getInstance(); - const InstanceInterface& instanceDriver = context.getInstanceInterface(); - const VkPhysicalDevice physicalDevice = context.getPhysicalDevice(); - - // Check if VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT flag can be used. - { - VkPhysicalDeviceProtectedMemoryFeatures protectedFeatures; - protectedFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES; - protectedFeatures.pNext = DE_NULL; - - VkPhysicalDeviceFeatures2 deviceFeatures; - deviceFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2; - deviceFeatures.pNext = &protectedFeatures; - - instanceDriver.getPhysicalDeviceFeatures2(physicalDevice, &deviceFeatures); - if (!protectedFeatures.protectedMemory) - { - TCU_THROW(NotSupportedError, "protectedMemory feature is not supported, no queue creation flags available"); - } - } - - const deUint32 queueFamilyIndex = context.getUniversalQueueFamilyIndex(); - const deUint32 queueCount = 1; - const deUint32 queueIndex = 0; - const float queuePriority = 1.0f; - const VkDeviceQueueCreateInfo deviceQueueCreateInfo = - { - VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO, // VkStructureType sType; - DE_NULL, // const void* pNext; - (VkDeviceQueueCreateFlags)0u, // VkDeviceQueueCreateFlags flags; - queueFamilyIndex, // deUint32 queueFamilyIndex; - queueCount, // deUint32 queueCount; - &queuePriority, // const float* pQueuePriorities; - }; - VkPhysicalDeviceProtectedMemoryFeatures protectedFeatures = - { - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES, // VkStructureType sType; - DE_NULL, // void* pNext; - VK_TRUE // VkBool32 protectedMemory; - }; - - VkPhysicalDeviceFeatures emptyDeviceFeatures; - deMemset(&emptyDeviceFeatures, 0, sizeof(emptyDeviceFeatures)); - - const VkPhysicalDeviceFeatures2 deviceFeatures = - { - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2, // VkStructureType sType; - &protectedFeatures, // void* pNext; - emptyDeviceFeatures // VkPhysicalDeviceFeatures features; - }; - - const VkDeviceCreateInfo deviceCreateInfo = - { - VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO, // VkStructureType sType; - &deviceFeatures, // const void* pNext; - (VkDeviceCreateFlags)0u, // VkDeviceCreateFlags flags; - 1, // deUint32 queueCreateInfoCount; - &deviceQueueCreateInfo, // const VkDeviceQueueCreateInfo* pQueueCreateInfos; - 0, // deUint32 enabledLayerCount; - DE_NULL, // const char* const* ppEnabledLayerNames; - 0, // deUint32 enabledExtensionCount; - DE_NULL, // const char* const* ppEnabledExtensionNames; - DE_NULL, // const VkPhysicalDeviceFeatures* pEnabledFeatures; - }; - - const VkDeviceQueueInfo2 deviceQueueInfo2 = - { - VK_STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2, // VkStructureType sType; - DE_NULL, // const void* pNext; - VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT, // VkDeviceQueueCreateFlags flags; - queueFamilyIndex, // deUint32 queueFamilyIndex; - queueIndex, // deUint32 queueIndex; - }; - - { - const Unique<VkDevice> device (createCustomDevice(context.getTestContext().getCommandLine().isValidationEnabled(), platformInterface, instance, instanceDriver, physicalDevice, &deviceCreateInfo)); - const DeviceDriver deviceDriver (platformInterface, instance, device.get()); - const VkQueue queue2 = getDeviceQueue2(deviceDriver, *device, &deviceQueueInfo2); - - if (queue2 != DE_NULL) - return tcu::TestStatus::fail("Fail, getDeviceQueue2 should return VK_NULL_HANDLE when flags in VkDeviceQueueCreateInfo and VkDeviceQueueInfo2 are different."); - - const VkQueue queue = getDeviceQueue(deviceDriver, *device, queueFamilyIndex, queueIndex); - - VK_CHECK(deviceDriver.queueWaitIdle(queue)); - } - - return tcu::TestStatus::pass("Pass"); -} - // Allocation tracking utilities struct AllocTrack { @@ -2080,7 +1984,6 @@ tcu::TestCaseGroup* createDeviceInitializationTests (tcu::TestContext& testCtx) addFunctionCase(deviceInitializationTests.get(), "create_device_features2", "", createDeviceFeatures2Test); addFunctionCase(deviceInitializationTests.get(), "create_device_unsupported_features", "", createDeviceWithUnsupportedFeaturesTest); addFunctionCase(deviceInitializationTests.get(), "create_device_queue2", "", createDeviceQueue2Test); - addFunctionCase(deviceInitializationTests.get(), "create_device_queue2_unmatched_flags", "", createDeviceQueue2UnmatchedFlagsTest); addFunctionCase(deviceInitializationTests.get(), "create_instance_device_intentional_alloc_fail", "", createInstanceDeviceIntentionalAllocFail); return deviceInitializationTests.release(); diff --git a/external/vulkancts/modules/vulkan/api/vktApiExternalMemoryTests.cpp b/external/vulkancts/modules/vulkan/api/vktApiExternalMemoryTests.cpp index 05bd78b61..ee770bf28 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiExternalMemoryTests.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiExternalMemoryTests.cpp @@ -609,7 +609,7 @@ void submitEmptySignalAndGetSemaphoreNative ( const vk::DeviceInterface& vk is already signalled, instead of a file descriptor, . In order to make sure that a valid file descriptor is returned we use vkCmdWaitEvents to make sure that vkQueueSubmit doesn't signal the fence. */ - vk.cmdWaitEvents(*cmdBuffer, 1, &event.get(), vk::VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, 0, DE_NULL, 0, DE_NULL, 0, DE_NULL); + vk.cmdWaitEvents(*cmdBuffer, 1, &event.get(), vk::VK_PIPELINE_STAGE_HOST_BIT, vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, 0, DE_NULL, 0, DE_NULL, 0, DE_NULL); vk.endCommandBuffer(*cmdBuffer); const vk::VkSubmitInfo submit = @@ -722,7 +722,7 @@ void submitEmptySignalAndGetFenceNative ( const vk::DeviceInterface& vk, file descriptor, if the fence is already signalled. In order to make sure that a valid file descriptor is returned we use vkCmdWaitEvents to make sure that vkQueueSubmit doesn't signal the fence. */ - vk.cmdWaitEvents(*cmdBuffer, 1, &event.get(), vk::VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, 0, DE_NULL, 0, DE_NULL, 0, DE_NULL); + vk.cmdWaitEvents(*cmdBuffer, 1, &event.get(), vk::VK_PIPELINE_STAGE_HOST_BIT, vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, 0, DE_NULL, 0, DE_NULL, 0, DE_NULL); vk.endCommandBuffer(*cmdBuffer); const vk::VkSubmitInfo submit = diff --git a/external/vulkancts/modules/vulkan/api/vktApiPipelineTests.cpp b/external/vulkancts/modules/vulkan/api/vktApiPipelineTests.cpp index bf53517fb..adf307cc0 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiPipelineTests.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiPipelineTests.cpp @@ -646,7 +646,7 @@ tcu::TestStatus framebufferCompatibleRenderPassTest (Context& context) const Unique<VkFramebuffer> frameBuffer (createFramebuffer(vk, device, &framebufferCreateInfo)); const Unique<VkRenderPass> renderPassB (createSimpleRenderPass(vk, device, format, - VK_ATTACHMENT_LOAD_OP_LOAD, + VK_ATTACHMENT_LOAD_OP_DONT_CARE, VK_ATTACHMENT_LOAD_OP_LOAD, VK_ATTACHMENT_STORE_OP_STORE, VK_IMAGE_LAYOUT_GENERAL)); diff --git a/external/vulkancts/modules/vulkan/conditional_rendering/vktConditionalDrawTests.cpp b/external/vulkancts/modules/vulkan/conditional_rendering/vktConditionalDrawTests.cpp index c0c75c3f2..a0977ad4b 100644 --- a/external/vulkancts/modules/vulkan/conditional_rendering/vktConditionalDrawTests.cpp +++ b/external/vulkancts/modules/vulkan/conditional_rendering/vktConditionalDrawTests.cpp @@ -110,6 +110,12 @@ protected: de::SharedPtr<Draw::Buffer> m_indirectCountBuffer; }; +void checkSupport(Context& context, DrawCommandType command) +{ + if (command == DRAW_COMMAND_TYPE_DRAW_INDIRECT_COUNT || command == DRAW_COMMAND_TYPE_DRAW_INDEXED_INDIRECT_COUNT) + context.requireDeviceFunctionality("VK_KHR_draw_indirect_count"); +} + ConditionalDraw::ConditionalDraw (Context &context, ConditionalTestSpec testSpec) : Draw::DrawTestsBaseClass(context, testSpec.shaders[glu::SHADERTYPE_VERTEX], testSpec.shaders[glu::SHADERTYPE_FRAGMENT], false, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST) , m_command(testSpec.command) @@ -117,6 +123,7 @@ ConditionalDraw::ConditionalDraw (Context &context, ConditionalTestSpec testSpec , m_conditionalData(testSpec.conditionalData) { checkConditionalRenderingCapabilities(context, m_conditionalData); + checkSupport(context, m_command); const float minX = -0.3f; const float maxX = 0.3f; diff --git a/external/vulkancts/modules/vulkan/device_group/vktDeviceGroupRendering.cpp b/external/vulkancts/modules/vulkan/device_group/vktDeviceGroupRendering.cpp index 3f0940a5b..c52ae2201 100644 --- a/external/vulkancts/modules/vulkan/device_group/vktDeviceGroupRendering.cpp +++ b/external/vulkancts/modules/vulkan/device_group/vktDeviceGroupRendering.cpp @@ -402,7 +402,8 @@ tcu::TestStatus DeviceGroupTestInstance::iterate (void) vk::Move<vk::VkDeviceMemory> indexBufferMemory; vk::Move<vk::VkDeviceMemory> uniformBufferMemory; vk::Move<vk::VkDeviceMemory> sboBufferMemory; - vk::Move<vk::VkDeviceMemory> imageMemory; + vk::Move<vk::VkDeviceMemory> renderImageMemory; + vk::Move<vk::VkDeviceMemory> readImageMemory; Move<VkRenderPass> renderPass; Move<VkImage> renderImage; @@ -791,11 +792,19 @@ tcu::TestStatus DeviceGroupTestInstance::iterate (void) memoryTypeNdx = getMemoryIndex(memReqs.memoryTypeBits, m_useHostMemory ? 0 : VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); allocInfo.allocationSize = memReqs.size; allocInfo.memoryTypeIndex = memoryTypeNdx; - imageMemory = allocateMemory(vk, *m_deviceGroup, &allocInfo); + renderImageMemory = allocateMemory(vk, *m_deviceGroup, &allocInfo); + + dedicatedAllocInfo.image = *readImage; + dedicatedAllocInfo.buffer = DE_NULL; + memReqs = getImageMemoryRequirements(vk, *m_deviceGroup, readImage.get()); + memoryTypeNdx = getMemoryIndex(memReqs.memoryTypeBits, m_useHostMemory ? 0 : VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); + allocInfo.allocationSize = memReqs.size; + allocInfo.memoryTypeIndex = memoryTypeNdx; + readImageMemory = allocateMemory(vk, *m_deviceGroup, &allocInfo); } - VK_CHECK(vk.bindImageMemory(*m_deviceGroup, *renderImage, imageMemory.get(), 0)); - VK_CHECK(vk.bindImageMemory(*m_deviceGroup, *readImage, imageMemory.get(), 0)); + VK_CHECK(vk.bindImageMemory(*m_deviceGroup, *renderImage, renderImageMemory.get(), 0)); + VK_CHECK(vk.bindImageMemory(*m_deviceGroup, *readImage, readImageMemory.get(), 0)); // Create renderpass { @@ -1186,7 +1195,7 @@ tcu::TestStatus DeviceGroupTestInstance::iterate (void) VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO, // sType &devGroupBindInfo, // pNext *renderImage, // image - imageMemory.get(), // memory + renderImageMemory.get(), // memory 0u, // memoryOffset }; VK_CHECK(vk.bindImageMemory2(*m_deviceGroup, 1, &bindInfo)); @@ -1475,7 +1484,7 @@ tcu::TestStatus DeviceGroupTestInstance::iterate (void) VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO, // sType &devGroupBindInfo, // pNext peerImage.get(), // image - imageMemory.get(), // memory + renderImageMemory.get(), // memory 0u, // memoryOffset }; VK_CHECK(vk.bindImageMemory2(*m_deviceGroup, 1, &bindInfo)); diff --git a/external/vulkancts/modules/vulkan/image/vktImageLoadStoreTests.cpp b/external/vulkancts/modules/vulkan/image/vktImageLoadStoreTests.cpp index 627814de8..246d28fd5 100644 --- a/external/vulkancts/modules/vulkan/image/vktImageLoadStoreTests.cpp +++ b/external/vulkancts/modules/vulkan/image/vktImageLoadStoreTests.cpp @@ -486,6 +486,9 @@ void StoreTest::checkSupport (Context& context) const { const VkFormatProperties3 formatProperties (context.getFormatProperties(m_format)); + if (!m_declareImageFormatInShader && !(formatProperties.bufferFeatures & VK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT_KHR)) + TCU_THROW(NotSupportedError, "Format not supported for unformatted stores via storage buffer"); + if (!m_declareImageFormatInShader && !(formatProperties.optimalTilingFeatures & VK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT_KHR)) TCU_THROW(NotSupportedError, "Format not supported for unformatted stores via storage images"); diff --git a/external/vulkancts/modules/vulkan/imageless_framebuffer/vktImagelessFramebufferTests.cpp b/external/vulkancts/modules/vulkan/imageless_framebuffer/vktImagelessFramebufferTests.cpp index 3f27064bf..33cfe4726 100644 --- a/external/vulkancts/modules/vulkan/imageless_framebuffer/vktImagelessFramebufferTests.cpp +++ b/external/vulkancts/modules/vulkan/imageless_framebuffer/vktImagelessFramebufferTests.cpp @@ -276,7 +276,7 @@ Move<VkRenderPass> makeRenderPass (const DeviceInterface& vk, (VkAttachmentDescriptionFlags)0, // VkAttachmentDescriptionFlags flags; colorFormat, // VkFormat format; VK_SAMPLE_COUNT_1_BIT, // VkSampleCountFlagBits samples; - VK_ATTACHMENT_LOAD_OP_LOAD, // VkAttachmentLoadOp loadOp; + VK_ATTACHMENT_LOAD_OP_DONT_CARE, // VkAttachmentLoadOp loadOp; VK_ATTACHMENT_STORE_OP_STORE, // VkAttachmentStoreOp storeOp; VK_ATTACHMENT_LOAD_OP_DONT_CARE, // VkAttachmentLoadOp stencilLoadOp; VK_ATTACHMENT_STORE_OP_DONT_CARE, // VkAttachmentStoreOp stencilStoreOp; @@ -434,7 +434,7 @@ Move<VkRenderPass> makeRenderPass (const DeviceInterface& vk, (VkAttachmentDescriptionFlags)0, // VkAttachmentDescriptionFlags flags; colorFormat, // VkFormat format; VK_SAMPLE_COUNT_1_BIT, // VkSampleCountFlagBits samples; - VK_ATTACHMENT_LOAD_OP_LOAD, // VkAttachmentLoadOp loadOp; + VK_ATTACHMENT_LOAD_OP_DONT_CARE, // VkAttachmentLoadOp loadOp; VK_ATTACHMENT_STORE_OP_STORE, // VkAttachmentStoreOp storeOp; VK_ATTACHMENT_LOAD_OP_DONT_CARE, // VkAttachmentLoadOp stencilLoadOp; VK_ATTACHMENT_STORE_OP_DONT_CARE, // VkAttachmentStoreOp stencilStoreOp; @@ -956,7 +956,7 @@ ColorImagelessTestInstance::ColorImagelessTestInstance (Context& context, const , m_extensions (context.requireDeviceFunctionality("VK_KHR_imageless_framebuffer")) , m_imageExtent2D (makeExtent2D(32u, 32u)) , m_parameters (parameters) - , m_colorImageUsage (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT) + , m_colorImageUsage (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT) { const InstanceInterface& vki = m_context.getInstanceInterface(); const VkPhysicalDevice physDevice = m_context.getPhysicalDevice(); diff --git a/external/vulkancts/modules/vulkan/memory/vktMemoryAllocationTests.cpp b/external/vulkancts/modules/vulkan/memory/vktMemoryAllocationTests.cpp index d1381e759..e98b17358 100644 --- a/external/vulkancts/modules/vulkan/memory/vktMemoryAllocationTests.cpp +++ b/external/vulkancts/modules/vulkan/memory/vktMemoryAllocationTests.cpp @@ -120,12 +120,13 @@ T roundUpToNextMultiple (T value, T multiple) class BaseAllocateTestInstance : public TestInstance { public: - BaseAllocateTestInstance (Context& context, bool useDeviceGroups) - : TestInstance (context) - , m_useDeviceGroups (useDeviceGroups) - , m_subsetAllocationAllowed (false) - , m_numPhysDevices (1) - , m_memoryProperties (getPhysicalDeviceMemoryProperties(context.getInstanceInterface(), context.getPhysicalDevice())) + BaseAllocateTestInstance (Context& context, bool useDeviceGroups) + : TestInstance (context) + , m_useDeviceGroups (useDeviceGroups) + , m_subsetAllocationAllowed (false) + , m_numPhysDevices (1) + , m_memoryProperties (getPhysicalDeviceMemoryProperties(context.getInstanceInterface(), context.getPhysicalDevice())) + , m_deviceCoherentMemSupported (false) { if (m_useDeviceGroups) createDeviceGroup(); @@ -149,6 +150,7 @@ protected: VkMemoryAllocateFlagsInfo m_allocFlagsInfo; deUint32 m_numPhysDevices; VkPhysicalDeviceMemoryProperties m_memoryProperties; + bool m_deviceCoherentMemSupported; private: CustomInstance m_deviceGroupInstance; @@ -164,7 +166,8 @@ void BaseAllocateTestInstance::createTestDevice (void) const float queuePriority = 1.0f; deUint32 queueFamilyIndex = 0; bool protMemSupported = false; - bool deviceCoherentMemSupported = false; + + void* pNext = DE_NULL; VkPhysicalDeviceProtectedMemoryFeatures protectedMemoryFeature = { @@ -172,14 +175,15 @@ void BaseAllocateTestInstance::createTestDevice (void) DE_NULL, // const void* pNext VK_FALSE // VkBool32 protectedMemory; }; + pNext = &protectedMemoryFeature; VkPhysicalDeviceCoherentMemoryFeaturesAMD coherentMemoryFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD, // VkStructureType sType - &protectedMemoryFeature, // const void* pNext + pNext, // const void* pNext VK_FALSE // VkBool32 deviceCoherentMemory; }; - + if (m_context.isDeviceFunctionalitySupported("VK_AMD_device_coherent_memory")) pNext = &coherentMemoryFeatures; VkPhysicalDeviceFeatures features; deMemset(&features, 0, sizeof(vk::VkPhysicalDeviceFeatures)); @@ -187,14 +191,14 @@ void BaseAllocateTestInstance::createTestDevice (void) VkPhysicalDeviceFeatures2 features2 = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2, // VkStructureType sType - &coherentMemoryFeatures, // const void* pNext + pNext, // const void* pNext features // VkPhysicalDeviceFeatures features }; // Check if the physical device supports the protected memory feature instanceDriver.getPhysicalDeviceFeatures2(m_context.getPhysicalDevice(), &features2); - protMemSupported = protectedMemoryFeature.protectedMemory; - deviceCoherentMemSupported = coherentMemoryFeatures.deviceCoherentMemory; + protMemSupported = protectedMemoryFeature.protectedMemory; + m_deviceCoherentMemSupported = coherentMemoryFeatures.deviceCoherentMemory; VkDeviceQueueCreateFlags queueCreateFlags = protMemSupported ? (vk::VkDeviceQueueCreateFlags)vk::VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT : 0u; @@ -211,7 +215,7 @@ void BaseAllocateTestInstance::createTestDevice (void) const VkDeviceCreateInfo deviceInfo = { VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO, // VkStructureType sType; - (protMemSupported || deviceCoherentMemSupported) ? &features2 : DE_NULL, // const void* pNext; + (protMemSupported || m_deviceCoherentMemSupported) ? &features2 : DE_NULL, // const void* pNext; (VkDeviceCreateFlags)0, // VkDeviceCreateFlags flags; 1u, // uint32_t queueCreateInfoCount; &queueInfo, // const VkDeviceQueueCreateInfo* pQueueCreateInfos; @@ -219,7 +223,7 @@ void BaseAllocateTestInstance::createTestDevice (void) DE_NULL, // const char* const* ppEnabledLayerNames; 0u, // uint32_t enabledExtensionCount; DE_NULL, // const char* const* ppEnabledExtensionNames; - (protMemSupported || deviceCoherentMemSupported) ? DE_NULL : &deviceFeatures // const VkPhysicalDeviceFeatures* pEnabledFeatures; + (protMemSupported || m_deviceCoherentMemSupported) ? DE_NULL : &deviceFeatures // const VkPhysicalDeviceFeatures* pEnabledFeatures; }; m_logicalDevice = createCustomDevice(m_context.getTestContext().getCommandLine().isValidationEnabled(), m_context.getPlatformInterface(), instance, instanceDriver, m_context.getPhysicalDevice(), &deviceInfo); @@ -348,16 +352,23 @@ tcu::TestStatus AllocateFreeTestInstance::iterate (void) DE_FATAL("Unknown allocation order"); } - try - { - const VkMemoryType memoryType = m_memoryProperties.memoryTypes[m_memoryTypeIndex]; - const VkMemoryHeap memoryHeap = m_memoryProperties.memoryHeaps[memoryType.heapIndex]; + bool memoryTypeSupported = true; +#ifndef CTS_USES_VULKANSC + memoryTypeSupported = !((m_memoryProperties.memoryTypes[m_memoryTypeIndex].propertyFlags & vk::VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD) > 0 && !m_deviceCoherentMemSupported); +#endif - // Create a buffer to get the required size + if (memoryTypeSupported) + { + try { - const VkDeviceSize bufferSize = m_config.memorySize ? *m_config.memorySize : (VkDeviceSize) (*m_config.memoryPercentage * (float) memoryHeap.size); + const VkMemoryType memoryType = m_memoryProperties.memoryTypes[m_memoryTypeIndex]; + const VkMemoryHeap memoryHeap = m_memoryProperties.memoryHeaps[memoryType.heapIndex]; + + // Create a buffer to get the required size + { + const VkDeviceSize bufferSize = m_config.memorySize ? *m_config.memorySize : (VkDeviceSize)(*m_config.memoryPercentage * (float)memoryHeap.size); - VkBufferCreateInfo bufferParams = + VkBufferCreateInfo bufferParams = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, // VkStructureType sType; DE_NULL, // const void* pNext; @@ -369,144 +380,145 @@ tcu::TestStatus AllocateFreeTestInstance::iterate (void) &queueFamilyIndex, // const uint32_t* pQueueFamilyIndices; }; - buffer = createBuffer(vkd, device, &bufferParams); - vkd.getBufferMemoryRequirements(device, *buffer, &memReqs); - } + buffer = createBuffer(vkd, device, &bufferParams); + vkd.getBufferMemoryRequirements(device, *buffer, &memReqs); + } - const VkDeviceSize allocationSize = (m_config.memorySize ? memReqs.size : (VkDeviceSize)(*m_config.memoryPercentage * (float)memoryHeap.size)); - const VkDeviceSize roundedUpAllocationSize = roundUpToNextMultiple(allocationSize, m_memoryLimits.deviceMemoryAllocationGranularity); - vector<VkDeviceMemory> memoryObjects (m_config.memoryAllocationCount, (VkDeviceMemory)0); + const VkDeviceSize allocationSize = (m_config.memorySize ? memReqs.size : (VkDeviceSize)(*m_config.memoryPercentage * (float)memoryHeap.size)); + const VkDeviceSize roundedUpAllocationSize = roundUpToNextMultiple(allocationSize, m_memoryLimits.deviceMemoryAllocationGranularity); + vector<VkDeviceMemory> memoryObjects(m_config.memoryAllocationCount, (VkDeviceMemory)0); - log << TestLog::Message << "Memory type index: " << m_memoryTypeIndex << TestLog::EndMessage; + log << TestLog::Message << "Memory type index: " << m_memoryTypeIndex << TestLog::EndMessage; - if (memoryType.heapIndex >= m_memoryProperties.memoryHeapCount) - m_result.fail("Invalid heap index defined for memory type."); + if (memoryType.heapIndex >= m_memoryProperties.memoryHeapCount) + m_result.fail("Invalid heap index defined for memory type."); - { - log << TestLog::Message << "Memory type: " << memoryType << TestLog::EndMessage; - log << TestLog::Message << "Memory heap: " << memoryHeap << TestLog::EndMessage; + { + log << TestLog::Message << "Memory type: " << memoryType << TestLog::EndMessage; + log << TestLog::Message << "Memory heap: " << memoryHeap << TestLog::EndMessage; - if (roundedUpAllocationSize * m_config.memoryAllocationCount > memoryHeap.size) - TCU_THROW(NotSupportedError, "Memory heap doesn't have enough memory."); + if (roundedUpAllocationSize * m_config.memoryAllocationCount > memoryHeap.size) + TCU_THROW(NotSupportedError, "Memory heap doesn't have enough memory."); #if (DE_PTR_SIZE == 4) - // For 32-bit binaries we cap the total host visible allocations to 1.5GB to - // avoid exhausting CPU virtual address space and throwing a false negative result. - if ((memoryType.propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) && - allocationSize * m_config.memoryAllocationCount * (m_subsetAllocationAllowed ? 1 : m_numPhysDevices) >= 1610612736) + // For 32-bit binaries we cap the total host visible allocations to 1.5GB to + // avoid exhausting CPU virtual address space and throwing a false negative result. + if ((memoryType.propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) && + allocationSize * m_config.memoryAllocationCount * (m_subsetAllocationAllowed ? 1 : m_numPhysDevices) >= 1610612736) - log << TestLog::Message << " Skipping: Not enough CPU virtual address space for all host visible allocations." << TestLog::EndMessage; - else - { -#else - { -#endif - - try + log << TestLog::Message << " Skipping: Not enough CPU virtual address space for all host visible allocations." << TestLog::EndMessage; + else { - const deUint32 totalDeviceMaskCombinations = m_subsetAllocationAllowed ? (1 << m_numPhysDevices) - 1 : 1; - for (deUint32 deviceMask = 1; deviceMask <= totalDeviceMaskCombinations; deviceMask++) +#else { - // Allocate on all physical devices if subset allocation is not allowed, do only once. - if (!m_subsetAllocationAllowed) - deviceMask = (1 << m_numPhysDevices) - 1; - m_allocFlagsInfo.deviceMask = deviceMask; +#endif - if (m_config.order == TestConfig::ALLOC_FREE || m_config.order == TestConfig::ALLOC_REVERSE_FREE) + try { - for (size_t ndx = 0; ndx < m_config.memoryAllocationCount; ndx++) + const deUint32 totalDeviceMaskCombinations = m_subsetAllocationAllowed ? (1 << m_numPhysDevices) - 1 : 1; + for (deUint32 deviceMask = 1; deviceMask <= totalDeviceMaskCombinations; deviceMask++) { - VkMemoryAllocateInfo alloc = - { - VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, // sType - m_useDeviceGroups ? &m_allocFlagsInfo : DE_NULL, // pNext - allocationSize, // allocationSize - m_memoryTypeIndex // memoryTypeIndex; - }; + // Allocate on all physical devices if subset allocation is not allowed, do only once. + if (!m_subsetAllocationAllowed) + deviceMask = (1 << m_numPhysDevices) - 1; + m_allocFlagsInfo.deviceMask = deviceMask; - VkResult res = vkd.allocateMemory(device, &alloc, (const VkAllocationCallbacks*)DE_NULL, &memoryObjects[ndx]); + if (m_config.order == TestConfig::ALLOC_FREE || m_config.order == TestConfig::ALLOC_REVERSE_FREE) + { + for (size_t ndx = 0; ndx < m_config.memoryAllocationCount; ndx++) + { + VkMemoryAllocateInfo alloc = + { + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, // sType + m_useDeviceGroups ? &m_allocFlagsInfo : DE_NULL, // pNext + allocationSize, // allocationSize + m_memoryTypeIndex // memoryTypeIndex; + }; - // Some implementations might have limitations on protected heap, and these limitations - // don't show up in Vulkan queries. Use a hard coded threshold after which out of memory - // is allowed. - if (res == VK_ERROR_OUT_OF_DEVICE_MEMORY && memoryType.propertyFlags & vk::VK_MEMORY_PROPERTY_PROTECTED_BIT && ndx > 80) - break; + VkResult res = vkd.allocateMemory(device, &alloc, (const VkAllocationCallbacks*)DE_NULL, &memoryObjects[ndx]); - VK_CHECK(res); + // Some implementations might have limitations on protected heap, and these limitations + // don't show up in Vulkan queries. Use a hard coded threshold after which out of memory + // is allowed. + if (res == VK_ERROR_OUT_OF_DEVICE_MEMORY && memoryType.propertyFlags & vk::VK_MEMORY_PROPERTY_PROTECTED_BIT && ndx > 80) + break; - TCU_CHECK(!!memoryObjects[ndx]); - } + VK_CHECK(res); - if (m_config.order == TestConfig::ALLOC_FREE) - { - for (size_t ndx = 0; ndx < m_config.memoryAllocationCount; ndx++) - { - const VkDeviceMemory mem = memoryObjects[memoryObjects.size() - 1 - ndx]; + TCU_CHECK(!!memoryObjects[ndx]); + } - if (!!mem) + if (m_config.order == TestConfig::ALLOC_FREE) + { + for (size_t ndx = 0; ndx < m_config.memoryAllocationCount; ndx++) + { + const VkDeviceMemory mem = memoryObjects[memoryObjects.size() - 1 - ndx]; + + if (!!mem) + { + vkd.freeMemory(device, mem, (const VkAllocationCallbacks*)DE_NULL); + memoryObjects[memoryObjects.size() - 1 - ndx] = (VkDeviceMemory)0; + } + } + } + else { - vkd.freeMemory(device, mem, (const VkAllocationCallbacks *) DE_NULL); - memoryObjects[memoryObjects.size() - 1 - ndx] = (VkDeviceMemory) 0; + for (size_t ndx = 0; ndx < m_config.memoryAllocationCount; ndx++) + { + const VkDeviceMemory mem = memoryObjects[ndx]; + + if (!!mem) + { + vkd.freeMemory(device, mem, (const VkAllocationCallbacks*)DE_NULL); + memoryObjects[ndx] = (VkDeviceMemory)0; + } + } } } - } - else - { - for (size_t ndx = 0; ndx < m_config.memoryAllocationCount; ndx++) + else { - const VkDeviceMemory mem = memoryObjects[ndx]; - - if (!!mem) + for (size_t ndx = 0; ndx < m_config.memoryAllocationCount; ndx++) { - vkd.freeMemory(device, mem, (const VkAllocationCallbacks *) DE_NULL); - memoryObjects[ndx] = (VkDeviceMemory) 0; + const VkMemoryAllocateInfo alloc = + { + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, // sType + m_useDeviceGroups ? &m_allocFlagsInfo : DE_NULL, // pNext + allocationSize, // allocationSize + m_memoryTypeIndex // memoryTypeIndex; + }; + + VK_CHECK(vkd.allocateMemory(device, &alloc, (const VkAllocationCallbacks*)DE_NULL, &memoryObjects[ndx])); + TCU_CHECK(!!memoryObjects[ndx]); + + vkd.freeMemory(device, memoryObjects[ndx], (const VkAllocationCallbacks*)DE_NULL); + memoryObjects[ndx] = (VkDeviceMemory)0; } } } } - else + catch (...) { for (size_t ndx = 0; ndx < m_config.memoryAllocationCount; ndx++) { - const VkMemoryAllocateInfo alloc = - { - VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, // sType - m_useDeviceGroups ? &m_allocFlagsInfo : DE_NULL, // pNext - allocationSize, // allocationSize - m_memoryTypeIndex // memoryTypeIndex; - }; - - VK_CHECK(vkd.allocateMemory(device, &alloc, (const VkAllocationCallbacks*)DE_NULL, &memoryObjects[ndx])); - TCU_CHECK(!!memoryObjects[ndx]); + const VkDeviceMemory mem = memoryObjects[ndx]; - vkd.freeMemory(device, memoryObjects[ndx], (const VkAllocationCallbacks*)DE_NULL); - memoryObjects[ndx] = (VkDeviceMemory)0; + if (!!mem) + { + vkd.freeMemory(device, mem, (const VkAllocationCallbacks*)DE_NULL); + memoryObjects[ndx] = (VkDeviceMemory)0; + } } - } - } - } - catch (...) - { - for (size_t ndx = 0; ndx < m_config.memoryAllocationCount; ndx++) - { - const VkDeviceMemory mem = memoryObjects[ndx]; - if (!!mem) - { - vkd.freeMemory(device, mem, (const VkAllocationCallbacks*)DE_NULL); - memoryObjects[ndx] = (VkDeviceMemory)0; + throw; } } - - throw; } } + catch (const tcu::TestError& error) + { + m_result.fail(error.getMessage()); } } - catch (const tcu::TestError& error) - { - m_result.fail(error.getMessage()); - } m_memoryTypeIndex++; @@ -626,6 +638,12 @@ RandomAllocFreeTestInstance::RandomAllocFreeTestInstance (Context& context, Test TCU_CHECK(type.type.heapIndex < m_memoryProperties.memoryHeapCount); + if ((m_memoryProperties.memoryTypes[type.index].propertyFlags & vk::VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD) > 0 && !m_deviceCoherentMemSupported) + { + continue; + } + + m_heaps[type.type.heapIndex].types.push_back(type); } } diff --git a/external/vulkancts/modules/vulkan/multiview/vktMultiViewRenderTests.cpp b/external/vulkancts/modules/vulkan/multiview/vktMultiViewRenderTests.cpp index e7821370b..f8f25db32 100644 --- a/external/vulkancts/modules/vulkan/multiview/vktMultiViewRenderTests.cpp +++ b/external/vulkancts/modules/vulkan/multiview/vktMultiViewRenderTests.cpp @@ -2303,7 +2303,7 @@ void MultiViewSecondaryCommandBufferTestInstance::draw (const deUint32 subpassCo { VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO_KHR, // VkStructureType sType; DE_NULL, // const void* pNext; - VK_RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS_BIT_KHR, // VkRenderingFlagsKHR flags; + 0u, // VkRenderingFlagsKHR flags; m_parameters.viewMasks[subpassNdx], // uint32_t viewMask; 1u, // uint32_t colorAttachmentCount; &m_parameters.colorFormat, // const VkFormat* pColorAttachmentFormats; diff --git a/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleTests.cpp b/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleTests.cpp index d9822ca49..3c4dbb55a 100644 --- a/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleTests.cpp +++ b/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleTests.cpp @@ -3970,7 +3970,7 @@ void MultisampleRenderer::initialize (Context& context, for (deUint32 attachmentIdx = 0; attachmentIdx < attachmentCount; attachmentIdx++) attachments.push_back(m_colorBlendState); - const VkPipelineColorBlendStateCreateInfo colorBlendStateParams = + VkPipelineColorBlendStateCreateInfo colorBlendStateParams = { VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO, // VkStructureType sType; DE_NULL, // const void* pNext; @@ -4062,6 +4062,18 @@ void MultisampleRenderer::initialize (Context& context, const deUint32 numSubpasses = m_renderType == RENDER_TYPE_DEPTHSTENCIL_ONLY ? 2u : 1u; for (deUint32 subpassIdx = 0; subpassIdx < numSubpasses; subpassIdx++) + { + if (m_renderType == RENDER_TYPE_DEPTHSTENCIL_ONLY) + { + if (subpassIdx == 0) + { + colorBlendStateParams.attachmentCount = 0; + } + else + { + colorBlendStateParams.attachmentCount = 1; + } + } for (deUint32 i = 0u; i < numTopologies; ++i) { const VkPipelineInputAssemblyStateCreateInfo inputAssemblyStateCreateInfo @@ -4098,6 +4110,7 @@ void MultisampleRenderer::initialize (Context& context, m_graphicsPipelines.push_back(VkPipelineSp(new Unique<VkPipeline>(createGraphicsPipeline(vk, vkDevice, DE_NULL, &pipelineCreateInfo)))); } + } } if (m_renderType == RENDER_TYPE_COPY_SAMPLES) diff --git a/external/vulkancts/modules/vulkan/ray_tracing/vktRayTracingAccelerationStructuresTests.cpp b/external/vulkancts/modules/vulkan/ray_tracing/vktRayTracingAccelerationStructuresTests.cpp index db49077cb..5862bd568 100644 --- a/external/vulkancts/modules/vulkan/ray_tracing/vktRayTracingAccelerationStructuresTests.cpp +++ b/external/vulkancts/modules/vulkan/ray_tracing/vktRayTracingAccelerationStructuresTests.cpp @@ -2773,7 +2773,7 @@ tcu::TestStatus RayTracingHeaderBottomAddressTestInstance::iterate (void) const VkQueue queue = m_context.getUniversalQueue(); Allocator& allocator = m_context.getDefaultAllocator(); - const Move<VkCommandPool> cmdPool = createCommandPool(vkd, device, 0, familyIndex); + const Move<VkCommandPool> cmdPool = createCommandPool(vkd, device, vk::VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, familyIndex); const Move<VkCommandBuffer> cmdBuffer = allocateCommandBuffer(vkd, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY); beginCommandBuffer(vkd, *cmdBuffer, 0); @@ -2790,6 +2790,7 @@ tcu::TestStatus RayTracingHeaderBottomAddressTestInstance::iterate (void) SerialStorage deepStorage (vkd, device, allocator, m_params->buildType, serialInfo); // make deep serialization - top-level AS width bottom-level structures that it owns + vkd.resetCommandBuffer(*cmdBuffer, 0); beginCommandBuffer(vkd, *cmdBuffer, 0); src->serialize(vkd, device, *cmdBuffer, &deepStorage); endCommandBuffer(vkd, *cmdBuffer); diff --git a/external/vulkancts/modules/vulkan/reconvergence/vktReconvergenceTests.cpp b/external/vulkancts/modules/vulkan/reconvergence/vktReconvergenceTests.cpp index c2002254a..2fe77fe48 100644 --- a/external/vulkancts/modules/vulkan/reconvergence/vktReconvergenceTests.cpp +++ b/external/vulkancts/modules/vulkan/reconvergence/vktReconvergenceTests.cpp @@ -1740,8 +1740,9 @@ tcu::TestStatus ReconvergenceTestInstance::iterate (void) flushAlloc(vk, device, buffers[1]->getAllocation()); flushAlloc(vk, device, buffers[2]->getAllocation()); - const VkBool32 computeFullSubgroups = subgroupProperties.subgroupSize <= 64 && - m_context.getSubgroupSizeControlFeatures().computeFullSubgroups; + const VkBool32 computeFullSubgroups = (subgroupProperties.subgroupSize <= 64) && + (m_context.getSubgroupSizeControlFeatures().computeFullSubgroups) && + (m_context.getSubgroupSizeControlProperties().requiredSubgroupSizeStages & VK_SHADER_STAGE_COMPUTE_BIT); const VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT subgroupSizeCreateInfo = { diff --git a/external/vulkancts/modules/vulkan/renderpass/vktRenderPassSparseRenderTargetTests.cpp b/external/vulkancts/modules/vulkan/renderpass/vktRenderPassSparseRenderTargetTests.cpp index 7c8692710..f85e47ed1 100644 --- a/external/vulkancts/modules/vulkan/renderpass/vktRenderPassSparseRenderTargetTests.cpp +++ b/external/vulkancts/modules/vulkan/renderpass/vktRenderPassSparseRenderTargetTests.cpp @@ -730,6 +730,14 @@ void checkSupport(Context& context, TestConfigType config) if (config.renderingType == RENDERING_TYPE_DYNAMIC_RENDERING) context.requireDeviceFunctionality("VK_KHR_dynamic_rendering"); + + const auto& vki = context.getInstanceInterface(); + const auto& physicalDevice = context.getPhysicalDevice(); + VkImageFormatProperties formatProperties; + const auto result = vki.getPhysicalDeviceImageFormatProperties(physicalDevice, config.format, VK_IMAGE_TYPE_2D, VK_IMAGE_TILING_OPTIMAL, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT, 0u, &formatProperties); + if (result == VK_ERROR_FORMAT_NOT_SUPPORTED) { + TCU_THROW(NotSupportedError, "Image format not supported"); + } } void initTests (tcu::TestCaseGroup* group, const RenderingType renderingType) diff --git a/external/vulkancts/modules/vulkan/renderpass/vktRenderPassTests.cpp b/external/vulkancts/modules/vulkan/renderpass/vktRenderPassTests.cpp index c92d71e5d..36f73fb85 100644 --- a/external/vulkancts/modules/vulkan/renderpass/vktRenderPassTests.cpp +++ b/external/vulkancts/modules/vulkan/renderpass/vktRenderPassTests.cpp @@ -1814,8 +1814,9 @@ void beginCommandBuffer (const DeviceInterface& vk, inheritanceRenderingInfo.pColorAttachmentFormats = colorAttachmentFormats.data(); if (pRenderInfo->getDepthStencilAttachment()) { - inheritanceRenderingInfo.depthAttachmentFormat = pRenderInfo->getDepthStencilAttachment()->getFormat(); - inheritanceRenderingInfo.stencilAttachmentFormat = pRenderInfo->getDepthStencilAttachment()->getFormat(); + const VkFormat dsFormat = pRenderInfo->getDepthStencilAttachment()->getFormat(); + inheritanceRenderingInfo.depthAttachmentFormat = tcu::hasDepthComponent(mapVkFormat(dsFormat).order) ? dsFormat : VK_FORMAT_UNDEFINED; + inheritanceRenderingInfo.stencilAttachmentFormat = tcu::hasStencilComponent(mapVkFormat(dsFormat).order) ? dsFormat : VK_FORMAT_UNDEFINED; } if (pRenderInfo->getColorAttachmentCount()) inheritanceRenderingInfo.rasterizationSamples = pRenderInfo->getColorAttachment(0).getSamples(); @@ -2035,13 +2036,26 @@ Move<VkPipeline> createSubpassPipeline (const DeviceInterface& vk, for (deUint32 i = 0; i < renderInfo.getColorAttachmentCount(); ++i) colorAttachmentFormats.push_back(renderInfo.getColorAttachment(i).getFormat()); - vk::VkFormat depthStencilFormat = VK_FORMAT_UNDEFINED; + vk::VkFormat depthFormat = VK_FORMAT_UNDEFINED; + vk::VkFormat stencilFormat = VK_FORMAT_UNDEFINED; if (renderInfo.getDepthStencilAttachment()) { const Attachment& attachment = *renderInfo.getDepthStencilAttachment(); - depthStencilFormat = attachment.getFormat(); + vk::VkFormat depthStencilFormat = attachment.getFormat(); + if (depthStencilFormat != VK_FORMAT_UNDEFINED) + { + if (tcu::hasDepthComponent(mapVkFormat(depthStencilFormat).order)) + { + depthFormat = depthStencilFormat; + } + if (tcu::hasStencilComponent(mapVkFormat(depthStencilFormat).order)) + { + stencilFormat = depthStencilFormat; + } + } } + VkPipelineRenderingCreateInfoKHR renderingCreateInfo { VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO_KHR, @@ -2049,8 +2063,8 @@ Move<VkPipeline> createSubpassPipeline (const DeviceInterface& vk, 0u, static_cast<deUint32>(colorAttachmentFormats.size()), colorAttachmentFormats.data(), - depthStencilFormat, - depthStencilFormat + depthFormat, + stencilFormat }; return makeGraphicsPipeline(vk, // const DeviceInterface& vk diff --git a/external/vulkancts/modules/vulkan/robustness/vktRobustnessExtsTests.cpp b/external/vulkancts/modules/vulkan/robustness/vktRobustnessExtsTests.cpp index 127afffe3..002fdaaa0 100644 --- a/external/vulkancts/modules/vulkan/robustness/vktRobustnessExtsTests.cpp +++ b/external/vulkancts/modules/vulkan/robustness/vktRobustnessExtsTests.cpp @@ -1727,15 +1727,26 @@ tcu::TestStatus RobustnessExtsTestInstance::iterate (void) (VkDeviceSize)(m_data.bufferLen ? m_data.bufferLen : 1), (VkDeviceSize)256); + VkBufferUsageFlags usage = VK_BUFFER_USAGE_VERTEX_BUFFER_BIT; if (m_data.descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER || m_data.descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC) { size = deIntRoundToPow2((int)size, (int)robustness2Properties.robustUniformBufferAccessSizeAlignment); + usage |= VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT; } else if (m_data.descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER || m_data.descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC) { size = deIntRoundToPow2((int)size, (int)robustness2Properties.robustStorageBufferAccessSizeAlignment); + usage |= VK_BUFFER_USAGE_STORAGE_BUFFER_BIT; + } + else if (m_data.descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER) + { + usage |= VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT; + } + else if (m_data.descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER) + { + usage |= VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT; } else if (m_data.descriptorType == VERTEX_ATTRIBUTE_FETCH) { @@ -1743,13 +1754,7 @@ tcu::TestStatus RobustnessExtsTestInstance::iterate (void) } buffer = de::MovePtr<BufferWithMemory>(new BufferWithMemory( - vk, device, allocator, makeBufferCreateInfo(size, - VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | - VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | - VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT | - VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT | - VK_BUFFER_USAGE_VERTEX_BUFFER_BIT), - MemoryRequirement::HostVisible)); + vk, device, allocator, makeBufferCreateInfo(size, usage), MemoryRequirement::HostVisible)); bufferPtr = (deUint8 *)buffer->getAllocation().getHostPtr(); deMemset(bufferPtr, 0x3f, (size_t)size); diff --git a/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationOperation.cpp b/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationOperation.cpp index 631fe51bf..c825e8b85 100644 --- a/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationOperation.cpp +++ b/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationOperation.cpp @@ -5040,7 +5040,7 @@ public: // with this operation we can test pre_rasterization, index_input and attribute_input flags; // since this operation is executed for three buffers of different size we use diferent flags depending on the size if (m_resource.getBuffer().size > MAX_UPDATE_BUFFER_SIZE) - stageMask = VK_PIPELINE_STAGE_2_PRE_RASTERIZATION_SHADERS_BIT_KHR; + stageMask = VK_PIPELINE_STAGE_2_VERTEX_INPUT_BIT_KHR; else stageMask = usingIndexedDraw ? VK_PIPELINE_STAGE_2_INDEX_INPUT_BIT_KHR : VK_PIPELINE_STAGE_2_VERTEX_ATTRIBUTE_INPUT_BIT_KHR; diff --git a/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationSignalOrderTests.cpp b/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationSignalOrderTests.cpp index c9707f3ea..30432d542 100644 --- a/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationSignalOrderTests.cpp +++ b/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationSignalOrderTests.cpp @@ -862,7 +862,7 @@ public: }; // Unblock the whole lot. - hostSignal(vkA, deviceA, semaphoreHandlesA.front(), 1); + hostSignal(vkA, deviceA, semaphoreHandlesA.front(), 2); VK_CHECK(vkB.waitSemaphores(*deviceB, &waitInfo, ~0ull)); } diff --git a/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationWin32KeyedMutexTests.cpp b/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationWin32KeyedMutexTests.cpp index b5581960c..b08780462 100644 --- a/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationWin32KeyedMutexTests.cpp +++ b/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationWin32KeyedMutexTests.cpp @@ -178,6 +178,8 @@ vk::Move<vk::VkDevice> createTestDevice (Context& context, extensions.push_back("VK_KHR_external_memory_win32"); extensions.push_back("VK_KHR_win32_keyed_mutex"); + const auto& features = context.getDeviceFeatures(); + try { std::vector<vk::VkDeviceQueueCreateInfo> queues; @@ -212,7 +214,7 @@ vk::Move<vk::VkDevice> createTestDevice (Context& context, (deUint32)extensions.size(), extensions.empty() ? DE_NULL : &extensions[0], - 0u + &features }; return createCustomDevice(validationEnabled, vkp, instance, vki, physicalDevice, &createInfo); diff --git a/external/vulkancts/modules/vulkan/util/vktExternalMemoryUtil.cpp b/external/vulkancts/modules/vulkan/util/vktExternalMemoryUtil.cpp index 2e60d6cac..cee510284 100644 --- a/external/vulkancts/modules/vulkan/util/vktExternalMemoryUtil.cpp +++ b/external/vulkancts/modules/vulkan/util/vktExternalMemoryUtil.cpp @@ -23,7 +23,7 @@ #include "vkQueryUtil.hpp" -#if (DE_OS == DE_OS_ANDROID) || (DE_OS == DE_OS_UNIX) +#if (DE_OS == DE_OS_ANDROID) || (DE_OS == DE_OS_UNIX) || (DE_OS == DE_OS_OSX) # include <unistd.h> # include <fcntl.h> # include <errno.h> @@ -73,7 +73,7 @@ NativeHandle::NativeHandle (const NativeHandle& other) { if (other.m_fd >= 0) { -#if (DE_OS == DE_OS_ANDROID) || (DE_OS == DE_OS_UNIX) +#if (DE_OS == DE_OS_ANDROID) || (DE_OS == DE_OS_UNIX) || (DE_OS == DE_OS_OSX) DE_ASSERT(!other.m_win32Handle.internal); DE_ASSERT(!other.m_androidHardwareBuffer.internal); m_fd = dup(other.m_fd); @@ -164,7 +164,7 @@ void NativeHandle::reset (void) { if (m_fd >= 0) { -#if (DE_OS == DE_OS_ANDROID) || (DE_OS == DE_OS_UNIX) +#if (DE_OS == DE_OS_ANDROID) || (DE_OS == DE_OS_UNIX) || (DE_OS == DE_OS_OSX) DE_ASSERT(!m_win32Handle.internal); DE_ASSERT(!m_androidHardwareBuffer.internal); ::close(m_fd); diff --git a/external/vulkancts/modules/vulkan/wsi/vktWsiPresentIdWaitTests.cpp b/external/vulkancts/modules/vulkan/wsi/vktWsiPresentIdWaitTests.cpp index f32d7ee7a..af409cf20 100644 --- a/external/vulkancts/modules/vulkan/wsi/vktWsiPresentIdWaitTests.cpp +++ b/external/vulkancts/modules/vulkan/wsi/vktWsiPresentIdWaitTests.cpp @@ -189,10 +189,31 @@ vk::Move<vk::VkDevice> createDeviceWithWsi (const vk::PlatformInterface& vkp, extensions.push_back(ext); deMemset(&features, 0, sizeof(features)); + + vk::VkPhysicalDeviceFeatures2 physicalDeviceFeatures2 { vk::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2, DE_NULL, features }; + + vk::VkPhysicalDevicePresentIdFeaturesKHR presentIdFeatures = { vk::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR, DE_NULL, DE_TRUE }; + vk::VkPhysicalDevicePresentWaitFeaturesKHR presentWaitFeatures = { vk::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR, DE_NULL, DE_TRUE }; + + void* pNext = DE_NULL; + for (size_t i = 0; i < extraExtensions.size(); ++i) { + if (strcmp(extraExtensions[i], "VK_KHR_present_id") == 0) + { + presentIdFeatures.pNext = pNext; + pNext = &presentIdFeatures; + } + else if (strcmp(extraExtensions[i], "VK_KHR_present_wait") == 0) + { + presentWaitFeatures.pNext = pNext; + pNext = &presentWaitFeatures; + } + } + physicalDeviceFeatures2.pNext = pNext; + const vk::VkDeviceCreateInfo deviceParams = { vk::VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO, - nullptr, + pNext ? &physicalDeviceFeatures2 : DE_NULL, (vk::VkDeviceCreateFlags)0, DE_LENGTH_OF_ARRAY(queueInfos), &queueInfos[0], @@ -200,7 +221,7 @@ vk::Move<vk::VkDevice> createDeviceWithWsi (const vk::PlatformInterface& vkp, nullptr, // ppEnabledLayerNames static_cast<deUint32>(extensions.size()), // enabledExtensionCount extensions.data(), // ppEnabledExtensionNames - &features + pNext ? DE_NULL : &features }; return createCustomDevice(validationEnabled, vkp, instance, vki, physicalDevice, &deviceParams, pAllocator); diff --git a/external/vulkancts/mustpass/master/vk-default/api.txt b/external/vulkancts/mustpass/master/vk-default/api.txt index b36257477..58dcb8bbe 100644 --- a/external/vulkancts/mustpass/master/vk-default/api.txt +++ b/external/vulkancts/mustpass/master/vk-default/api.txt @@ -3753,7 +3753,6 @@ dEQP-VK.api.device_init.create_device_global_priority_query dEQP-VK.api.device_init.create_device_features2 dEQP-VK.api.device_init.create_device_unsupported_features dEQP-VK.api.device_init.create_device_queue2 -dEQP-VK.api.device_init.create_device_queue2_unmatched_flags dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail dEQP-VK.api.object_management.single.instance dEQP-VK.api.object_management.single.device |