Skip to content

Commit

Permalink
tests: Best practice destroy event
Browse files Browse the repository at this point in the history
  • Loading branch information
ziga-lunarg committed Jan 8, 2025
1 parent 3980f09 commit 4cb07f4
Showing 1 changed file with 37 additions and 4 deletions.
41 changes: 37 additions & 4 deletions tests/unit/best_practices_positive.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* Copyright (c) 2015-2024 The Khronos Group Inc.
* Copyright (c) 2015-2024 Valve Corporation
* Copyright (c) 2015-2024 LunarG, Inc.
* Copyright (c) 2015-2024 Google, Inc.
* Copyright (c) 2015-2025 The Khronos Group Inc.
* Copyright (c) 2015-2025 Valve Corporation
* Copyright (c) 2015-2025 LunarG, Inc.
* Copyright (c) 2015-2025 Google, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -423,3 +423,36 @@ TEST_F(VkPositiveBestPracticesLayerTest, CreateFifoRelaxedSwapchain) {
m_errorMonitor->SetAllowedFailureMsg("VUID-VkSwapchainCreateInfoKHR-presentMode-02839");
m_swapchain.Init(*m_device, swapchain_create_info);
}

TEST_F(VkPositiveBestPracticesLayerTest, ResetCommandPool) {
TEST_DESCRIPTION("Destroy event that was set in a command buffer");

RETURN_IF_SKIP(InitBestPracticesFramework());
void *pNext = nullptr;
VkPhysicalDevicePortabilitySubsetFeaturesKHR portability_subset_features = vku::InitStructHelper();
if (IsExtensionsEnabled(VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME)) {
VkPhysicalDevicePortabilitySubsetFeaturesKHR portability_subset_features = vku::InitStructHelper();
GetPhysicalDeviceFeatures2(portability_subset_features);
if (!portability_subset_features.events) {
GTEST_SKIP() << "VkPhysicalDevicePortabilitySubsetFeaturesKHR::events not supported";
}
pNext = &portability_subset_features;
}
RETURN_IF_SKIP(InitState(nullptr, pNext));

{
vkt::Event event1(*m_device);
m_command_buffer.Begin();
event1.CmdSet(m_command_buffer, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT);
m_command_buffer.End();
m_default_queue->Submit(m_command_buffer);
m_default_queue->Wait();
}

vkt::Event event2(*m_device);
m_command_buffer.Begin();
event2.CmdSet(m_command_buffer, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT);
m_command_buffer.End();
m_default_queue->Submit(m_command_buffer);
m_default_queue->Wait();
}

0 comments on commit 4cb07f4

Please sign in to comment.