|
1 | | -/* Copyright (c) 2015-2025 The Khronos Group Inc. |
2 | | - * Copyright (c) 2015-2025 Valve Corporation |
3 | | - * Copyright (c) 2015-2025 LunarG, Inc. |
4 | | - * Copyright (C) 2015-2025 Google Inc. |
| 1 | +/* Copyright (c) 2015-2026 The Khronos Group Inc. |
| 2 | + * Copyright (c) 2015-2026 Valve Corporation |
| 3 | + * Copyright (c) 2015-2026 LunarG, Inc. |
| 4 | + * Copyright (C) 2015-2026 Google Inc. |
5 | 5 | * |
6 | 6 | * Licensed under the Apache License, Version 2.0 (the "License"); |
7 | 7 | * you may not use this file except in compliance with the License. |
@@ -295,7 +295,7 @@ void Instance::CommonPostCallRecordEnumeratePhysicalDevice(const VkPhysicalDevic |
295 | 295 | ext_props.resize(ext_count); |
296 | 296 | DispatchEnumerateDeviceExtensionProperties(phys_device, nullptr, &ext_count, ext_props.data()); |
297 | 297 |
|
298 | | - DeviceExtensions phys_dev_exts(extensions, phys_dev_props->apiVersion, ext_props); |
| 298 | + DeviceExtensions phys_dev_exts(extensions, api_version, ext_props); |
299 | 299 | physical_device_extensions[phys_device] = std::move(phys_dev_exts); |
300 | 300 | } |
301 | 301 | } |
@@ -1047,4 +1047,43 @@ bool Instance::manual_PreCallValidateGetPhysicalDeviceProperties2(VkPhysicalDevi |
1047 | 1047 | } |
1048 | 1048 | return skip; |
1049 | 1049 | } |
| 1050 | + |
| 1051 | +bool Instance::ValidateGetPhysicalDeviceFormatProperties2(VkPhysicalDevice physicalDevice, VkFormat format, |
| 1052 | + VkFormatProperties2 *pFormatProperties, const Context &context) const { |
| 1053 | + bool skip = false; |
| 1054 | + |
| 1055 | + if (IsValueIn(format, {VK_FORMAT_G8_B8R8_2PLANE_444_UNORM, VK_FORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16, |
| 1056 | + VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16, VK_FORMAT_G16_B16R16_2PLANE_444_UNORM})) { |
| 1057 | + const auto &exposed_extensions = physical_device_extensions.at(physicalDevice); |
| 1058 | + |
| 1059 | + if (api_version < VK_API_VERSION_1_3 && !exposed_extensions.vk_khr_maintenance5 && |
| 1060 | + !exposed_extensions.vk_ext_ycbcr_2plane_444_formats) { |
| 1061 | + const char *vuid = context.error_obj.location.function == Func::vkGetPhysicalDeviceFormatProperties |
| 1062 | + ? "VUID-vkGetPhysicalDeviceFormatProperties-None-12272" |
| 1063 | + : "VUID-vkGetPhysicalDeviceFormatProperties2-None-12273"; |
| 1064 | + skip |= |
| 1065 | + LogError(vuid, physicalDevice, context.error_obj.location.dot(Field::format), "is %s.", string_VkFormat(format)); |
| 1066 | + } |
| 1067 | + } |
| 1068 | + |
| 1069 | + return skip; |
| 1070 | +} |
| 1071 | + |
| 1072 | +bool Instance::manual_PreCallValidateGetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, |
| 1073 | + VkFormatProperties *pFormatProperties, |
| 1074 | + const Context &context) const { |
| 1075 | + if (!pFormatProperties) { |
| 1076 | + return false; |
| 1077 | + } |
| 1078 | + VkFormatProperties2 format_props_2 = vku::InitStructHelper(); |
| 1079 | + format_props_2.formatProperties = *pFormatProperties; |
| 1080 | + return ValidateGetPhysicalDeviceFormatProperties2(physicalDevice, format, &format_props_2, context); |
| 1081 | +} |
| 1082 | + |
| 1083 | +bool Instance::manual_PreCallValidateGetPhysicalDeviceFormatProperties2(VkPhysicalDevice physicalDevice, VkFormat format, |
| 1084 | + VkFormatProperties2 *pFormatProperties, |
| 1085 | + const Context &context) const { |
| 1086 | + return ValidateGetPhysicalDeviceFormatProperties2(physicalDevice, format, pFormatProperties, context); |
| 1087 | +} |
| 1088 | + |
1050 | 1089 | } // namespace stateless |
0 commit comments