aboutsummaryrefslogtreecommitdiff
path: root/layers/parameter_validation.cpp
diff options
context:
space:
mode:
authorMark Lobodzinski <mark@lunarg.com>2017-06-20 08:43:57 -0600
committerMark Lobodzinski <mark@lunarg.com>2017-06-20 14:07:18 -0600
commit725021525a7f228e45633190d5aebd4f938afefd (patch)
treebb738ae0e5b6aa32fcb199c0e8644842f237bc4b /layers/parameter_validation.cpp
parenta2504416d9dea0540389130008d06f9bd1d1d308 (diff)
downloadusermoji-725021525a7f228e45633190d5aebd4f938afefd.tar.xz
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
Diffstat (limited to 'layers/parameter_validation.cpp')
-rw-r--r--layers/parameter_validation.cpp14
1 files changed, 14 insertions, 0 deletions
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) {