aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorspencer-lunarg <spencer@lunarg.com>2023-01-12 23:18:24 +0900
committerSpencer Fricke <115671160+spencer-lunarg@users.noreply.github.com>2023-01-17 14:48:38 +0900
commitda218903954c3c10727dc643fbc90ad7fd06274d (patch)
treec4f3ed2258e9d7da9d0233058796b84441a8fb18
parentc8b1876e6ff65e601edea29931b0ec3620363749 (diff)
downloadvulkan-validation-layers-da218903954c3c10727dc643fbc90ad7fd06274d.tar.gz
tests: More tests fixes for profiles
-rw-r--r--tests/positive/image_buffer.cpp19
-rw-r--r--tests/vklayertests_buffer_image_memory_sampler.cpp14
-rw-r--r--tests/vklayertests_debug_printf.cpp16
-rw-r--r--tests/vklayertests_descriptor_renderpass_framebuffer.cpp5
-rw-r--r--tests/vklayertests_dynamic_rendering.cpp43
-rw-r--r--tests/vklayertests_others.cpp3
-rw-r--r--tests/vklayertests_pipeline_shader.cpp24
7 files changed, 78 insertions, 46 deletions
diff --git a/tests/positive/image_buffer.cpp b/tests/positive/image_buffer.cpp
index 2848d944b..82a262e6d 100644
--- a/tests/positive/image_buffer.cpp
+++ b/tests/positive/image_buffer.cpp
@@ -1,8 +1,8 @@
/*
- * Copyright (c) 2015-2022 The Khronos Group Inc.
- * Copyright (c) 2015-2022 Valve Corporation
- * Copyright (c) 2015-2022 LunarG, Inc.
- * Copyright (c) 2015-2022 Google, Inc.
+ * Copyright (c) 2015-2023 The Khronos Group Inc.
+ * Copyright (c) 2015-2023 Valve Corporation
+ * Copyright (c) 2015-2023 LunarG, Inc.
+ * Copyright (c) 2015-2023 Google, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -954,14 +954,16 @@ TEST_F(VkPositiveLayerTest, ExternalMemory) {
#endif
AddRequiredExtensions(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME);
- AddRequiredExtensions(VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME);
+ AddRequiredExtensions(VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME);
AddRequiredExtensions(VK_KHR_DEDICATED_ALLOCATION_EXTENSION_NAME);
AddOptionalExtensions(ext_mem_extension_name);
ASSERT_NO_FATAL_FAILURE(InitFramework(m_errorMonitor));
if (!AreRequiredExtensionsEnabled()) {
GTEST_SKIP() << RequiredExtensionsNotSupported() << " not supported";
}
-
+ if (IsPlatform(kMockICD)) {
+ GTEST_SKIP() << "External tests are not supported by MockICD, skipping tests";
+ }
// Check for import/export capability
VkPhysicalDeviceExternalBufferInfoKHR ebi = {VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO_KHR, nullptr, 0,
VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT, handle_type};
@@ -1302,6 +1304,11 @@ TEST_F(VkPositiveLayerTest, MultiplaneImageTests) {
ASSERT_NO_FATAL_FAILURE(InitState(nullptr, &mp_features, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT));
ASSERT_NO_FATAL_FAILURE(InitRenderTarget());
+ if (!ImageFormatAndFeaturesSupported(gpu(), VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR, VK_IMAGE_TILING_OPTIMAL,
+ VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT)) {
+ GTEST_SKIP() << "Required formats/features not supported";
+ }
+
// Create aliased function pointers for 1.0 and 1.1 contexts
PFN_vkBindImageMemory2KHR vkBindImageMemory2Function = nullptr;
diff --git a/tests/vklayertests_buffer_image_memory_sampler.cpp b/tests/vklayertests_buffer_image_memory_sampler.cpp
index 578482291..18ff50cb7 100644
--- a/tests/vklayertests_buffer_image_memory_sampler.cpp
+++ b/tests/vklayertests_buffer_image_memory_sampler.cpp
@@ -8545,6 +8545,11 @@ TEST_F(VkLayerTest, MultiplaneIncompatibleViewFormat) {
}
ASSERT_NO_FATAL_FAILURE(InitState(nullptr, &features2));
+ if (!ImageFormatAndFeaturesSupported(gpu(), VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM, VK_IMAGE_TILING_OPTIMAL,
+ VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT)) {
+ GTEST_SKIP() << "Required formats/features not supported";
+ }
+
VkSamplerYcbcrConversionCreateInfo ycbcr_create_info = LvlInitStruct<VkSamplerYcbcrConversionCreateInfo>();
ycbcr_create_info.format = VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM;
ycbcr_create_info.ycbcrModel = VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY;
@@ -9935,6 +9940,11 @@ TEST_F(VkLayerTest, MultiplaneImageSamplerConversionMismatch) {
GTEST_SKIP() << "Multiplane image format not supported";
}
+ if (!ImageFormatAndFeaturesSupported(gpu(), VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR, VK_IMAGE_TILING_OPTIMAL,
+ VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT)) {
+ GTEST_SKIP() << "Required formats/features not supported";
+ }
+
// Create Ycbcr conversion
VkSamplerYcbcrConversionCreateInfo ycbcr_create_info = LvlInitStruct<VkSamplerYcbcrConversionCreateInfo>();
ycbcr_create_info.format = VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR;
@@ -13821,6 +13831,10 @@ TEST_F(VkLayerTest, InvalidImageSubresourceRangeAspectMask) {
VkFormat mp_format = VK_FORMAT_G8_B8R8_2PLANE_420_UNORM;
+ if (!ImageFormatAndFeaturesSupported(gpu(), mp_format, VK_IMAGE_TILING_OPTIMAL, VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT)) {
+ GTEST_SKIP() << "Required formats/features not supported";
+ }
+
VkImageCreateInfo image_create_info = LvlInitStruct<VkImageCreateInfo>();
image_create_info.imageType = VK_IMAGE_TYPE_2D;
image_create_info.format = mp_format;
diff --git a/tests/vklayertests_debug_printf.cpp b/tests/vklayertests_debug_printf.cpp
index c085c0736..0ff90b849 100644
--- a/tests/vklayertests_debug_printf.cpp
+++ b/tests/vklayertests_debug_printf.cpp
@@ -1,8 +1,8 @@
/*
- * Copyright (c) 2020-2022 The Khronos Group Inc.
- * Copyright (c) 2020-2022 Valve Corporation
- * Copyright (c) 2020-2022 LunarG, Inc.
- * Copyright (c) 2020-2022 Google, Inc.
+ * Copyright (c) 2020-2023 The Khronos Group Inc.
+ * Copyright (c) 2020-2023 Valve Corporation
+ * Copyright (c) 2020-2023 LunarG, Inc.
+ * Copyright (c) 2020-2023 Google, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -771,7 +771,9 @@ TEST_F(VkDebugPrintfTest, GpuDebugPrintfGPLFragment) {
if (!AreRequiredExtensionsEnabled()) {
GTEST_SKIP() << RequiredExtensionsNotSupported() << " not supported";
}
-
+ if (IsPlatform(kMockICD)) {
+ GTEST_SKIP() << "Test not supported by MockICD, GPU-Assisted validation test requires a driver that can draw";
+ }
auto gpl_features = LvlInitStruct<VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT>();
auto features2 = GetPhysicalDeviceFeatures2(gpl_features);
if (!gpl_features.graphicsPipelineLibrary) {
@@ -923,7 +925,9 @@ TEST_F(VkDebugPrintfTest, GpuDebugPrintfGPLFragmentIndependentSets) {
if (!AreRequiredExtensionsEnabled()) {
GTEST_SKIP() << RequiredExtensionsNotSupported() << " not supported";
}
-
+ if (IsPlatform(kMockICD)) {
+ GTEST_SKIP() << "Test not supported by MockICD, GPU-Assisted validation test requires a driver that can draw";
+ }
auto gpl_features = LvlInitStruct<VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT>();
auto features2 = GetPhysicalDeviceFeatures2(gpl_features);
if (!gpl_features.graphicsPipelineLibrary) {
diff --git a/tests/vklayertests_descriptor_renderpass_framebuffer.cpp b/tests/vklayertests_descriptor_renderpass_framebuffer.cpp
index 0d5a064e3..d06b47b62 100644
--- a/tests/vklayertests_descriptor_renderpass_framebuffer.cpp
+++ b/tests/vklayertests_descriptor_renderpass_framebuffer.cpp
@@ -2308,7 +2308,6 @@ TEST_F(VkLayerTest, RenderPassBeginSampleLocationsInvalidIndicesEXT) {
TEST_F(VkLayerTest, InvalidSampleLocations) {
TEST_DESCRIPTION("Test invalid cases of VK_EXT_sample_location");
- AddRequiredExtensions(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME);
AddRequiredExtensions(VK_EXT_SAMPLE_LOCATIONS_EXTENSION_NAME);
ASSERT_NO_FATAL_FAILURE(InitFramework());
if (!AreRequiredExtensionsEnabled()) {
@@ -2406,6 +2405,10 @@ TEST_F(VkLayerTest, InvalidSampleLocations) {
const uint32_t valid_count =
multisample_prop.maxSampleLocationGridSize.width * multisample_prop.maxSampleLocationGridSize.height * 1;
+ if (valid_count <= 1) {
+ GTEST_SKIP() << "Need a maxSampleLocationGridSize width x height greater than 1";
+ }
+
std::vector<VkSampleLocationEXT> sample_location(valid_count,{0.5, 0.5});
auto sample_locations_info = LvlInitStruct<VkSampleLocationsInfoEXT>();
sample_locations_info.sampleLocationsPerPixel = VK_SAMPLE_COUNT_1_BIT;
diff --git a/tests/vklayertests_dynamic_rendering.cpp b/tests/vklayertests_dynamic_rendering.cpp
index b3a61c5f2..b513ac6e7 100644
--- a/tests/vklayertests_dynamic_rendering.cpp
+++ b/tests/vklayertests_dynamic_rendering.cpp
@@ -1,8 +1,8 @@
/*
* Copyright (c) 2015-2023 The Khronos Group Inc.
- * Copyright (c) 2015-2022 Valve Corporation
+ * Copyright (c) 2015-2023 Valve Corporation
* Copyright (c) 2015-2023 LunarG, Inc.
- * Copyright (c) 2015-2022 Google, Inc.
+ * Copyright (c) 2015-2023 Google, Inc.
* Modifications Copyright (C) 2020-2022 Advanced Micro Devices, Inc. All rights reserved.
* Modifications Copyright (C) 2021-2022 ARM, Inc. All rights reserved.
*
@@ -1892,7 +1892,7 @@ TEST_F(VkLayerTest, DynamicRenderingInfoMismatchedSamples) {
image_ci.extent.depth = 1;
image_ci.mipLevels = 1;
image_ci.arrayLayers = 1;
- image_ci.samples = VK_SAMPLE_COUNT_2_BIT;
+ image_ci.samples = VK_SAMPLE_COUNT_4_BIT;
image_ci.tiling = VK_IMAGE_TILING_OPTIMAL;
image_ci.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
@@ -4020,9 +4020,10 @@ TEST_F(VkLayerTest, DynamicRenderingResolveModeWithIntegerColorFormat) {
image_create_info.extent = {32, 32, 1};
image_create_info.mipLevels = 1;
image_create_info.arrayLayers = 1;
- image_create_info.samples = VK_SAMPLE_COUNT_2_BIT;
+ image_create_info.samples = VK_SAMPLE_COUNT_4_BIT;
image_create_info.tiling = VK_IMAGE_TILING_OPTIMAL;
image_create_info.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
+
VkImageObj image(m_device);
image.Init(image_create_info);
VkImageView image_view = image.targetView(VK_FORMAT_R8G8B8A8_UINT);
@@ -4130,7 +4131,7 @@ TEST_F(VkLayerTest, DynamicRenderingResolveImageViewSamples) {
image_create_info.extent = {32, 32, 1};
image_create_info.mipLevels = 1;
image_create_info.arrayLayers = 1;
- image_create_info.samples = VK_SAMPLE_COUNT_2_BIT;
+ image_create_info.samples = VK_SAMPLE_COUNT_4_BIT;
image_create_info.tiling = VK_IMAGE_TILING_OPTIMAL;
image_create_info.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
@@ -4197,7 +4198,7 @@ TEST_F(VkLayerTest, DynamicRenderingResolveImageViewFormatMatch) {
image_create_info.extent = {32, 32, 1};
image_create_info.mipLevels = 1;
image_create_info.arrayLayers = 1;
- image_create_info.samples = VK_SAMPLE_COUNT_2_BIT;
+ image_create_info.samples = VK_SAMPLE_COUNT_4_BIT;
image_create_info.tiling = VK_IMAGE_TILING_OPTIMAL;
image_create_info.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
@@ -4304,7 +4305,7 @@ TEST_F(VkLayerTest, DynamicRenderingResolveImageViewLayout) {
image_create_info.extent = {32, 32, 1};
image_create_info.mipLevels = 1;
image_create_info.arrayLayers = 1;
- image_create_info.samples = VK_SAMPLE_COUNT_2_BIT;
+ image_create_info.samples = VK_SAMPLE_COUNT_4_BIT;
image_create_info.tiling = VK_IMAGE_TILING_OPTIMAL;
image_create_info.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
@@ -4367,7 +4368,7 @@ TEST_F(VkLayerTest, DynamicRenderingResolveImageViewLayoutSeparateDepthStencil)
image_create_info.extent = {32, 32, 1};
image_create_info.mipLevels = 1;
image_create_info.arrayLayers = 1;
- image_create_info.samples = VK_SAMPLE_COUNT_2_BIT;
+ image_create_info.samples = VK_SAMPLE_COUNT_4_BIT;
image_create_info.tiling = VK_IMAGE_TILING_OPTIMAL;
image_create_info.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
@@ -4493,7 +4494,7 @@ TEST_F(VkLayerTest, DynamicRenderingResolveImageViewShadingRateLayout) {
image_create_info.extent = {32, 32, 1};
image_create_info.mipLevels = 1;
image_create_info.arrayLayers = 1;
- image_create_info.samples = VK_SAMPLE_COUNT_2_BIT;
+ image_create_info.samples = VK_SAMPLE_COUNT_4_BIT;
image_create_info.tiling = VK_IMAGE_TILING_OPTIMAL;
image_create_info.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
@@ -4605,7 +4606,7 @@ TEST_F(VkLayerTest, DynamicRenderingResolveImageViewFragmentDensityLayout) {
image_create_info.extent = {32, 32, 4};
image_create_info.mipLevels = 1;
image_create_info.arrayLayers = 1;
- image_create_info.samples = VK_SAMPLE_COUNT_2_BIT;
+ image_create_info.samples = VK_SAMPLE_COUNT_4_BIT;
image_create_info.tiling = VK_IMAGE_TILING_OPTIMAL;
image_create_info.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
@@ -4667,7 +4668,7 @@ TEST_F(VkLayerTest, DynamicRenderingResolveImageViewReadOnlyOptimalLayout) {
image_create_info.extent = {32, 32, 1};
image_create_info.mipLevels = 1;
image_create_info.arrayLayers = 1;
- image_create_info.samples = VK_SAMPLE_COUNT_2_BIT;
+ image_create_info.samples = VK_SAMPLE_COUNT_4_BIT;
image_create_info.tiling = VK_IMAGE_TILING_OPTIMAL;
image_create_info.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
@@ -4799,10 +4800,11 @@ TEST_F(VkLayerTest, DynamicRenderingRenderingInfoColorAttachment) {
image_create_info.extent = {32, 32, 1};
image_create_info.mipLevels = 1;
image_create_info.arrayLayers = 1;
- image_create_info.samples = VK_SAMPLE_COUNT_2_BIT;
+ image_create_info.samples = VK_SAMPLE_COUNT_4_BIT;
image_create_info.tiling = VK_IMAGE_TILING_OPTIMAL;
image_create_info.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
image_create_info.sharingMode = VK_SHARING_MODE_EXCLUSIVE;
+
VkImageObj image(m_device);
image.Init(image_create_info);
VkImageView image_view = image.targetView(VK_FORMAT_R8G8B8A8_UNORM);
@@ -4917,6 +4919,8 @@ TEST_F(VkLayerTest, DynamicRenderingRenderingInfoDepthAttachment) {
(depth_stencil_resolve_properties.supportedDepthResolveModes & VK_RESOLVE_MODE_AVERAGE_BIT) != 0;
bool has_stencil_resolve_mode_average =
(depth_stencil_resolve_properties.supportedStencilResolveModes & VK_RESOLVE_MODE_AVERAGE_BIT) != 0;
+ bool has_stencil_resolve_mode_zero =
+ (depth_stencil_resolve_properties.supportedStencilResolveModes & VK_RESOLVE_MODE_SAMPLE_ZERO_BIT) != 0;
VkImageCreateInfo image_create_info = LvlInitStruct<VkImageCreateInfo>();
image_create_info.imageType = VK_IMAGE_TYPE_2D;
@@ -4924,9 +4928,10 @@ TEST_F(VkLayerTest, DynamicRenderingRenderingInfoDepthAttachment) {
image_create_info.extent = {32, 32, 1};
image_create_info.mipLevels = 1;
image_create_info.arrayLayers = 1;
- image_create_info.samples = VK_SAMPLE_COUNT_2_BIT;
+ image_create_info.samples = VK_SAMPLE_COUNT_4_BIT;
image_create_info.tiling = VK_IMAGE_TILING_OPTIMAL;
image_create_info.usage = VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
+
VkImageObj image(m_device);
image.Init(image_create_info);
@@ -5026,18 +5031,24 @@ TEST_F(VkLayerTest, DynamicRenderingRenderingInfoDepthAttachment) {
stencil_attachment.imageLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
depth_attachment.resolveImageLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
stencil_attachment.resolveImageLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
- depth_attachment.resolveMode = VK_RESOLVE_MODE_AVERAGE_BIT;
if (depth_stencil_resolve_properties.independentResolveNone == VK_FALSE && has_depth_resolve_mode_average) {
+ depth_attachment.resolveMode = VK_RESOLVE_MODE_AVERAGE_BIT;
+ stencil_attachment.resolveMode = VK_RESOLVE_MODE_NONE;
m_errorMonitor->SetDesiredFailureMsg(kErrorBit, "VUID-VkRenderingInfo-pDepthAttachment-06104");
m_commandBuffer->BeginRendering(begin_rendering_info);
m_errorMonitor->VerifyFound();
}
- if (depth_stencil_resolve_properties.independentResolve == VK_FALSE && has_depth_resolve_mode_average) {
+ if (depth_stencil_resolve_properties.independentResolve == VK_FALSE && has_depth_resolve_mode_average &&
+ has_stencil_resolve_mode_zero) {
+ depth_attachment.resolveMode = VK_RESOLVE_MODE_AVERAGE_BIT;
+ stencil_attachment.resolveMode = VK_RESOLVE_MODE_SAMPLE_ZERO_BIT;
+ m_errorMonitor->SetUnexpectedError("VUID-VkRenderingInfo-pDepthAttachment-06104"); // if independentResolveNone is false
m_errorMonitor->SetDesiredFailureMsg(kErrorBit, "VUID-VkRenderingInfo-pDepthAttachment-06105");
m_commandBuffer->BeginRendering(begin_rendering_info);
m_errorMonitor->VerifyFound();
}
+ depth_attachment.resolveMode = VK_RESOLVE_MODE_AVERAGE_BIT;
stencil_attachment.resolveMode = VK_RESOLVE_MODE_AVERAGE_BIT;
stencil_attachment.resolveImageLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
if (has_stencil_resolve_mode_average) {
@@ -6564,6 +6575,8 @@ TEST_F(VkLayerTest, DynamicRenderingCommandBufferInheritanceWithInvalidDepthForm
auto features2 = GetPhysicalDeviceFeatures2(dynamic_rendering_features);
if (!dynamic_rendering_features.dynamicRendering) {
GTEST_SKIP() << "Test requires (unsupported) dynamicRendering";
+ } else if (!features2.features.variableMultisampleRate) {
+ GTEST_SKIP() << "Test requires (unsupported) variableMultisampleRate";
}
ASSERT_NO_FATAL_FAILURE(InitState(nullptr, &features2));
diff --git a/tests/vklayertests_others.cpp b/tests/vklayertests_others.cpp
index a038f9e14..adba22cc0 100644
--- a/tests/vklayertests_others.cpp
+++ b/tests/vklayertests_others.cpp
@@ -7433,6 +7433,9 @@ TEST_F(VkLayerTest, ValidateImportMemoryHandleType) {
if (!AreRequiredExtensionsEnabled()) {
GTEST_SKIP() << RequiredExtensionsNotSupported() << " not supported";
}
+ if (IsPlatform(kMockICD)) {
+ GTEST_SKIP() << "External tests are not supported by MockICD, skipping tests";
+ }
auto vkGetPhysicalDeviceExternalBufferPropertiesKHR = reinterpret_cast<PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHR>(
vk::GetInstanceProcAddr(instance(), "vkGetPhysicalDeviceExternalBufferPropertiesKHR"));
diff --git a/tests/vklayertests_pipeline_shader.cpp b/tests/vklayertests_pipeline_shader.cpp
index 02ebf679a..fd67ef691 100644
--- a/tests/vklayertests_pipeline_shader.cpp
+++ b/tests/vklayertests_pipeline_shader.cpp
@@ -4048,29 +4048,18 @@ TEST_F(VkLayerTest, VUID_VkVertexInputAttributeDescription_binding_00621) {
"VUID-VkPipelineVertexInputStateCreateInfo-binding-00615"});
}
-TEST_F(VkLayerTest, VUID_VkVertexInputAttributeDescription_offset_00622) {
+TEST_F(VkLayerTest, VertexInputAttributeDescriptionOffset) {
TEST_DESCRIPTION(
"Test VUID-VkVertexInputAttributeDescription-offset-00622: offset must be less than or equal to "
"VkPhysicalDeviceLimits::maxVertexInputAttributeOffset");
ASSERT_NO_FATAL_FAILURE(InitFramework(m_errorMonitor));
- uint32_t maxVertexInputAttributeOffset = 0;
- {
- VkPhysicalDeviceProperties device_props = {};
- vk::GetPhysicalDeviceProperties(gpu(), &device_props);
- maxVertexInputAttributeOffset = device_props.limits.maxVertexInputAttributeOffset;
- if (maxVertexInputAttributeOffset == 0xFFFFFFFF) {
- // Attempt to artificially lower maximum offset
- PFN_vkSetPhysicalDeviceLimitsEXT fpvkSetPhysicalDeviceLimitsEXT =
- (PFN_vkSetPhysicalDeviceLimitsEXT)vk::GetInstanceProcAddr(instance(), "vkSetPhysicalDeviceLimitsEXT");
- if (!fpvkSetPhysicalDeviceLimitsEXT) {
- GTEST_SKIP() << "All offsets are valid & device_profile_api not found";
- }
- device_props.limits.maxVertexInputAttributeOffset = device_props.limits.maxVertexInputBindingStride - 2;
- fpvkSetPhysicalDeviceLimitsEXT(gpu(), &device_props.limits);
- maxVertexInputAttributeOffset = device_props.limits.maxVertexInputAttributeOffset;
- }
+ VkPhysicalDeviceProperties device_props = {};
+ vk::GetPhysicalDeviceProperties(gpu(), &device_props);
+ const uint32_t maxVertexInputAttributeOffset = device_props.limits.maxVertexInputAttributeOffset;
+ if (maxVertexInputAttributeOffset == 0xFFFFFFFF) {
+ GTEST_SKIP() << "maxVertexInputAttributeOffset is max<uint32_t> already";
}
ASSERT_NO_FATAL_FAILURE(InitState());
ASSERT_NO_FATAL_FAILURE(InitRenderTarget());
@@ -4083,7 +4072,6 @@ TEST_F(VkLayerTest, VUID_VkVertexInputAttributeDescription_offset_00622) {
VkVertexInputAttributeDescription vertex_input_attribute_description{};
vertex_input_attribute_description.format = VK_FORMAT_R8_UNORM;
vertex_input_attribute_description.offset = maxVertexInputAttributeOffset + 1;
-
const auto set_attribute = [&](CreatePipelineHelper &helper) {
helper.vi_ci_.pVertexBindingDescriptions = &vertex_input_binding_description;
helper.vi_ci_.vertexBindingDescriptionCount = 1;