diff options
author | ByumjinConffx <byumjin@conffx.com> | 2019-08-14 15:27:34 -0700 |
---|---|---|
committer | Mark Lobodzinski <mark@lunarg.com> | 2019-08-20 12:18:41 -0600 |
commit | 7115c8dc5ab770be76636c9936197646c61e6654 (patch) | |
tree | d78afd45ea423e6eaa4383b0bcae22e403066d51 | |
parent | 991b606e31ccf258534a1e9231d15b2da5a6a142 (diff) | |
download | vulkan-validation-layers-7115c8dc5ab770be76636c9936197646c61e6654.tar.gz |
tests: Check fragment density map image limits violation
Add test codes to check fragment density map image
limits violation. Test CreateImageMaxLimitsViolation
is needed to check that the current device supports
VK_KHR_get_physical_device_properties2.
-rw-r--r-- | tests/vklayertests_buffer_image_memory_sampler.cpp | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/tests/vklayertests_buffer_image_memory_sampler.cpp b/tests/vklayertests_buffer_image_memory_sampler.cpp index 2f4130d03..b8e7817df 100644 --- a/tests/vklayertests_buffer_image_memory_sampler.cpp +++ b/tests/vklayertests_buffer_image_memory_sampler.cpp @@ -6058,7 +6058,23 @@ TEST_F(VkLayerTest, CreateImageMinLimitsViolation) { TEST_F(VkLayerTest, CreateImageMaxLimitsViolation) { TEST_DESCRIPTION("Create invalid image with invalid parameters exceeding physical device limits."); - ASSERT_NO_FATAL_FAILURE(Init()); + // Check for VK_KHR_get_physical_device_properties2 + bool push_physical_device_properties_2_support = + InstanceExtensionSupported(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); + if (push_physical_device_properties_2_support) { + m_instance_extension_names.push_back(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); + } + + ASSERT_NO_FATAL_FAILURE(InitFramework(myDbgFunc, m_errorMonitor)); + + bool push_fragment_density_support = false; + + if (push_physical_device_properties_2_support) { + push_fragment_density_support = DeviceExtensionSupported(gpu(), nullptr, VK_EXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME); + if (push_fragment_density_support) m_device_extension_names.push_back(VK_EXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME); + } + + ASSERT_NO_FATAL_FAILURE(InitState(nullptr, nullptr, 0)); VkImageCreateInfo tmp_img_ci = {}; tmp_img_ci.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO; @@ -6151,6 +6167,23 @@ TEST_F(VkLayerTest, CreateImageMaxLimitsViolation) { printf("%s VkPhysicalDeviceLimits::maxFramebufferHeight is already UINT32_MAX; skipping part of test.\n", kSkipPrefix); } } + + { + if (!push_fragment_density_support) { + printf("%s VK_EXT_fragment_density_map Extension not supported, skipping tests\n", kSkipPrefix); + } else { + VkImageCreateInfo image_ci = safe_image_ci; + image_ci.usage = VK_IMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT; + VkImageFormatProperties img_limits; + ASSERT_VK_SUCCESS(GPDIFPHelper(gpu(), &image_ci, &img_limits)); + + image_ci.extent = {dev_limits.maxFramebufferWidth + 1, 64, 1}; + CreateImageTest(*this, &image_ci, "VUID-VkImageCreateInfo-usage-02559"); + + image_ci.extent = {64, dev_limits.maxFramebufferHeight + 1, 1}; + CreateImageTest(*this, &image_ci, "VUID-VkImageCreateInfo-usage-02560"); + } + } } TEST_F(VkLayerTest, MultiplaneImageSamplerConversionMismatch) { |