corechecks: Remove GetDeviceExtensions helper
Change-Id: Iee2dd338d831972583e074f07f3a42fd39282b88
diff --git a/layers/buffer_validation.cpp b/layers/buffer_validation.cpp
index 53fcae3..04baa64 100644
--- a/layers/buffer_validation.cpp
+++ b/layers/buffer_validation.cpp
@@ -145,7 +145,7 @@
SetLayout(pObject, imgpair, layout, VK_IMAGE_ASPECT_DEPTH_BIT);
SetLayout(pObject, imgpair, layout, VK_IMAGE_ASPECT_STENCIL_BIT);
SetLayout(pObject, imgpair, layout, VK_IMAGE_ASPECT_METADATA_BIT);
- if (GetDeviceExtensions()->vk_khr_sampler_ycbcr_conversion) {
+ if (device_extensions.vk_khr_sampler_ycbcr_conversion) {
SetLayout(pObject, imgpair, layout, VK_IMAGE_ASPECT_PLANE_0_BIT_KHR);
SetLayout(pObject, imgpair, layout, VK_IMAGE_ASPECT_PLANE_1_BIT_KHR);
SetLayout(pObject, imgpair, layout, VK_IMAGE_ASPECT_PLANE_2_BIT_KHR);
@@ -199,7 +199,7 @@
FindLayoutVerifyLayout(imgpair, layout, VK_IMAGE_ASPECT_DEPTH_BIT);
FindLayoutVerifyLayout(imgpair, layout, VK_IMAGE_ASPECT_STENCIL_BIT);
FindLayoutVerifyLayout(imgpair, layout, VK_IMAGE_ASPECT_METADATA_BIT);
- if (GetDeviceExtensions()->vk_khr_sampler_ycbcr_conversion) {
+ if (device_extensions.vk_khr_sampler_ycbcr_conversion) {
FindLayoutVerifyLayout(imgpair, layout, VK_IMAGE_ASPECT_PLANE_0_BIT_KHR);
FindLayoutVerifyLayout(imgpair, layout, VK_IMAGE_ASPECT_PLANE_1_BIT_KHR);
FindLayoutVerifyLayout(imgpair, layout, VK_IMAGE_ASPECT_PLANE_2_BIT_KHR);
@@ -255,7 +255,7 @@
FindLayout(imageLayoutMap, imgpair, layout, VK_IMAGE_ASPECT_DEPTH_BIT);
FindLayout(imageLayoutMap, imgpair, layout, VK_IMAGE_ASPECT_STENCIL_BIT);
FindLayout(imageLayoutMap, imgpair, layout, VK_IMAGE_ASPECT_METADATA_BIT);
- if (GetDeviceExtensions()->vk_khr_sampler_ycbcr_conversion) {
+ if (device_extensions.vk_khr_sampler_ycbcr_conversion) {
FindLayout(imageLayoutMap, imgpair, layout, VK_IMAGE_ASPECT_PLANE_0_BIT_KHR);
FindLayout(imageLayoutMap, imgpair, layout, VK_IMAGE_ASPECT_PLANE_1_BIT_KHR);
FindLayout(imageLayoutMap, imgpair, layout, VK_IMAGE_ASPECT_PLANE_2_BIT_KHR);
@@ -409,7 +409,7 @@
report_data->FormatHandle(framebuffer).c_str(), report_data->FormatHandle(image_view).c_str());
}
- if (GetDeviceExtensions()->vk_khr_maintenance2) {
+ if (device_extensions.vk_khr_maintenance2) {
if ((layout == VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL ||
layout == VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL ||
layout == VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL ||
@@ -1088,7 +1088,7 @@
"%s: For optimal performance image %s layout should be %s instead of GENERAL.", caller,
report_data->FormatHandle(image).c_str(), string_VkImageLayout(optimal_layout));
}
- } else if (GetDeviceExtensions()->vk_khr_shared_presentable_image) {
+ } else if (device_extensions.vk_khr_shared_presentable_image) {
if (image_state->shared_presentable) {
if (VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR != explicit_layout) {
skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
@@ -1306,7 +1306,7 @@
const VkAllocationCallbacks *pAllocator, VkImage *pImage) {
bool skip = false;
- if (GetDeviceExtensions()->vk_android_external_memory_android_hardware_buffer) {
+ if (device_extensions.vk_android_external_memory_android_hardware_buffer) {
skip |= ValidateCreateImageANDROID(report_data, pCreateInfo);
} else { // These checks are omitted or replaced when Android HW Buffer extension is active
if (pCreateInfo->format == VK_FORMAT_UNDEFINED) {
@@ -1380,8 +1380,8 @@
pCreateInfo->arrayLayers, format_limits.maxArrayLayers);
}
- if (GetDeviceExtensions()->vk_khr_sampler_ycbcr_conversion && FormatRequiresYcbcrConversion(pCreateInfo->format) &&
- !GetDeviceExtensions()->vk_ext_ycbcr_image_arrays && pCreateInfo->arrayLayers > 1) {
+ if (device_extensions.vk_khr_sampler_ycbcr_conversion && FormatRequiresYcbcrConversion(pCreateInfo->format) &&
+ !device_extensions.vk_ext_ycbcr_image_arrays && pCreateInfo->arrayLayers > 1) {
skip |= log_msg(
report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, 0,
"VUID-VkImageCreateInfo-format-02653",
@@ -1404,7 +1404,7 @@
"VK_IMAGE_CREATE_SPARSE_ALIASED_BIT set.");
}
- if (GetDeviceExtensions()->vk_khr_maintenance2) {
+ if (device_extensions.vk_khr_maintenance2) {
if (pCreateInfo->flags & VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT_KHR) {
if (!(FormatIsCompressed_BC(pCreateInfo->format) || FormatIsCompressed_ASTC_LDR(pCreateInfo->format) ||
FormatIsCompressed_ETC2_EAC(pCreateInfo->format))) {
@@ -1441,7 +1441,7 @@
image_state.layout = pCreateInfo->initialLayout;
image_state.format = pCreateInfo->format;
IMAGE_STATE *is_node = new IMAGE_STATE(*pImage, pCreateInfo);
- if (GetDeviceExtensions()->vk_android_external_memory_android_hardware_buffer) {
+ if (device_extensions.vk_android_external_memory_android_hardware_buffer) {
RecordCreateImageANDROID(pCreateInfo, is_node);
}
imageMap.insert(std::make_pair(*pImage, std::unique_ptr<IMAGE_STATE>(is_node)));
@@ -1545,7 +1545,7 @@
"%s: Layout for cleared image should be TRANSFER_DST_OPTIMAL instead of GENERAL.", func_name);
}
} else if (VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR == dest_image_layout) {
- if (!GetDeviceExtensions()->vk_khr_shared_presentable_image) {
+ if (!device_extensions.vk_khr_shared_presentable_image) {
// TODO: Add unique error id when available.
skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT,
HandleToUint64(image_state->image), 0,
@@ -1617,7 +1617,7 @@
skip |= ValidateCmdQueueFlags(cb_node, "vkCmdClearColorImage()", VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT,
"VUID-vkCmdClearColorImage-commandBuffer-cmdpool");
skip |= ValidateCmd(cb_node, CMD_CLEARCOLORIMAGE, "vkCmdClearColorImage()");
- if (GetApiVersion() >= VK_API_VERSION_1_1 || GetDeviceExtensions()->vk_khr_maintenance1) {
+ if (GetApiVersion() >= VK_API_VERSION_1_1 || device_extensions.vk_khr_maintenance1) {
skip |=
ValidateImageFormatFeatureFlags(image_state, VK_FORMAT_FEATURE_TRANSFER_DST_BIT, "vkCmdClearColorImage",
"VUID-vkCmdClearColorImage-image-01993", "VUID-vkCmdClearColorImage-image-01993");
@@ -1660,7 +1660,7 @@
skip |= ValidateCmdQueueFlags(cb_node, "vkCmdClearDepthStencilImage()", VK_QUEUE_GRAPHICS_BIT,
"VUID-vkCmdClearDepthStencilImage-commandBuffer-cmdpool");
skip |= ValidateCmd(cb_node, CMD_CLEARDEPTHSTENCILIMAGE, "vkCmdClearDepthStencilImage()");
- if (GetApiVersion() >= VK_API_VERSION_1_1 || GetDeviceExtensions()->vk_khr_maintenance1) {
+ if (GetApiVersion() >= VK_API_VERSION_1_1 || device_extensions.vk_khr_maintenance1) {
skip |= ValidateImageFormatFeatureFlags(image_state, VK_FORMAT_FEATURE_TRANSFER_DST_BIT, "vkCmdClearDepthStencilImage",
"VUID-vkCmdClearDepthStencilImage-image-01994",
"VUID-vkCmdClearDepthStencilImage-image-01994");
@@ -2089,7 +2089,7 @@
region.srcOffset.z);
}
- if (GetDeviceExtensions()->vk_khr_maintenance1) {
+ if (device_extensions.vk_khr_maintenance1) {
if (src_state->createInfo.imageType == VK_IMAGE_TYPE_3D) {
if ((0 != region.srcSubresource.baseArrayLayer) || (1 != region.srcSubresource.layerCount)) {
skip |=
@@ -2114,7 +2114,7 @@
}
// Source checks that apply only to compressed images (or to _422 images if ycbcr enabled)
- bool ext_ycbcr = GetDeviceExtensions()->vk_khr_sampler_ycbcr_conversion;
+ bool ext_ycbcr = device_extensions.vk_khr_sampler_ycbcr_conversion;
if (FormatIsCompressed(src_state->createInfo.format) ||
(ext_ycbcr && FormatIsSinglePlane_422(src_state->createInfo.format))) {
const VkExtent3D block_size = FormatTexelBlockExtent(src_state->createInfo.format);
@@ -2206,7 +2206,7 @@
}
}
// VU01199 changed with mnt1
- if (GetDeviceExtensions()->vk_khr_maintenance1) {
+ if (device_extensions.vk_khr_maintenance1) {
if (dst_state->createInfo.imageType == VK_IMAGE_TYPE_3D) {
if ((0 != region.dstSubresource.baseArrayLayer) || (1 != region.dstSubresource.layerCount)) {
skip |=
@@ -2405,7 +2405,7 @@
region.dstSubresource.layerCount, i, "vkCmdCopyImage", "dstSubresource",
"VUID-vkCmdCopyImage-dstSubresource-01699");
- if (GetDeviceExtensions()->vk_khr_maintenance1) {
+ if (device_extensions.vk_khr_maintenance1) {
// No chance of mismatch if we're overriding depth slice count
if (!slice_override) {
// The number of depth slices in srcSubresource and dstSubresource must match
@@ -2436,11 +2436,11 @@
}
// Do multiplane-specific checks, if extension enabled
- if (GetDeviceExtensions()->vk_khr_sampler_ycbcr_conversion) {
+ if (device_extensions.vk_khr_sampler_ycbcr_conversion) {
skip |= CopyImageMultiplaneValidation(command_buffer, src_image_state, dst_image_state, region);
}
- if (!GetDeviceExtensions()->vk_khr_sampler_ycbcr_conversion) {
+ if (!device_extensions.vk_khr_sampler_ycbcr_conversion) {
// not multi-plane, the aspectMask member of srcSubresource and dstSubresource must match
if (region.srcSubresource.aspectMask != region.dstSubresource.aspectMask) {
char const str[] = "vkCmdCopyImage(): Src and dest aspectMasks for each region must match";
@@ -2597,7 +2597,7 @@
"vkCmdCopyImage()", "VK_IMAGE_USAGE_TRANSFER_SRC_BIT");
skip |= ValidateImageUsageFlags(dst_image_state, VK_IMAGE_USAGE_TRANSFER_DST_BIT, true, "VUID-vkCmdCopyImage-dstImage-00131",
"vkCmdCopyImage()", "VK_IMAGE_USAGE_TRANSFER_DST_BIT");
- if (GetApiVersion() >= VK_API_VERSION_1_1 || GetDeviceExtensions()->vk_khr_maintenance1) {
+ if (GetApiVersion() >= VK_API_VERSION_1_1 || device_extensions.vk_khr_maintenance1) {
skip |= ValidateImageFormatFeatureFlags(src_image_state, VK_FORMAT_FEATURE_TRANSFER_SRC_BIT, "vkCmdCopyImage()",
"VUID-vkCmdCopyImage-srcImage-01995", "VUID-vkCmdCopyImage-srcImage-01995");
skip |= ValidateImageFormatFeatureFlags(dst_image_state, VK_FORMAT_FEATURE_TRANSFER_DST_BIT, "vkCmdCopyImage()",
@@ -2608,14 +2608,12 @@
skip |= ValidateCmd(cb_node, CMD_COPYIMAGE, "vkCmdCopyImage()");
skip |= InsideRenderPass(cb_node, "vkCmdCopyImage()", "VUID-vkCmdCopyImage-renderpass");
bool hit_error = false;
- const char *invalid_src_layout_vuid =
- (src_image_state->shared_presentable && GetDeviceExtensions()->vk_khr_shared_presentable_image)
- ? "VUID-vkCmdCopyImage-srcImageLayout-01917"
- : "VUID-vkCmdCopyImage-srcImageLayout-00129";
- const char *invalid_dst_layout_vuid =
- (dst_image_state->shared_presentable && GetDeviceExtensions()->vk_khr_shared_presentable_image)
- ? "VUID-vkCmdCopyImage-dstImageLayout-01395"
- : "VUID-vkCmdCopyImage-dstImageLayout-00134";
+ const char *invalid_src_layout_vuid = (src_image_state->shared_presentable && device_extensions.vk_khr_shared_presentable_image)
+ ? "VUID-vkCmdCopyImage-srcImageLayout-01917"
+ : "VUID-vkCmdCopyImage-srcImageLayout-00129";
+ const char *invalid_dst_layout_vuid = (dst_image_state->shared_presentable && device_extensions.vk_khr_shared_presentable_image)
+ ? "VUID-vkCmdCopyImage-dstImageLayout-01395"
+ : "VUID-vkCmdCopyImage-dstImageLayout-00134";
for (uint32_t i = 0; i < regionCount; ++i) {
skip |= VerifyImageLayout(cb_node, src_image_state, pRegions[i].srcSubresource, srcImageLayout,
VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, "vkCmdCopyImage()", invalid_src_layout_vuid,
@@ -2837,11 +2835,11 @@
bool hit_error = false;
const char *invalid_src_layout_vuid =
- (src_image_state->shared_presentable && GetDeviceExtensions()->vk_khr_shared_presentable_image)
+ (src_image_state->shared_presentable && device_extensions.vk_khr_shared_presentable_image)
? "VUID-vkCmdResolveImage-srcImageLayout-01400"
: "VUID-vkCmdResolveImage-srcImageLayout-00261";
const char *invalid_dst_layout_vuid =
- (dst_image_state->shared_presentable && GetDeviceExtensions()->vk_khr_shared_presentable_image)
+ (dst_image_state->shared_presentable && device_extensions.vk_khr_shared_presentable_image)
? "VUID-vkCmdResolveImage-dstImageLayout-01401"
: "VUID-vkCmdResolveImage-dstImageLayout-00263";
// For each region, the number of layers in the image subresource should not be zero
@@ -3031,11 +3029,11 @@
// Do per-region checks
const char *invalid_src_layout_vuid =
- (src_image_state->shared_presentable && GetDeviceExtensions()->vk_khr_shared_presentable_image)
+ (src_image_state->shared_presentable && device_extensions.vk_khr_shared_presentable_image)
? "VUID-vkCmdBlitImage-srcImageLayout-01398"
: "VUID-vkCmdBlitImage-srcImageLayout-00222";
const char *invalid_dst_layout_vuid =
- (dst_image_state->shared_presentable && GetDeviceExtensions()->vk_khr_shared_presentable_image)
+ (dst_image_state->shared_presentable && device_extensions.vk_khr_shared_presentable_image)
? "VUID-vkCmdBlitImage-dstImageLayout-01399"
: "VUID-vkCmdBlitImage-dstImageLayout-00227";
for (uint32_t i = 0; i < regionCount; i++) {
@@ -3440,7 +3438,7 @@
case VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL_KHR:
case VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL_KHR:
- if (GetDeviceExtensions()->vk_khr_maintenance2) {
+ if (device_extensions.vk_khr_maintenance2) {
break;
} else {
// Intentionally fall through to generic error message
@@ -3556,7 +3554,7 @@
case VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL_KHR:
case VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL_KHR:
- if (GetDeviceExtensions()->vk_khr_maintenance2) {
+ if (device_extensions.vk_khr_maintenance2) {
break;
} else {
// Intentionally fall through to generic error message
@@ -4018,7 +4016,7 @@
bool CoreChecks::ValidateCreateImageViewSubresourceRange(const IMAGE_STATE *image_state, bool is_imageview_2d_type,
const VkImageSubresourceRange &subresourceRange) {
- bool is_khr_maintenance1 = GetDeviceExtensions()->vk_khr_maintenance1;
+ bool is_khr_maintenance1 = device_extensions.vk_khr_maintenance1;
bool is_image_slicable = image_state->createInfo.imageType == VK_IMAGE_TYPE_3D &&
(image_state->createInfo.flags & VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR);
bool is_3D_to_2D_map = is_khr_maintenance1 && is_image_slicable && is_imageview_2d_type;
@@ -4146,7 +4144,7 @@
ss.str().c_str());
}
} else {
- if ((!GetDeviceExtensions()->vk_khr_maintenance2 ||
+ if ((!device_extensions.vk_khr_maintenance2 ||
!(image_flags & VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT_KHR))) {
// Format MUST be compatible (in the same format compatibility class) as the format the image was created with
if (FormatCompatibilityClass(image_format) != FormatCompatibilityClass(view_format)) {
@@ -4204,7 +4202,7 @@
}
break;
case VK_IMAGE_TYPE_3D:
- if (GetDeviceExtensions()->vk_khr_maintenance1) {
+ if (device_extensions.vk_khr_maintenance1) {
if (view_type != VK_IMAGE_VIEW_TYPE_3D) {
if ((view_type == VK_IMAGE_VIEW_TYPE_2D || view_type == VK_IMAGE_VIEW_TYPE_2D_ARRAY)) {
if (!(image_flags & VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR)) {
@@ -4244,7 +4242,7 @@
}
// External format checks needed when VK_ANDROID_external_memory_android_hardware_buffer enabled
- if (GetDeviceExtensions()->vk_android_external_memory_android_hardware_buffer) {
+ if (device_extensions.vk_android_external_memory_android_hardware_buffer) {
skip |= ValidateCreateImageViewANDROID(pCreateInfo);
}
@@ -4764,17 +4762,16 @@
skip |= ValidateBufferUsageFlags(dst_buffer_state, VK_BUFFER_USAGE_TRANSFER_DST_BIT, true,
"VUID-vkCmdCopyImageToBuffer-dstBuffer-00191", "vkCmdCopyImageToBuffer()",
"VK_BUFFER_USAGE_TRANSFER_DST_BIT");
- if (GetApiVersion() >= VK_API_VERSION_1_1 || GetDeviceExtensions()->vk_khr_maintenance1) {
+ if (GetApiVersion() >= VK_API_VERSION_1_1 || device_extensions.vk_khr_maintenance1) {
skip |= ValidateImageFormatFeatureFlags(src_image_state, VK_FORMAT_FEATURE_TRANSFER_SRC_BIT, "vkCmdCopyImageToBuffer()",
"VUID-vkCmdCopyImageToBuffer-srcImage-01998",
"VUID-vkCmdCopyImageToBuffer-srcImage-01998");
}
skip |= InsideRenderPass(cb_node, "vkCmdCopyImageToBuffer()", "VUID-vkCmdCopyImageToBuffer-renderpass");
bool hit_error = false;
- const char *src_invalid_layout_vuid =
- (src_image_state->shared_presentable && GetDeviceExtensions()->vk_khr_shared_presentable_image)
- ? "VUID-vkCmdCopyImageToBuffer-srcImageLayout-01397"
- : "VUID-vkCmdCopyImageToBuffer-srcImageLayout-00190";
+ const char *src_invalid_layout_vuid = (src_image_state->shared_presentable && device_extensions.vk_khr_shared_presentable_image)
+ ? "VUID-vkCmdCopyImageToBuffer-srcImageLayout-01397"
+ : "VUID-vkCmdCopyImageToBuffer-srcImageLayout-00190";
for (uint32_t i = 0; i < regionCount; ++i) {
skip |= ValidateImageSubresourceLayers(cb_node, &pRegions[i].imageSubresource, "vkCmdCopyImageToBuffer()",
"imageSubresource", i);
@@ -4844,17 +4841,16 @@
skip |= ValidateImageUsageFlags(dst_image_state, VK_IMAGE_USAGE_TRANSFER_DST_BIT, true,
"VUID-vkCmdCopyBufferToImage-dstImage-00177", "vkCmdCopyBufferToImage()",
"VK_IMAGE_USAGE_TRANSFER_DST_BIT");
- if (GetApiVersion() >= VK_API_VERSION_1_1 || GetDeviceExtensions()->vk_khr_maintenance1) {
+ if (GetApiVersion() >= VK_API_VERSION_1_1 || device_extensions.vk_khr_maintenance1) {
skip |= ValidateImageFormatFeatureFlags(dst_image_state, VK_FORMAT_FEATURE_TRANSFER_DST_BIT, "vkCmdCopyBufferToImage()",
"VUID-vkCmdCopyBufferToImage-dstImage-01997",
"VUID-vkCmdCopyBufferToImage-dstImage-01997");
}
skip |= InsideRenderPass(cb_node, "vkCmdCopyBufferToImage()", "VUID-vkCmdCopyBufferToImage-renderpass");
bool hit_error = false;
- const char *dst_invalid_layout_vuid =
- (dst_image_state->shared_presentable && GetDeviceExtensions()->vk_khr_shared_presentable_image)
- ? "VUID-vkCmdCopyBufferToImage-dstImageLayout-01396"
- : "VUID-vkCmdCopyBufferToImage-dstImageLayout-00181";
+ const char *dst_invalid_layout_vuid = (dst_image_state->shared_presentable && device_extensions.vk_khr_shared_presentable_image)
+ ? "VUID-vkCmdCopyBufferToImage-dstImageLayout-01396"
+ : "VUID-vkCmdCopyBufferToImage-dstImageLayout-00181";
for (uint32_t i = 0; i < regionCount; ++i) {
skip |= ValidateImageSubresourceLayers(cb_node, &pRegions[i].imageSubresource, "vkCmdCopyBufferToImage()",
"imageSubresource", i);
@@ -4962,7 +4958,7 @@
}
}
- if (GetDeviceExtensions()->vk_android_external_memory_android_hardware_buffer) {
+ if (device_extensions.vk_android_external_memory_android_hardware_buffer) {
skip |= ValidateGetImageSubresourceLayoutANDROID(image);
}
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index 9e48848..906ff75 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -3339,7 +3339,7 @@
return skip;
}
void CoreChecks::PreCallRecordQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo *pSubmits, VkFence fence) {
- if (enabled.gpu_validation && GetDeviceExtensions()->vk_ext_descriptor_indexing) {
+ if (enabled.gpu_validation && device_extensions.vk_ext_descriptor_indexing) {
GpuPreCallRecordQueueSubmit(queue, submitCount, pSubmits, fence);
}
}
@@ -3840,7 +3840,7 @@
phys_dev_props.limits.maxMemoryAllocationCount);
}
- if (GetDeviceExtensions()->vk_android_external_memory_android_hardware_buffer) {
+ if (device_extensions.vk_android_external_memory_android_hardware_buffer) {
skip |= ValidateAllocateMemoryANDROID(pAllocateInfo);
} else {
if (0 == pAllocateInfo->allocationSize) {
@@ -4610,7 +4610,7 @@
bool CoreChecks::ValidateGetImageMemoryRequirements2(const VkImageMemoryRequirementsInfo2 *pInfo) {
bool skip = false;
- if (GetDeviceExtensions()->vk_android_external_memory_android_hardware_buffer) {
+ if (device_extensions.vk_android_external_memory_android_hardware_buffer) {
skip |= ValidateGetImageMemoryRequirements2ANDROID(pInfo->image);
}
return skip;
@@ -5053,8 +5053,6 @@
const DeviceFeatures *CoreChecks::GetEnabledFeatures() { return &enabled_features; }
-const DeviceExtensions *CoreChecks::GetDeviceExtensions() { return &device_extensions; }
-
uint32_t CoreChecks::GetApiVersion() { return api_version; }
void CoreChecks::PostCallRecordCreateFence(VkDevice device, const VkFenceCreateInfo *pCreateInfo,
@@ -7472,7 +7470,7 @@
if (sub_desc.pDepthStencilAttachment && sub_desc.pDepthStencilAttachment->attachment == attach_index) {
sub_image_layout = sub_desc.pDepthStencilAttachment->layout;
sub_image_found = true;
- } else if (GetDeviceExtensions()->vk_khr_depth_stencil_resolve) {
+ } else if (device_extensions.vk_khr_depth_stencil_resolve) {
const auto *resolve = lvl_find_in_chain<VkSubpassDescriptionDepthStencilResolveKHR>(sub_desc.pNext);
if (resolve && resolve->pDepthStencilResolveAttachment &&
resolve->pDepthStencilResolveAttachment->attachment == attach_index) {
@@ -9851,7 +9849,7 @@
const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass) {
bool skip = false;
- if (GetDeviceExtensions()->vk_khr_depth_stencil_resolve) {
+ if (device_extensions.vk_khr_depth_stencil_resolve) {
skip |= ValidateDepthStencilResolve(report_data, phys_dev_ext_props.depth_stencil_resolve_props, pCreateInfo);
}
@@ -12763,7 +12761,7 @@
bool CoreChecks::ValidateCreateSamplerYcbcrConversion(const char *func_name,
const VkSamplerYcbcrConversionCreateInfo *create_info) {
bool skip = false;
- if (GetDeviceExtensions()->vk_android_external_memory_android_hardware_buffer) {
+ if (device_extensions.vk_android_external_memory_android_hardware_buffer) {
skip |= ValidateCreateSamplerYcbcrConversionANDROID(create_info);
} else { // Not android hardware buffer
if (VK_FORMAT_UNDEFINED == create_info->format) {
@@ -12790,7 +12788,7 @@
void CoreChecks::RecordCreateSamplerYcbcrConversionState(const VkSamplerYcbcrConversionCreateInfo *create_info,
VkSamplerYcbcrConversion ycbcr_conversion) {
- if (GetDeviceExtensions()->vk_android_external_memory_android_hardware_buffer) {
+ if (device_extensions.vk_android_external_memory_android_hardware_buffer) {
RecordCreateSamplerYcbcrConversionANDROID(create_info, ycbcr_conversion);
}
}
@@ -12813,7 +12811,7 @@
void CoreChecks::PostCallRecordDestroySamplerYcbcrConversion(VkDevice device, VkSamplerYcbcrConversion ycbcrConversion,
const VkAllocationCallbacks *pAllocator) {
if (!ycbcrConversion) return;
- if (GetDeviceExtensions()->vk_android_external_memory_android_hardware_buffer) {
+ if (device_extensions.vk_android_external_memory_android_hardware_buffer) {
RecordDestroySamplerYcbcrConversionANDROID(ycbcrConversion);
}
}
@@ -12821,7 +12819,7 @@
void CoreChecks::PostCallRecordDestroySamplerYcbcrConversionKHR(VkDevice device, VkSamplerYcbcrConversion ycbcrConversion,
const VkAllocationCallbacks *pAllocator) {
if (!ycbcrConversion) return;
- if (GetDeviceExtensions()->vk_android_external_memory_android_hardware_buffer) {
+ if (device_extensions.vk_android_external_memory_android_hardware_buffer) {
RecordDestroySamplerYcbcrConversionANDROID(ycbcrConversion);
}
}
diff --git a/layers/core_validation.h b/layers/core_validation.h
index 31c60f9..3b54856 100644
--- a/layers/core_validation.h
+++ b/layers/core_validation.h
@@ -505,8 +505,6 @@
VkResult GetPDImageFormatProperties2(const VkPhysicalDeviceImageFormatInfo2*, VkImageFormatProperties2*);
const VkPhysicalDeviceMemoryProperties* GetPhysicalDeviceMemoryProperties();
- const DeviceExtensions* GetDeviceExtensions();
-
uint32_t GetApiVersion();
GlobalQFOTransferBarrierMap<VkImageMemoryBarrier>& GetGlobalQFOReleaseBarrierMap(
diff --git a/layers/descriptor_sets.cpp b/layers/descriptor_sets.cpp
index 85a0233..dd1e359 100644
--- a/layers/descriptor_sets.cpp
+++ b/layers/descriptor_sets.cpp
@@ -2207,8 +2207,8 @@
*error_msg = error_str.str();
return false;
}
- if (device_data_->GetDeviceExtensions()->vk_khr_sampler_ycbcr_conversion) {
- ImageSamplerDescriptor *desc = (ImageSamplerDescriptor *)descriptors_[index + di].get();
+ if (device_data_->device_extensions.vk_khr_sampler_ycbcr_conversion) {
+ ImageSamplerDescriptor *desc = (ImageSamplerDescriptor *)descriptors_[index].get();
if (desc->IsImmutableSampler()) {
auto sampler_state = device_data_->GetSamplerState(desc->GetSampler());
auto iv_state = device_data_->GetImageViewState(image_view);
@@ -2494,7 +2494,7 @@
}
}
}
- if (!GetDeviceExtensions()->vk_khr_maintenance1) {
+ if (!device_extensions.vk_khr_maintenance1) {
// Track number of descriptorSets allowable in this pool
if (pool_state->availableSets < p_alloc_info->descriptorSetCount) {
skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT,
diff --git a/layers/gpu_validation.cpp b/layers/gpu_validation.cpp
index 7dccef5..9f6f923 100644
--- a/layers/gpu_validation.cpp
+++ b/layers/gpu_validation.cpp
@@ -534,7 +534,7 @@
// Call the optimizer to instrument the shader.
// Use the unique_shader_module_id as a shader ID so we can look up its handle later in the shader_map.
// If descriptor indexing is enabled, enable length checks and updated descriptor checks
- const bool descriptor_indexing = GetDeviceExtensions()->vk_ext_descriptor_indexing;
+ const bool descriptor_indexing = device_extensions.vk_ext_descriptor_indexing;
using namespace spvtools;
spv_target_env target_env = SPV_ENV_VULKAN_1_1;
Optimizer optimizer(target_env);
@@ -1133,7 +1133,7 @@
// Figure out how much memory we need for the input block based on how many sets and bindings there are
// and how big each of the bindings is
- if (number_of_sets > 0 && GetDeviceExtensions()->vk_ext_descriptor_indexing) {
+ if (number_of_sets > 0 && device_extensions.vk_ext_descriptor_indexing) {
uint32_t descriptor_count = 0; // Number of descriptors, including all array elements
uint32_t binding_count = 0; // Number of bindings based on the max binding number used
for (auto desc : state.boundDescriptorSets) {
diff --git a/layers/shader_validation.cpp b/layers/shader_validation.cpp
index 7027d20..156f276 100644
--- a/layers/shader_validation.cpp
+++ b/layers/shader_validation.cpp
@@ -1424,7 +1424,6 @@
bool skip = false;
auto const &features = GetEnabledFeatures();
- auto const &extensions = GetDeviceExtensions();
struct FeaturePointer {
// Callable object to test if this feature is enabled in the given aggregate feature struct
@@ -1567,7 +1566,7 @@
skip |= RequireFeature(report_data, it->second.feature.IsEnabled(*features), it->second.name);
}
if (it->second.extension) {
- skip |= RequireExtension(report_data, extensions->*(it->second.extension), it->second.name);
+ skip |= RequireExtension(report_data, device_extensions.*(it->second.extension), it->second.name);
}
}
} else if (1 < n) { // key occurs multiple times, at least one must be enabled
@@ -1585,7 +1584,7 @@
}
if (it->second.extension) {
needs_ext = true;
- has_ext = has_ext || extensions->*(it->second.extension);
+ has_ext = has_ext || device_extensions.*(it->second.extension);
extension_names += it->second.name;
extension_names += " ";
}
@@ -2698,7 +2697,7 @@
return false;
}
- auto have_glsl_shader = GetDeviceExtensions()->vk_nv_glsl_shader;
+ auto have_glsl_shader = device_extensions.vk_nv_glsl_shader;
if (!have_glsl_shader && (pCreateInfo->codeSize % 4)) {
skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
@@ -2722,10 +2721,10 @@
spv_const_binary_t binary{pCreateInfo->pCode, pCreateInfo->codeSize / sizeof(uint32_t)};
spv_diagnostic diag = nullptr;
spv_validator_options options = spvValidatorOptionsCreate();
- if (GetDeviceExtensions()->vk_khr_relaxed_block_layout) {
+ if (device_extensions.vk_khr_relaxed_block_layout) {
spvValidatorOptionsSetRelaxBlockLayout(options, true);
}
- if (GetDeviceExtensions()->vk_ext_scalar_block_layout &&
+ if (device_extensions.vk_ext_scalar_block_layout &&
GetEnabledFeatures()->scalar_block_layout_features.scalarBlockLayout == VK_TRUE) {
spvValidatorOptionsSetScalarBlockLayout(options, true);
}