layers: Refactor GetDescSetLayoutSupport OT calls
diff --git a/layers/object_tracker_utils.cpp b/layers/object_tracker_utils.cpp
index 4cfb935..63d968c 100644
--- a/layers/object_tracker_utils.cpp
+++ b/layers/object_tracker_utils.cpp
@@ -913,6 +913,22 @@
return result;
}
+static inline bool ValidateSamplerObjects(VkDevice device, const VkDescriptorSetLayoutCreateInfo *pCreateInfo) {
+ bool skip = false;
+ if (pCreateInfo->pBindings) {
+ for (uint32_t index1 = 0; index1 < pCreateInfo->bindingCount; ++index1) {
+ for (uint32_t index2 = 0; index2 < pCreateInfo->pBindings[index1].descriptorCount; ++index2) {
+ if (pCreateInfo->pBindings[index1].pImmutableSamplers) {
+ skip |=
+ ValidateObject(device, pCreateInfo->pBindings[index1].pImmutableSamplers[index2], kVulkanObjectTypeSampler,
+ true, "VUID-VkDescriptorSetLayoutBinding-descriptorType-00282", kVUIDUndefined);
+ }
+ }
+ }
+ }
+ return skip;
+}
+
VKAPI_ATTR void VKAPI_CALL GetDescriptorSetLayoutSupport(VkDevice device, const VkDescriptorSetLayoutCreateInfo *pCreateInfo,
VkDescriptorSetLayoutSupport *pSupport) {
bool skip = false;
@@ -921,17 +937,7 @@
skip |= ValidateObject(device, device, kVulkanObjectTypeDevice, false,
"VUID-vkGetDescriptorSetLayoutSupport-device-parameter", kVUIDUndefined);
if (pCreateInfo) {
- if (pCreateInfo->pBindings) {
- for (uint32_t index1 = 0; index1 < pCreateInfo->bindingCount; ++index1) {
- for (uint32_t index2 = 0; index2 < pCreateInfo->pBindings[index1].descriptorCount; ++index2) {
- if (pCreateInfo->pBindings[index1].pImmutableSamplers) {
- skip |= ValidateObject(device, pCreateInfo->pBindings[index1].pImmutableSamplers[index2],
- kVulkanObjectTypeSampler, true,
- "VUID-VkDescriptorSetLayoutBinding-descriptorType-00282", kVUIDUndefined);
- }
- }
- }
- }
+ skip |= ValidateSamplerObjects(device, pCreateInfo);
}
}
if (skip) return;
@@ -947,17 +953,7 @@
skip |= ValidateObject(device, device, kVulkanObjectTypeDevice, false,
"VUID-vkGetDescriptorSetLayoutSupportKHR-device-parameter", kVUIDUndefined);
if (pCreateInfo) {
- if (pCreateInfo->pBindings) {
- for (uint32_t index1 = 0; index1 < pCreateInfo->bindingCount; ++index1) {
- for (uint32_t index2 = 0; index2 < pCreateInfo->pBindings[index1].descriptorCount; ++index2) {
- if (pCreateInfo->pBindings[index1].pImmutableSamplers) {
- skip |= ValidateObject(device, pCreateInfo->pBindings[index1].pImmutableSamplers[index2],
- kVulkanObjectTypeSampler, true,
- "VUID-VkDescriptorSetLayoutBinding-descriptorType-00282", kVUIDUndefined);
- }
- }
- }
- }
+ skip |= ValidateSamplerObjects(device, pCreateInfo);
}
}
if (skip) return;