if ( !vk::isInstanceExtensionSupported(context.getUsedApiVersion(), context.getInstanceExtensions(), "VK_KHR_get_physical_device_properties2") )
TCU_THROW(NotSupportedError, "Extension VK_KHR_get_physical_device_properties2 is not present");
+ VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
+ const InstanceInterface& vki = context.getInstanceInterface();
+ const vector<VkExtensionProperties> deviceExtensions = enumerateDeviceExtensionProperties(vki, physicalDevice, DE_NULL);
+
tcu::TestLog& log = context.getTestContext().getLog();
vk::VkPhysicalDeviceFeatures2 coreFeatures;
deMemset(&coreFeatures, 0, sizeof(coreFeatures));
void** nextPtr = &coreFeatures.pNext;
vk::VkPhysicalDevice8BitStorageFeaturesKHR physicalDevice8BitStorageFeaturesKHR;
- if (vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_8bit_storage"))
+ deMemset(&physicalDevice8BitStorageFeaturesKHR, 0, sizeof(physicalDevice8BitStorageFeaturesKHR));
+
+ if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_KHR_8bit_storage")) )
{
- deMemset(&physicalDevice8BitStorageFeaturesKHR, 0, sizeof(physicalDevice8BitStorageFeaturesKHR));
- physicalDevice8BitStorageFeaturesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES_KHR;
+ physicalDevice8BitStorageFeaturesKHR.sType = getStructureType<VkPhysicalDevice8BitStorageFeaturesKHR>();
*nextPtr = &physicalDevice8BitStorageFeaturesKHR;
nextPtr = &physicalDevice8BitStorageFeaturesKHR.pNext;
}
vk::VkPhysicalDeviceDescriptorIndexingFeaturesEXT physicalDeviceDescriptorIndexingFeaturesEXT;
- if (vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_descriptor_indexing"))
+ deMemset(&physicalDeviceDescriptorIndexingFeaturesEXT, 0, sizeof(physicalDeviceDescriptorIndexingFeaturesEXT));
+
+ if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_descriptor_indexing")) )
{
- deMemset(&physicalDeviceDescriptorIndexingFeaturesEXT, 0, sizeof(physicalDeviceDescriptorIndexingFeaturesEXT));
- physicalDeviceDescriptorIndexingFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT;
+ physicalDeviceDescriptorIndexingFeaturesEXT.sType = getStructureType<VkPhysicalDeviceDescriptorIndexingFeaturesEXT>();
*nextPtr = &physicalDeviceDescriptorIndexingFeaturesEXT;
nextPtr = &physicalDeviceDescriptorIndexingFeaturesEXT.pNext;
}
vk::VkPhysicalDeviceInlineUniformBlockFeaturesEXT physicalDeviceInlineUniformBlockFeaturesEXT;
- if (vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_inline_uniform_block"))
+ deMemset(&physicalDeviceInlineUniformBlockFeaturesEXT, 0, sizeof(physicalDeviceInlineUniformBlockFeaturesEXT));
+
+ if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_inline_uniform_block")) )
{
- deMemset(&physicalDeviceInlineUniformBlockFeaturesEXT, 0, sizeof(physicalDeviceInlineUniformBlockFeaturesEXT));
- physicalDeviceInlineUniformBlockFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT;
+ physicalDeviceInlineUniformBlockFeaturesEXT.sType = getStructureType<VkPhysicalDeviceInlineUniformBlockFeaturesEXT>();
*nextPtr = &physicalDeviceInlineUniformBlockFeaturesEXT;
nextPtr = &physicalDeviceInlineUniformBlockFeaturesEXT.pNext;
}
vk::VkPhysicalDeviceMultiviewFeatures physicalDeviceMultiviewFeatures;
- if (vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_multiview"))
+ deMemset(&physicalDeviceMultiviewFeatures, 0, sizeof(physicalDeviceMultiviewFeatures));
+
+ if ( context.contextSupports(vk::ApiVersion(1, 1, 0)) || isExtensionSupported(deviceExtensions, RequiredExtension("VK_KHR_multiview")) )
{
- deMemset(&physicalDeviceMultiviewFeatures, 0, sizeof(physicalDeviceMultiviewFeatures));
- physicalDeviceMultiviewFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES;
+ physicalDeviceMultiviewFeatures.sType = getStructureType<VkPhysicalDeviceMultiviewFeatures>();
*nextPtr = &physicalDeviceMultiviewFeatures;
nextPtr = &physicalDeviceMultiviewFeatures.pNext;
}
vk::VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR physicalDevicePipelineExecutablePropertiesFeaturesKHR;
- if (vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_pipeline_executable_properties"))
+ deMemset(&physicalDevicePipelineExecutablePropertiesFeaturesKHR, 0, sizeof(physicalDevicePipelineExecutablePropertiesFeaturesKHR));
+
+ if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_KHR_pipeline_executable_properties")) )
{
- deMemset(&physicalDevicePipelineExecutablePropertiesFeaturesKHR, 0, sizeof(physicalDevicePipelineExecutablePropertiesFeaturesKHR));
- physicalDevicePipelineExecutablePropertiesFeaturesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR;
+ physicalDevicePipelineExecutablePropertiesFeaturesKHR.sType = getStructureType<VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR>();
*nextPtr = &physicalDevicePipelineExecutablePropertiesFeaturesKHR;
nextPtr = &physicalDevicePipelineExecutablePropertiesFeaturesKHR.pNext;
}
vk::VkPhysicalDeviceScalarBlockLayoutFeaturesEXT physicalDeviceScalarBlockLayoutFeaturesEXT;
- if (vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_scalar_block_layout"))
+ deMemset(&physicalDeviceScalarBlockLayoutFeaturesEXT, 0, sizeof(physicalDeviceScalarBlockLayoutFeaturesEXT));
+
+ if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_scalar_block_layout")) )
{
- deMemset(&physicalDeviceScalarBlockLayoutFeaturesEXT, 0, sizeof(physicalDeviceScalarBlockLayoutFeaturesEXT));
- physicalDeviceScalarBlockLayoutFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES_EXT;
+ physicalDeviceScalarBlockLayoutFeaturesEXT.sType = getStructureType<VkPhysicalDeviceScalarBlockLayoutFeaturesEXT>();
*nextPtr = &physicalDeviceScalarBlockLayoutFeaturesEXT;
nextPtr = &physicalDeviceScalarBlockLayoutFeaturesEXT.pNext;
}
vk::VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR physicalDeviceUniformBufferStandardLayoutFeaturesKHR;
- if (vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_uniform_buffer_standard_layout"))
+ deMemset(&physicalDeviceUniformBufferStandardLayoutFeaturesKHR, 0, sizeof(physicalDeviceUniformBufferStandardLayoutFeaturesKHR));
+
+ if ( context.contextSupports(vk::ApiVersion(1, 1, 0)) )
{
- deMemset(&physicalDeviceUniformBufferStandardLayoutFeaturesKHR, 0, sizeof(physicalDeviceUniformBufferStandardLayoutFeaturesKHR));
- physicalDeviceUniformBufferStandardLayoutFeaturesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES_KHR;
+ physicalDeviceUniformBufferStandardLayoutFeaturesKHR.sType = getStructureType<VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR>();
*nextPtr = &physicalDeviceUniformBufferStandardLayoutFeaturesKHR;
nextPtr = &physicalDeviceUniformBufferStandardLayoutFeaturesKHR.pNext;
}
vk::VkPhysicalDeviceVariablePointersFeatures physicalDeviceVariablePointersFeatures;
- if (vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_variable_pointers"))
+ deMemset(&physicalDeviceVariablePointersFeatures, 0, sizeof(physicalDeviceVariablePointersFeatures));
+
+ if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_KHR_variable_pointers")) )
{
- deMemset(&physicalDeviceVariablePointersFeatures, 0, sizeof(physicalDeviceVariablePointersFeatures));
- physicalDeviceVariablePointersFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES;
+ physicalDeviceVariablePointersFeatures.sType = getStructureType<VkPhysicalDeviceVariablePointersFeatures>();
*nextPtr = &physicalDeviceVariablePointersFeatures;
nextPtr = &physicalDeviceVariablePointersFeatures.pNext;
}
}
}
- if ( vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_descriptor_indexing") )
+ if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_descriptor_indexing")) )
{
if ( coreFeatures.features.shaderSampledImageArrayDynamicIndexing == VK_FALSE )
{
}
}
- if ( vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_descriptor_indexing") )
+ if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_descriptor_indexing")) )
{
if ( coreFeatures.features.shaderStorageBufferArrayDynamicIndexing == VK_FALSE )
{
}
}
- if ( vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_8bit_storage") )
+ if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_KHR_8bit_storage")) )
{
if ( physicalDevice8BitStorageFeaturesKHR.storageBuffer8BitAccess == VK_FALSE )
{
}
}
- if ( vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_multiview") )
+ if ( context.contextSupports(vk::ApiVersion(1, 1, 0)) )
+ {
+ if ( physicalDeviceMultiviewFeatures.multiview == VK_FALSE )
+ {
+ log << tcu::TestLog::Message << "Mandatory feature multiview not supported" << tcu::TestLog::EndMessage;
+ result = false;
+ }
+ }
+
+ if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_KHR_multiview")) )
{
if ( physicalDeviceMultiviewFeatures.multiview == VK_FALSE )
{
}
}
- if ( vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_variable_pointers") )
+ if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_KHR_variable_pointers")) )
{
if ( physicalDeviceVariablePointersFeatures.variablePointersStorageBuffer == VK_FALSE )
{
}
}
- if ( vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_descriptor_indexing") )
+ if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_descriptor_indexing")) )
{
if ( physicalDeviceDescriptorIndexingFeaturesEXT.shaderUniformTexelBufferArrayDynamicIndexing == VK_FALSE )
{
}
}
- if ( vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_descriptor_indexing") )
+ if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_descriptor_indexing")) )
{
if ( physicalDeviceDescriptorIndexingFeaturesEXT.shaderStorageTexelBufferArrayDynamicIndexing == VK_FALSE )
{
}
}
- if ( vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_descriptor_indexing") )
+ if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_descriptor_indexing")) )
{
if ( physicalDeviceDescriptorIndexingFeaturesEXT.shaderSampledImageArrayNonUniformIndexing == VK_FALSE )
{
}
}
- if ( vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_descriptor_indexing") )
+ if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_descriptor_indexing")) )
{
if ( physicalDeviceDescriptorIndexingFeaturesEXT.shaderStorageBufferArrayNonUniformIndexing == VK_FALSE )
{
}
}
- if ( vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_descriptor_indexing") )
+ if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_descriptor_indexing")) )
{
if ( physicalDeviceDescriptorIndexingFeaturesEXT.shaderUniformTexelBufferArrayNonUniformIndexing == VK_FALSE )
{
}
}
- if ( vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_descriptor_indexing") )
+ if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_descriptor_indexing")) )
{
if ( physicalDeviceDescriptorIndexingFeaturesEXT.descriptorBindingSampledImageUpdateAfterBind == VK_FALSE )
{
}
}
- if ( vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_descriptor_indexing") )
+ if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_descriptor_indexing")) )
{
if ( physicalDeviceDescriptorIndexingFeaturesEXT.descriptorBindingStorageImageUpdateAfterBind == VK_FALSE )
{
}
}
- if ( vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_descriptor_indexing") )
+ if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_descriptor_indexing")) )
{
if ( physicalDeviceDescriptorIndexingFeaturesEXT.descriptorBindingStorageBufferUpdateAfterBind == VK_FALSE )
{
}
}
- if ( vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_descriptor_indexing") )
+ if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_descriptor_indexing")) )
{
if ( physicalDeviceDescriptorIndexingFeaturesEXT.descriptorBindingUniformTexelBufferUpdateAfterBind == VK_FALSE )
{
}
}
- if ( vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_descriptor_indexing") )
+ if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_descriptor_indexing")) )
{
if ( physicalDeviceDescriptorIndexingFeaturesEXT.descriptorBindingStorageTexelBufferUpdateAfterBind == VK_FALSE )
{
}
}
- if ( vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_descriptor_indexing") )
+ if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_descriptor_indexing")) )
{
if ( physicalDeviceDescriptorIndexingFeaturesEXT.descriptorBindingUpdateUnusedWhilePending == VK_FALSE )
{
}
}
- if ( vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_descriptor_indexing") )
+ if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_descriptor_indexing")) )
{
if ( physicalDeviceDescriptorIndexingFeaturesEXT.descriptorBindingPartiallyBound == VK_FALSE )
{
}
}
- if ( vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_descriptor_indexing") )
+ if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_descriptor_indexing")) )
{
if ( physicalDeviceDescriptorIndexingFeaturesEXT.runtimeDescriptorArray == VK_FALSE )
{
}
}
- if ( vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_inline_uniform_block") )
+ if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_inline_uniform_block")) )
{
if ( physicalDeviceInlineUniformBlockFeaturesEXT.inlineUniformBlock == VK_FALSE )
{
}
}
- if ( vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_inline_uniform_block") && vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_descriptor_indexing") )
+ if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_inline_uniform_block")) && isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_descriptor_indexing")) )
{
if ( physicalDeviceInlineUniformBlockFeaturesEXT.descriptorBindingInlineUniformBlockUpdateAfterBind == VK_FALSE )
{
}
}
- if ( vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_scalar_block_layout") )
+ if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_scalar_block_layout")) )
{
if ( physicalDeviceScalarBlockLayoutFeaturesEXT.scalarBlockLayout == VK_FALSE )
{
}
}
- if ( vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_uniform_buffer_standard_layout") )
+ if ( context.contextSupports(vk::ApiVersion(1, 1, 0)) )
{
if ( physicalDeviceUniformBufferStandardLayoutFeaturesKHR.uniformBufferStandardLayout == VK_FALSE )
{
}
}
- if ( vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_pipeline_executable_properties") )
+ if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_KHR_pipeline_executable_properties")) )
{
if ( physicalDevicePipelineExecutablePropertiesFeaturesKHR.pipelineExecutableInfo == VK_FALSE )
{
pattern = "const vk::{0}&\tContext::get{1}\t(void) const {{ return m_device->get{1}();\t}}"
genericDeviceFeaturesWriter(dfDefs, pattern, filename)
+def splitWithQuotation(line):
+ result = []
+ splitted = re.findall(r'[^"\s]\S*|".+?"', line)
+ for s in splitted:
+ result.append(s.replace('"', ''))
+ return result
+
def writeMandatoryFeatures(filename):
stream = []
- pattern = r'\s*([\w]+)\s+([\w]+)\s+([\w]+)\s+EXTENSIONS\s*\(([\s\w]*)\)'
+ pattern = r'\s*([\w]+)\s+([\w]+)\s+REQUIREMENTS\s+\((.*)\)'
mandatoryFeatures = readFile(os.path.join(VULKAN_H_DIR, "mandatory_features.txt"))
matches = re.findall(pattern, mandatoryFeatures)
dictStructs = {}
dictData = []
for m in matches:
- allExtensions = m[3].split()
- dictData.append( [ m[0], m[1], allExtensions ] )
+ allRequirements = splitWithQuotation(m[2])
+ dictData.append( [ m[0], m[1], allRequirements ] )
if m[0] != 'VkPhysicalDeviceFeatures' :
- dictStructs[m[0]] = [ m[0][2:3].lower() + m[0][3:], m[2], allExtensions[0] ]
+ if (m[0] not in dictStructs):
+ dictStructs[m[0]] = [m[0][2:3].lower() + m[0][3:]]
+ if (allRequirements[0]):
+ if (allRequirements[0] not in dictStructs[m[0]][1:]):
+ dictStructs[m[0]].append(allRequirements[0])
stream.extend(['bool checkMandatoryFeatures(const vkt::Context& context)\n{',
'\tif ( !vk::isInstanceExtensionSupported(context.getUsedApiVersion(), context.getInstanceExtensions(), "VK_KHR_get_physical_device_properties2") )',
'\t\tTCU_THROW(NotSupportedError, "Extension VK_KHR_get_physical_device_properties2 is not present");',
'',
+ '\tVkPhysicalDevice\t\t\t\t\tphysicalDevice\t\t= context.getPhysicalDevice();',
+ '\tconst InstanceInterface&\t\t\tvki\t\t\t\t\t= context.getInstanceInterface();',
+ '\tconst vector<VkExtensionProperties>\tdeviceExtensions\t= enumerateDeviceExtensionProperties(vki, physicalDevice, DE_NULL);',
+ '',
'\ttcu::TestLog& log = context.getTestContext().getLog();',
'\tvk::VkPhysicalDeviceFeatures2 coreFeatures;',
'\tdeMemset(&coreFeatures, 0, sizeof(coreFeatures));',
'\tcoreFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;',
'\tvoid** nextPtr = &coreFeatures.pNext;',
''])
+
listStruct = sorted(dictStructs.items(), key=lambda tup: tup[0]) # sort to have same results for py2 and py3
for k, v in listStruct:
stream.extend(['\tvk::' + k + ' ' + v[0]+ ';',
- '\tif (vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "' + v[2] + '"))',
- '\t{',
- '\t\tdeMemset(&' + v[0] + ', 0, sizeof(' + v[0] + '));',
- '\t\t' + v[0] + '.sType = ' + v[1] + ';',
+ '\tdeMemset(&' + v[0] + ', 0, sizeof(' + v[0] + '));',
+ ''])
+ reqs = v[1:]
+ if len(reqs) > 0 :
+ cond = 'if ( '
+ for i, req in enumerate(reqs) :
+ if (req.startswith("ApiVersion")):
+ cond = cond + 'context.contextSupports(vk::' + req + ')'
+ else:
+ cond = cond + 'isExtensionSupported(deviceExtensions, RequiredExtension("' + req + '"))'
+ if i+1 < len(reqs) :
+ cond = cond + ' || '
+ cond = cond + ' )'
+ stream.append('\t' + cond)
+ stream.extend(['\t{',
+ '\t\t' + v[0] + '.sType = getStructureType<' + k + '>();',
'\t\t*nextPtr = &' + v[0] + ';',
'\t\tnextPtr = &' + v[0] + '.pNext;',
'\t}',
structName = dictStructs[v[0]][0]
if len(v[2]) > 0 :
condition = 'if ( '
- for i, ext in enumerate(v[2]) :
- condition = condition + 'vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "' + ext + '")'
+ for i, req in enumerate(v[2]) :
+ if (req.startswith("ApiVersion")):
+ condition = condition + 'context.contextSupports(vk::' + req + ')'
+ elif '.' in req:
+ condition = condition + req
+ else:
+ condition = condition + 'isExtensionSupported(deviceExtensions, RequiredExtension("' + req + '"))'
if i+1 < len(v[2]) :
condition = condition + ' && '
condition = condition + ' )'
// * structure type enum
// * required extensions that enable specified feature
-VkPhysicalDeviceFeatures robustBufferAccess not_used EXTENSIONS ()
-VkPhysicalDeviceFeatures shaderSampledImageArrayDynamicIndexing not_used EXTENSIONS ( VK_EXT_descriptor_indexing )
-VkPhysicalDeviceFeatures shaderStorageBufferArrayDynamicIndexing not_used EXTENSIONS ( VK_EXT_descriptor_indexing )
-VkPhysicalDevice8BitStorageFeaturesKHR storageBuffer8BitAccess VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES_KHR EXTENSIONS ( VK_KHR_8bit_storage )
-VkPhysicalDeviceMultiviewFeatures multiview VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES EXTENSIONS ( VK_KHR_multiview )
-VkPhysicalDeviceVariablePointersFeatures variablePointersStorageBuffer VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES EXTENSIONS ( VK_KHR_variable_pointers )
-VkPhysicalDeviceDescriptorIndexingFeaturesEXT shaderUniformTexelBufferArrayDynamicIndexing VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT EXTENSIONS ( VK_EXT_descriptor_indexing )
-VkPhysicalDeviceDescriptorIndexingFeaturesEXT shaderStorageTexelBufferArrayDynamicIndexing VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT EXTENSIONS ( VK_EXT_descriptor_indexing )
-VkPhysicalDeviceDescriptorIndexingFeaturesEXT shaderSampledImageArrayNonUniformIndexing VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT EXTENSIONS ( VK_EXT_descriptor_indexing )
-VkPhysicalDeviceDescriptorIndexingFeaturesEXT shaderStorageBufferArrayNonUniformIndexing VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT EXTENSIONS ( VK_EXT_descriptor_indexing )
-VkPhysicalDeviceDescriptorIndexingFeaturesEXT shaderUniformTexelBufferArrayNonUniformIndexing VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT EXTENSIONS ( VK_EXT_descriptor_indexing )
-VkPhysicalDeviceDescriptorIndexingFeaturesEXT descriptorBindingSampledImageUpdateAfterBind VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT EXTENSIONS ( VK_EXT_descriptor_indexing )
-VkPhysicalDeviceDescriptorIndexingFeaturesEXT descriptorBindingStorageImageUpdateAfterBind VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT EXTENSIONS ( VK_EXT_descriptor_indexing )
-VkPhysicalDeviceDescriptorIndexingFeaturesEXT descriptorBindingStorageBufferUpdateAfterBind VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT EXTENSIONS ( VK_EXT_descriptor_indexing )
-VkPhysicalDeviceDescriptorIndexingFeaturesEXT descriptorBindingUniformTexelBufferUpdateAfterBind VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT EXTENSIONS ( VK_EXT_descriptor_indexing )
-VkPhysicalDeviceDescriptorIndexingFeaturesEXT descriptorBindingStorageTexelBufferUpdateAfterBind VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT EXTENSIONS ( VK_EXT_descriptor_indexing )
-VkPhysicalDeviceDescriptorIndexingFeaturesEXT descriptorBindingUpdateUnusedWhilePending VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT EXTENSIONS ( VK_EXT_descriptor_indexing )
-VkPhysicalDeviceDescriptorIndexingFeaturesEXT descriptorBindingPartiallyBound VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT EXTENSIONS ( VK_EXT_descriptor_indexing )
-VkPhysicalDeviceDescriptorIndexingFeaturesEXT runtimeDescriptorArray VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT EXTENSIONS ( VK_EXT_descriptor_indexing )
-VkPhysicalDeviceInlineUniformBlockFeaturesEXT inlineUniformBlock VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT EXTENSIONS ( VK_EXT_inline_uniform_block )
-VkPhysicalDeviceInlineUniformBlockFeaturesEXT descriptorBindingInlineUniformBlockUpdateAfterBind VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT EXTENSIONS ( VK_EXT_inline_uniform_block VK_EXT_descriptor_indexing )
-VkPhysicalDeviceScalarBlockLayoutFeaturesEXT scalarBlockLayout VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES_EXT EXTENSIONS ( VK_EXT_scalar_block_layout )
-VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR uniformBufferStandardLayout VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES_KHR EXTENSIONS ( VK_KHR_uniform_buffer_standard_layout )
-VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR pipelineExecutableInfo VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR EXTENSIONS ( VK_KHR_pipeline_executable_properties )
+VkPhysicalDeviceFeatures robustBufferAccess REQUIREMENTS ()
+VkPhysicalDeviceFeatures shaderSampledImageArrayDynamicIndexing REQUIREMENTS ( VK_EXT_descriptor_indexing )
+VkPhysicalDeviceFeatures shaderStorageBufferArrayDynamicIndexing REQUIREMENTS ( VK_EXT_descriptor_indexing )
+VkPhysicalDevice8BitStorageFeaturesKHR storageBuffer8BitAccess REQUIREMENTS ( VK_KHR_8bit_storage )
+VkPhysicalDeviceMultiviewFeatures multiview REQUIREMENTS ( "ApiVersion(1, 1, 0)" )
+VkPhysicalDeviceMultiviewFeatures multiview REQUIREMENTS ( VK_KHR_multiview )
+VkPhysicalDeviceVariablePointersFeatures variablePointersStorageBuffer REQUIREMENTS ( VK_KHR_variable_pointers )
+VkPhysicalDeviceDescriptorIndexingFeaturesEXT shaderUniformTexelBufferArrayDynamicIndexing REQUIREMENTS ( VK_EXT_descriptor_indexing )
+VkPhysicalDeviceDescriptorIndexingFeaturesEXT shaderStorageTexelBufferArrayDynamicIndexing REQUIREMENTS ( VK_EXT_descriptor_indexing )
+VkPhysicalDeviceDescriptorIndexingFeaturesEXT shaderSampledImageArrayNonUniformIndexing REQUIREMENTS ( VK_EXT_descriptor_indexing )
+VkPhysicalDeviceDescriptorIndexingFeaturesEXT shaderStorageBufferArrayNonUniformIndexing REQUIREMENTS ( VK_EXT_descriptor_indexing )
+VkPhysicalDeviceDescriptorIndexingFeaturesEXT shaderUniformTexelBufferArrayNonUniformIndexing REQUIREMENTS ( VK_EXT_descriptor_indexing )
+VkPhysicalDeviceDescriptorIndexingFeaturesEXT descriptorBindingSampledImageUpdateAfterBind REQUIREMENTS ( VK_EXT_descriptor_indexing )
+VkPhysicalDeviceDescriptorIndexingFeaturesEXT descriptorBindingStorageImageUpdateAfterBind REQUIREMENTS ( VK_EXT_descriptor_indexing )
+VkPhysicalDeviceDescriptorIndexingFeaturesEXT descriptorBindingStorageBufferUpdateAfterBind REQUIREMENTS ( VK_EXT_descriptor_indexing )
+VkPhysicalDeviceDescriptorIndexingFeaturesEXT descriptorBindingUniformTexelBufferUpdateAfterBind REQUIREMENTS ( VK_EXT_descriptor_indexing )
+VkPhysicalDeviceDescriptorIndexingFeaturesEXT descriptorBindingStorageTexelBufferUpdateAfterBind REQUIREMENTS ( VK_EXT_descriptor_indexing )
+VkPhysicalDeviceDescriptorIndexingFeaturesEXT descriptorBindingUpdateUnusedWhilePending REQUIREMENTS ( VK_EXT_descriptor_indexing )
+VkPhysicalDeviceDescriptorIndexingFeaturesEXT descriptorBindingPartiallyBound REQUIREMENTS ( VK_EXT_descriptor_indexing )
+VkPhysicalDeviceDescriptorIndexingFeaturesEXT runtimeDescriptorArray REQUIREMENTS ( VK_EXT_descriptor_indexing )
+VkPhysicalDeviceInlineUniformBlockFeaturesEXT inlineUniformBlock REQUIREMENTS ( VK_EXT_inline_uniform_block )
+VkPhysicalDeviceInlineUniformBlockFeaturesEXT descriptorBindingInlineUniformBlockUpdateAfterBind REQUIREMENTS ( VK_EXT_inline_uniform_block VK_EXT_descriptor_indexing )
+VkPhysicalDeviceScalarBlockLayoutFeaturesEXT scalarBlockLayout REQUIREMENTS ( VK_EXT_scalar_block_layout )
+VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR uniformBufferStandardLayout REQUIREMENTS ( "ApiVersion(1, 1, 0)" )
+VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR pipelineExecutableInfo REQUIREMENTS ( VK_KHR_pipeline_executable_properties )