From a0d21ab79f6b991b9b37124726cfe360ec07d8a0 Mon Sep 17 00:00:00 2001 From: Charles Johnston Date: Wed, 7 Aug 2024 07:15:46 -0400 Subject: [PATCH] Fix tests to use custom device interface that they've created. These test groups create a custom device, but then don't use it. They use the default device instead. Components: Vulkan VK-GL-CTS issue: 5279 Affected tests: dEQP-VK.device_group.afr* dEQP-VK.fragment_shading_rate.*.attachment_rate.setup_with_copying_using_transfer_queue* dEQP-VK.synchronization*.basic.*_semaphore.multi_queue* Change-Id: I96d9f4c33be6b7bba955e010023ac96f199186d7 --- .../device_group/vktDeviceGroupRendering.cpp | 10 ++++++++-- .../vktAttachmentRateTests.cpp | 9 +++++---- .../vktSynchronizationBasicSemaphoreTests.cpp | 14 ++++++++------ 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/external/vulkancts/modules/vulkan/device_group/vktDeviceGroupRendering.cpp b/external/vulkancts/modules/vulkan/device_group/vktDeviceGroupRendering.cpp index 0e5bcb78e2..02a24b2ae3 100644 --- a/external/vulkancts/modules/vulkan/device_group/vktDeviceGroupRendering.cpp +++ b/external/vulkancts/modules/vulkan/device_group/vktDeviceGroupRendering.cpp @@ -408,8 +408,14 @@ void DeviceGroupTestInstance::submitBufferAndWaitForIdle(const vk::DeviceInterfa tcu::TestStatus DeviceGroupTestInstance::iterate(void) { - const InstanceInterface &vki = m_instanceWrapper->instance.getDriver(); - const vk::DeviceInterface &vk = m_context.getDeviceInterface(); + const InstanceInterface &vki = m_instanceWrapper->instance.getDriver(); + + de::MovePtr deviceDriver = de::MovePtr( + new DeviceDriver(m_context.getPlatformInterface(), m_instanceWrapper->instance, *m_deviceGroup, + m_context.getUsedApiVersion(), m_context.getTestContext().getCommandLine())); + + const DeviceInterface &vk = *deviceDriver; + const uint32_t queueFamilyIndex = m_context.getUniversalQueueFamilyIndex(); const tcu::UVec2 renderSize(256, 256); const VkFormat colorFormat = VK_FORMAT_R8G8B8A8_UNORM; diff --git a/external/vulkancts/modules/vulkan/fragment_shading_rate/vktAttachmentRateTests.cpp b/external/vulkancts/modules/vulkan/fragment_shading_rate/vktAttachmentRateTests.cpp index 2c316b5453..f9c44e1d4a 100644 --- a/external/vulkancts/modules/vulkan/fragment_shading_rate/vktAttachmentRateTests.cpp +++ b/external/vulkancts/modules/vulkan/fragment_shading_rate/vktAttachmentRateTests.cpp @@ -235,7 +235,7 @@ class AttachmentRateInstance : public TestInstance void startRendering(const VkCommandBuffer commandBuffer, const VkRenderPass renderPass, const VkFramebuffer framebuffer, const VkRect2D &renderArea, const std::vector &attachmentInfo, const uint32_t srTileWidth = 0, - const uint32_t srTileHeight = 0) const; + const uint32_t srTileHeight = 0, const DeviceInterface *customDevice = nullptr) const; void finishRendering(const VkCommandBuffer commandBuffer) const; bool verifyUsingAtomicChecks(uint32_t tileWidth, uint32_t tileHeight, uint32_t rateWidth, uint32_t rateHeight, @@ -908,9 +908,10 @@ VkDescriptorSetAllocateInfo AttachmentRateInstance::makeDescriptorSetAllocInfo( void AttachmentRateInstance::startRendering(const VkCommandBuffer commandBuffer, const VkRenderPass renderPass, const VkFramebuffer framebuffer, const VkRect2D &renderArea, const std::vector &attachmentInfo, - const uint32_t srTileWidth, const uint32_t srTileHeight) const + const uint32_t srTileWidth, const uint32_t srTileHeight, + const DeviceInterface *customDevice) const { - const DeviceInterface &vk(m_context.getDeviceInterface()); + const DeviceInterface &vk = (customDevice != nullptr) ? *customDevice : m_context.getDeviceInterface(); std::vector clearColor(attachmentInfo.size(), makeClearValueColorU32(0, 0, 0, 0)); #ifndef CTS_USES_VULKANSC @@ -1932,7 +1933,7 @@ bool AttachmentRateInstance::runCopyModeOnTransferQueue(void) &cbImageBarrier); startRendering(*graphicsCmdBuffer, *renderPass, *framebuffer, makeRect2D(m_cbWidth, m_cbHeight), - attachmentInfo, tileWidth, tileHeight); + attachmentInfo, tileWidth, tileHeight, driver); // draw single triangle to cb vk.cmdBindDescriptorSets(*graphicsCmdBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, *graphicsPipelineLayout, 0, 1, diff --git a/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationBasicSemaphoreTests.cpp b/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationBasicSemaphoreTests.cpp index 854074143f..8e3e94a44b 100644 --- a/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationBasicSemaphoreTests.cpp +++ b/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationBasicSemaphoreTests.cpp @@ -549,12 +549,6 @@ tcu::TestStatus basicMultiQueueCase(Context &context, TestConfig config) const VkPhysicalDevice physicalDevice = context.getPhysicalDevice(); bool usingTimelineSemaphores = config.semaphoreType == VK_SEMAPHORE_TYPE_TIMELINE; - de::MovePtr videoDevice( - config.videoCodecOperationFlags != 0 ? - getVideoDevice(context, usingTimelineSemaphores, config.videoCodecOperationFlags) : - DE_NULL); - - const DeviceInterface &vk = getSyncDeviceInterface(videoDevice, context); std::vector videoQueueFamilyProperties2; #else const CustomInstance instance(createCustomInstanceFromContext(context)); @@ -748,9 +742,17 @@ tcu::TestStatus basicMultiQueueCase(Context &context, TestConfig config) context.getPlatformInterface(), instance, instanceInterface, physicalDevice, &deviceInfo); #ifndef CTS_USES_VULKANSC + de::MovePtr videoDevice( + config.videoCodecOperationFlags != 0 ? + getVideoDevice(context, usingTimelineSemaphores, config.videoCodecOperationFlags) : + DE_NULL); + de::MovePtr deviceDriver = de::MovePtr( new DeviceDriver(context.getPlatformInterface(), instance, *logicalDevice, context.getUsedApiVersion(), context.getTestContext().getCommandLine())); + + const DeviceInterface &vk = (videoDevice != DE_NULL) ? getSyncDeviceInterface(videoDevice, context) : *deviceDriver; + #else de::MovePtr deviceDriver = de::MovePtr(