From 725021525a7f228e45633190d5aebd4f938afefd Mon Sep 17 00:00:00 2001 From: Mark Lobodzinski Date: Tue, 20 Jun 2017 08:43:57 -0600 Subject: layers: GH1889, check for CLAMP_TO_EDGE ext enable Using this addressing mode in CreateSampler should generate an error if the extension is not enabled. Also added layer validation test for this check and updated the error database. Change-Id: If0a434976aa4bb30ab23ff6babb95df3af7a4efd --- layers/parameter_validation.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'layers/parameter_validation.cpp') diff --git a/layers/parameter_validation.cpp b/layers/parameter_validation.cpp index e75b7364..ee33ef8d 100644 --- a/layers/parameter_validation.cpp +++ b/layers/parameter_validation.cpp @@ -2471,6 +2471,20 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateSampler(VkDevice device, const VkSamplerCre skip |= validate_ranged_enum(report_data, "vkCreateSampler", "pCreateInfo->borderColor", "VkBorderColor", VK_BORDER_COLOR_BEGIN_RANGE, VK_BORDER_COLOR_END_RANGE, pCreateInfo->borderColor); } + + // If any of addressModeU, addressModeV or addressModeW are VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE, the + // VK_KHR_sampler_mirror_clamp_to_edge extension must be enabled + if (!device_data->extensions.vk_khr_sampler_mirror_clamp_to_edge && + ((pCreateInfo->addressModeU == VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE) || + (pCreateInfo->addressModeV == VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE) || + (pCreateInfo->addressModeW == VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE))) { + skip |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, + VALIDATION_ERROR_1260086e, LayerName, + "vkCreateSampler(): A VkSamplerAddressMode value is set to VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE " + "but the VK_KHR_sampler_mirror_clamp_to_edge extension has not been enabled. %s", + validation_error_map[VALIDATION_ERROR_1260086e]); + } } if (!skip) { -- cgit v1.2.3