Skip to content

Commit

Permalink
Fix tests to use custom device interface that they've created.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
CJohnston-AMD authored and lordalcol committed Aug 30, 2024
1 parent aeb7e7d commit a0d21ab
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<vk::DeviceDriver> deviceDriver = de::MovePtr<DeviceDriver>(
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<FBAttachmentInfo> &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,
Expand Down Expand Up @@ -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<FBAttachmentInfo> &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<VkClearValue> clearColor(attachmentInfo.size(), makeClearValueColorU32(0, 0, 0, 0));

#ifndef CTS_USES_VULKANSC
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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> videoDevice(
config.videoCodecOperationFlags != 0 ?
getVideoDevice(context, usingTimelineSemaphores, config.videoCodecOperationFlags) :
DE_NULL);

const DeviceInterface &vk = getSyncDeviceInterface(videoDevice, context);
std::vector<VkQueueFamilyVideoPropertiesKHR> videoQueueFamilyProperties2;
#else
const CustomInstance instance(createCustomInstanceFromContext(context));
Expand Down Expand Up @@ -748,9 +742,17 @@ tcu::TestStatus basicMultiQueueCase(Context &context, TestConfig config)
context.getPlatformInterface(), instance, instanceInterface, physicalDevice, &deviceInfo);

#ifndef CTS_USES_VULKANSC
de::MovePtr<VideoDevice> videoDevice(
config.videoCodecOperationFlags != 0 ?
getVideoDevice(context, usingTimelineSemaphores, config.videoCodecOperationFlags) :
DE_NULL);

de::MovePtr<vk::DeviceDriver> deviceDriver = de::MovePtr<DeviceDriver>(
new DeviceDriver(context.getPlatformInterface(), instance, *logicalDevice, context.getUsedApiVersion(),
context.getTestContext().getCommandLine()));

const DeviceInterface &vk = (videoDevice != DE_NULL) ? getSyncDeviceInterface(videoDevice, context) : *deviceDriver;

#else
de::MovePtr<vk::DeviceDriverSC, vk::DeinitDeviceDeleter> deviceDriver =
de::MovePtr<DeviceDriverSC, DeinitDeviceDeleter>(
Expand Down

0 comments on commit a0d21ab

Please sign in to comment.