Skip to content

Commit

Permalink
tests: Adjust test for relaxed properties pNext checking
Browse files Browse the repository at this point in the history
VUID-VkPhysicalDeviceProperties2-pNext-pNext will no longer
fire if a property structure is included without its
extension being enabled.
  • Loading branch information
jeremyg-lunarg committed Jan 23, 2025
1 parent c66f99d commit 30169d2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 38 deletions.
6 changes: 0 additions & 6 deletions tests/unit/device_feature_property.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,12 +440,6 @@ TEST_F(NegativeDeviceFeatureProperty, Features11WithoutVulkan12) {
m_errorMonitor->SetDesiredError("VUID-VkDeviceCreateInfo-pNext-pNext");
vk::CreateDevice(Gpu(), &m_second_device_ci, nullptr, &m_second_device);
m_errorMonitor->VerifyFound();

VkPhysicalDeviceVulkan12Properties bad_version_1_1_struct = vku::InitStructHelper();
VkPhysicalDeviceProperties2 phys_dev_props_2 = vku::InitStructHelper(&bad_version_1_1_struct);
m_errorMonitor->SetDesiredError("VUID-VkPhysicalDeviceProperties2-pNext-pNext");
vk::GetPhysicalDeviceProperties2(Gpu(), &phys_dev_props_2);
m_errorMonitor->VerifyFound();
}

TEST_F(NegativeDeviceFeatureProperty, Robustness2WithoutRobustness) {
Expand Down
11 changes: 11 additions & 0 deletions tests/unit/device_feature_property_positive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,14 @@ TEST_F(PositiveDeviceFeatureProperty, VertexAttributeDivisor) {
vk::CreateDevice(Gpu(), &m_second_device_ci, nullptr, &second_device);
vk::DestroyDevice(second_device, nullptr);
}

TEST_F(PositiveDeviceFeatureProperty, PropertyWithoutExtension) {
SetTargetApiVersion(VK_API_VERSION_1_1);
RETURN_IF_SKIP(InitFramework());

// query several properties which are unlikely to all be supported by the same physical device
VkPhysicalDeviceDrmPropertiesEXT drm_props = vku::InitStructHelper();
VkPhysicalDeviceLayeredDriverPropertiesMSFT layered_props = vku::InitStructHelper(&drm_props);

GetPhysicalDeviceProperties2(layered_props);
}
32 changes: 0 additions & 32 deletions tests/unit/others.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,24 +242,6 @@ TEST_F(VkLayerTest, SpecLinksExplicit) {
}
#endif // ANNOTATED_SPEC_LINK

TEST_F(VkLayerTest, DeviceIDPropertiesUnsupported) {
TEST_DESCRIPTION("VkPhysicalDeviceIDProperties cannot be used without extensions in 1.0");

SetTargetApiVersion(VK_API_VERSION_1_0);
AddRequiredExtensions(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME);
RETURN_IF_SKIP(InitFramework());

if (DeviceValidationVersion() != VK_API_VERSION_1_0) {
GTEST_SKIP() << "Test's for 1.0 only";
}

VkPhysicalDeviceIDProperties id_props = vku::InitStructHelper();
VkPhysicalDeviceProperties2 props2 = vku::InitStructHelper(&id_props);
m_errorMonitor->SetDesiredError("VUID-VkPhysicalDeviceProperties2-pNext-pNext");
vk::GetPhysicalDeviceProperties2KHR(Gpu(), &props2);
m_errorMonitor->VerifyFound();
}

TEST_F(VkLayerTest, UsePnextOnlyStructWithoutExtensionEnabled) {
TEST_DESCRIPTION(
"Validate that using VkPipelineTessellationDomainOriginStateCreateInfo in VkPipelineTessellationStateCreateInfo.pNext "
Expand Down Expand Up @@ -1207,20 +1189,6 @@ TEST_F(VkLayerTest, ExtensionXmlDependsLogic3) {
m_errorMonitor->VerifyFound();
}

TEST_F(VkLayerTest, MissingExtensionPhysicalDeviceProperties) {
TEST_DESCRIPTION("Don't enable instance extension needed");

AddRequiredExtensions(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME);
RETURN_IF_SKIP(Init());

// requires VK_KHR_external_fence_capabilities
VkPhysicalDeviceIDPropertiesKHR id_properties = vku::InitStructHelper();
VkPhysicalDeviceProperties2 properties2 = vku::InitStructHelper(&id_properties);
m_errorMonitor->SetDesiredError("VUID-VkPhysicalDeviceProperties2-pNext-pNext");
vk::GetPhysicalDeviceProperties2KHR(Gpu(), &properties2);
m_errorMonitor->VerifyFound();
}

TEST_F(VkLayerTest, InvalidGetExternalBufferPropertiesUsage) {
TEST_DESCRIPTION("Call vkGetPhysicalDeviceExternalBufferProperties with invalid usage");

Expand Down

0 comments on commit 30169d2

Please sign in to comment.