diff options
author | Piers Daniell <pdaniell@nvidia.com> | 2023-09-02 06:32:39 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-02 08:32:39 -0400 |
commit | 8e90b2d2f532bcd4a80069e3f37a9698209a21bc (patch) | |
tree | 0373bac7e7a4fa6943e12eb3940e3d239ef86897 | |
parent | 6408a26c479042304ce523e3ff99a9302796f650 (diff) | |
download | amber-8e90b2d2f532bcd4a80069e3f37a9698209a21bc.tar.gz |
Add device feature "IndexTypeUint8Features.indexTypeUint8" (#1031)
This is required for this upcoming Vulkan CTS change:
https://gerrit.khronos.org/c/vk-gl-cts/+/12422
-rw-r--r-- | src/script.cc | 1 | ||||
-rw-r--r-- | src/vulkan/device.cc | 15 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/script.cc b/src/script.cc index 3abe6af..091949e 100644 --- a/src/script.cc +++ b/src/script.cc @@ -129,6 +129,7 @@ bool Script::IsKnownFeature(const std::string& name) const { name == "SubgroupSupportedStages.geometry" || name == "SubgroupSupportedStages.fragment" || name == "SubgroupSupportedStages.compute" || + name == "IndexTypeUint8Features.indexTypeUint8" || name == "ShaderSubgroupExtendedTypesFeatures.shaderSubgroupExtendedTypes"; } diff --git a/src/vulkan/device.cc b/src/vulkan/device.cc index 34b1871..43a1d8b 100644 --- a/src/vulkan/device.cc +++ b/src/vulkan/device.cc @@ -86,6 +86,9 @@ const char kSubgroupSupportedStagesCompute[] = const char kShaderSubgroupExtendedTypes[] = "ShaderSubgroupExtendedTypesFeatures.shaderSubgroupExtendedTypes"; +const char kIndexTypeUint8[] = + "IndexTypeUint8Features.indexTypeUint8"; + struct BaseOutStructure { VkStructureType sType; void* pNext; @@ -475,6 +478,7 @@ Result Device::Initialize( subgroup_size_control_features = nullptr; VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures* shader_subgroup_extended_types_ptrs = nullptr; + VkPhysicalDeviceIndexTypeUint8FeaturesEXT* index_type_uint8_ptrs = nullptr; void* ptr = available_features2.pNext; while (ptr != nullptr) { BaseOutStructure* s = static_cast<BaseOutStructure*>(ptr); @@ -505,6 +509,10 @@ Result Device::Initialize( static_cast<VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures*>( ptr); break; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT: + index_type_uint8_ptrs = + static_cast<VkPhysicalDeviceIndexTypeUint8FeaturesEXT*>(ptr); + break; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES: vulkan11_ptrs = static_cast<VkPhysicalDeviceVulkan11Features*>(ptr); break; @@ -567,6 +575,13 @@ Result Device::Initialize( return amber::Result( "Subgroup extended types requested but feature not returned"); } + if (feature == kIndexTypeUint8 && + (index_type_uint8_ptrs == nullptr || + index_type_uint8_ptrs->indexTypeUint8 != VK_TRUE)) { + return amber::Result( + "Index type uint8_t requested but feature not returned"); + } + // Next check the fields of the feature structures. |