diff --git a/tests/unit/gpu_av_indirect_buffer.cpp b/tests/unit/gpu_av_indirect_buffer.cpp index dc36ff24f..3cc0f8338 100644 --- a/tests/unit/gpu_av_indirect_buffer.cpp +++ b/tests/unit/gpu_av_indirect_buffer.cpp @@ -157,14 +157,9 @@ TEST_F(NegativeGpuAVIndirectBuffer, DrawCountDeviceLimitSubmit2) { props.limits.maxDrawIndirectCount = 1; fpvkSetPhysicalDeviceLimitsEXT(gpu(), &props.limits); - VkPhysicalDeviceVulkan13Features features_13 = vku::InitStructHelper(); - VkPhysicalDeviceVulkan12Features features_12 = vku::InitStructHelper(&features_13); - VkPhysicalDeviceFeatures2 features2 = vku::InitStructHelper(&features_12); - GetPhysicalDeviceFeatures2(features2); - if (!features_12.drawIndirectCount) { - GTEST_SKIP() << "drawIndirectCount not supported"; - } - RETURN_IF_SKIP(InitState(nullptr, &features2)); + AddRequiredFeature(vkt::Feature::drawIndirectCount); + AddRequiredFeature(vkt::Feature::synchronization2); + RETURN_IF_SKIP(InitState()); InitRenderTarget(); vkt::Buffer draw_buffer(*m_device, 2 * sizeof(VkDrawIndexedIndirectCommand), VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT, @@ -546,11 +541,8 @@ TEST_F(NegativeGpuAVIndirectBuffer, FirstInstance) { AddRequiredExtensions(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); RETURN_IF_SKIP(InitGpuAvFramework()); - VkPhysicalDeviceFeatures2 features2 = vku::InitStructHelper(); - GetPhysicalDeviceFeatures2(features2); - features2.features.drawIndirectFirstInstance = VK_FALSE; - - RETURN_IF_SKIP(InitState(nullptr, &features2)); + AddDisabledFeature(vkt::Feature::drawIndirectFirstInstance); + RETURN_IF_SKIP(InitState(nullptr)); InitRenderTarget(); vkt::Buffer draw_buffer(*m_device, 4 * sizeof(VkDrawIndirectCommand), VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT, @@ -724,9 +716,8 @@ TEST_F(NegativeGpuAVIndirectBuffer, DispatchWorkgroupSizeShaderObjects) { props.limits.maxComputeWorkGroupCount[2] = 2; fpvkSetPhysicalDeviceLimitsEXT(gpu(), &props.limits); - VkPhysicalDeviceShaderObjectFeaturesEXT shaderObjectFeatures = vku::InitStructHelper(); - auto features2 = GetPhysicalDeviceFeatures2(shaderObjectFeatures); - RETURN_IF_SKIP(InitState(nullptr, &features2)); + AddRequiredFeature(vkt::Feature::shaderObject); + RETURN_IF_SKIP(InitState()); vkt::Buffer indirect_buffer(*m_device, 5 * sizeof(VkDispatchIndirectCommand), VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT); diff --git a/tests/unit/gpu_av_oob.cpp b/tests/unit/gpu_av_oob.cpp index eb864480e..179cfce27 100644 --- a/tests/unit/gpu_av_oob.cpp +++ b/tests/unit/gpu_av_oob.cpp @@ -24,13 +24,8 @@ TEST_F(NegativeGpuAVOOB, RobustBuffer) { AddRequiredExtensions(VK_EXT_PIPELINE_ROBUSTNESS_EXTENSION_NAME); RETURN_IF_SKIP(InitGpuAvFramework()); - VkPhysicalDevicePipelineRobustnessFeaturesEXT pipeline_robustness_features = vku::InitStructHelper(); - auto features2 = GetPhysicalDeviceFeatures2(pipeline_robustness_features); - features2.features.robustBufferAccess = VK_FALSE; - if (!pipeline_robustness_features.pipelineRobustness) { - GTEST_SKIP() << "pipelineRobustness feature not supported"; - } - RETURN_IF_SKIP(InitState(nullptr, &features2)); + AddRequiredFeature(vkt::Feature::pipelineRobustness); + RETURN_IF_SKIP(InitState()); InitRenderTarget(); VkMemoryPropertyFlags reqs = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT; vkt::Buffer uniform_buffer(*m_device, 4, VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, reqs); @@ -161,15 +156,12 @@ void NegativeGpuAVOOB::ShaderBufferSizeTest(VkDeviceSize buffer_size, VkDeviceSi } RETURN_IF_SKIP(InitGpuAvFramework()); - VkPhysicalDeviceDynamicRenderingFeatures dynamic_rendering_features = vku::InitStructHelper(); - dynamic_rendering_features.dynamicRendering = VK_TRUE; - VkPhysicalDeviceShaderObjectFeaturesEXT shader_object_features = vku::InitStructHelper(&dynamic_rendering_features); - shader_object_features.shaderObject = VK_TRUE; - VkPhysicalDeviceFeatures2 features = vku::InitStructHelper(); // Make sure robust buffer access is not enabled + AddDisabledFeature(vkt::Feature::robustBufferAccess); if (shader_objects) { - features.pNext = &shader_object_features; + AddRequiredFeature(vkt::Feature::dynamicRendering); + AddRequiredFeature(vkt::Feature::shaderObject); } - RETURN_IF_SKIP(InitState(nullptr, &features)); + RETURN_IF_SKIP(InitState()); if (shader_objects) { InitDynamicRenderTarget(); } else { @@ -1489,4 +1481,4 @@ TEST_F(NegativeGpuAVOOB, VertexFragmentMultiEntrypoint) { m_default_queue->Submit(*m_commandBuffer); m_default_queue->Wait(); m_errorMonitor->VerifyFound(); -} \ No newline at end of file +}