Skip to content

Commit 8e90b2d

Browse files
authored
Add device feature "IndexTypeUint8Features.indexTypeUint8" (#1031)
This is required for this upcoming Vulkan CTS change: https://gerrit.khronos.org/c/vk-gl-cts/+/12422
1 parent 6408a26 commit 8e90b2d

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/script.cc

+1
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ bool Script::IsKnownFeature(const std::string& name) const {
129129
name == "SubgroupSupportedStages.geometry" ||
130130
name == "SubgroupSupportedStages.fragment" ||
131131
name == "SubgroupSupportedStages.compute" ||
132+
name == "IndexTypeUint8Features.indexTypeUint8" ||
132133
name ==
133134
"ShaderSubgroupExtendedTypesFeatures.shaderSubgroupExtendedTypes";
134135
}

src/vulkan/device.cc

+15
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ const char kSubgroupSupportedStagesCompute[] =
8686
const char kShaderSubgroupExtendedTypes[] =
8787
"ShaderSubgroupExtendedTypesFeatures.shaderSubgroupExtendedTypes";
8888

89+
const char kIndexTypeUint8[] =
90+
"IndexTypeUint8Features.indexTypeUint8";
91+
8992
struct BaseOutStructure {
9093
VkStructureType sType;
9194
void* pNext;
@@ -475,6 +478,7 @@ Result Device::Initialize(
475478
subgroup_size_control_features = nullptr;
476479
VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures*
477480
shader_subgroup_extended_types_ptrs = nullptr;
481+
VkPhysicalDeviceIndexTypeUint8FeaturesEXT* index_type_uint8_ptrs = nullptr;
478482
void* ptr = available_features2.pNext;
479483
while (ptr != nullptr) {
480484
BaseOutStructure* s = static_cast<BaseOutStructure*>(ptr);
@@ -505,6 +509,10 @@ Result Device::Initialize(
505509
static_cast<VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures*>(
506510
ptr);
507511
break;
512+
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT:
513+
index_type_uint8_ptrs =
514+
static_cast<VkPhysicalDeviceIndexTypeUint8FeaturesEXT*>(ptr);
515+
break;
508516
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES:
509517
vulkan11_ptrs = static_cast<VkPhysicalDeviceVulkan11Features*>(ptr);
510518
break;
@@ -567,6 +575,13 @@ Result Device::Initialize(
567575
return amber::Result(
568576
"Subgroup extended types requested but feature not returned");
569577
}
578+
if (feature == kIndexTypeUint8 &&
579+
(index_type_uint8_ptrs == nullptr ||
580+
index_type_uint8_ptrs->indexTypeUint8 != VK_TRUE)) {
581+
return amber::Result(
582+
"Index type uint8_t requested but feature not returned");
583+
}
584+
570585

571586
// Next check the fields of the feature structures.
572587

0 commit comments

Comments
 (0)