Introduce some special handlings for structure VkLayerSettingEXT. (#1910)

This commit is contained in:
Andreas Süßenbach 2024-06-27 13:32:31 +02:00 committed by GitHub
parent aac0b4d3ac
commit 3b0d995a82
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 508 additions and 146 deletions

View File

@ -102,7 +102,6 @@ namespace VULKAN_HPP_NAMESPACE
${Flags}
${enums}
${indexTypeTraits}
${objectTypeToDebugReportObjectType}
} // namespace VULKAN_HPP_NAMESPACE
#endif
@ -111,7 +110,6 @@ ${objectTypeToDebugReportObjectType}
std::string str = replaceWithMap( vulkanEnumsHppTemplate,
{ { "enums", generateEnums() },
{ "Flags", readSnippet( "Flags.hpp" ) },
{ "indexTypeTraits", generateIndexTypeTraits() },
{ "licenseHeader", m_vulkanLicenseHeader },
{ "objectTypeToDebugReportObjectType", generateObjectTypeToDebugReportObjectType() } } );
@ -6880,16 +6878,27 @@ std::string VulkanHppGenerator::generateEnum( std::pair<std::string, EnumData> c
enumUsing += " using " + stripPrefix( alias.first, "Vk" ) + " = " + stripPrefix( enumData.first, "Vk" ) + ";\n";
}
std::string typeTraits;
if ( enumData.first == "VkIndexType" )
{
typeTraits = generateIndexTypeTraits( enumData );
}
else if ( enumData.first == "VkLayerSettingTypeEXT" )
{
typeTraits = generateLayerSettingTypeTraits();
}
const std::string enumTemplate = R"( enum class ${enumName}${baseType}
{${enumValues}};
${enumUsing}${bitmask})";
${typeTraits}${enumUsing}${bitmask})";
return replaceWithMap( enumTemplate,
{ { "baseType", baseType },
{ "bitmask", bitmask },
{ "enumName", stripPrefix( enumData.first, "Vk" ) },
{ "enumUsing", enumUsing },
{ "enumValues", enumValues } } );
{ "enumValues", enumValues },
{ "typeTraits", typeTraits } } );
}
std::string VulkanHppGenerator::generateEnums() const
@ -8118,9 +8127,54 @@ std::string VulkanHppGenerator::generateHandles() const
return str;
}
std::string VulkanHppGenerator::generateIndexTypeTraits() const
std::string VulkanHppGenerator::generateIndexTypeTraits( std::pair<std::string, EnumData> const & enumData ) const
{
const std::string indexTypeTraitsTemplate = R"(
assert( enumData.first == "VkIndexType" );
std::string typeTraits;
for ( auto const & value : enumData.second.values )
{
std::string cppType, valueName;
if ( value.name == "VK_INDEX_TYPE_UINT8_KHR" )
{
valueName = "eUint8KHR";
cppType = "uint8_t";
}
else if ( value.name == "VK_INDEX_TYPE_UINT16" )
{
valueName = "eUint16";
cppType = "uint16_t";
}
else if ( value.name == "VK_INDEX_TYPE_UINT32" )
{
valueName = "eUint32";
cppType = "uint32_t";
}
else
{
checkForError( value.name == "VK_INDEX_TYPE_NONE_KHR", value.xmlLine, "unknown IndexType <" + value.name + "> encountered" );
}
if ( !valueName.empty() )
{
const std::string typeTraitTemplate = R"( template <>
struct IndexTypeValue<${cppType}>
{
static VULKAN_HPP_CONST_OR_CONSTEXPR IndexType value = IndexType::${valueName};
};
template <>
struct CppType<IndexType, IndexType::${valueName}>
{
using Type = ${cppType};
};
)";
typeTraits += replaceWithMap( typeTraitTemplate, { { "cppType", cppType }, { "valueName", valueName } } );
}
}
const std::string typeTraitsTemplate = R"(
//=========================
//=== Index Type Traits ===
//=========================
@ -8129,48 +8183,95 @@ std::string VulkanHppGenerator::generateIndexTypeTraits() const
struct IndexTypeValue
{};
${indexTypeTraits}
${typeTraits}
)";
auto indexType = m_enums.find( "VkIndexType" );
assert( indexType != m_enums.end() );
return replaceWithMap( typeTraitsTemplate, { { "typeTraits", typeTraits } } );
}
std::string indexTypeTraits;
for ( auto const & value : indexType->second.values )
std::string VulkanHppGenerator::generateLayerSettingTypeTraits() const
{
#if !defined( NDEBUG )
auto enumIt = m_enums.find( "VkLayerSettingTypeEXT" );
assert( ( enumIt != m_enums.end() ) && ( enumIt->second.values.size() == 8 ) && ( enumIt->second.values[0].name == "VK_LAYER_SETTING_TYPE_BOOL32_EXT" ) &&
( enumIt->second.values[1].name == "VK_LAYER_SETTING_TYPE_INT32_EXT" ) && ( enumIt->second.values[2].name == "VK_LAYER_SETTING_TYPE_INT64_EXT" ) &&
( enumIt->second.values[3].name == "VK_LAYER_SETTING_TYPE_UINT32_EXT" ) && ( enumIt->second.values[4].name == "VK_LAYER_SETTING_TYPE_UINT64_EXT" ) &&
( enumIt->second.values[5].name == "VK_LAYER_SETTING_TYPE_FLOAT32_EXT" ) &&
( enumIt->second.values[6].name == "VK_LAYER_SETTING_TYPE_FLOAT64_EXT" ) && ( enumIt->second.values[7].name == "VK_LAYER_SETTING_TYPE_STRING_EXT" ) );
#endif
const std::string typeTraits = R"(
//=================================
//=== Layer Setting Type Traits ===
//=================================
template <>
struct CppType<LayerSettingTypeEXT, LayerSettingTypeEXT::eBool32>
{
assert( value.name.starts_with( "VK_INDEX_TYPE_UINT" ) || value.name.starts_with( "VK_INDEX_TYPE_NONE" ) );
if ( value.name.starts_with( "VK_INDEX_TYPE_UINT" ) )
using Type = vk::Bool32;
};
template <>
struct CppType<LayerSettingTypeEXT, LayerSettingTypeEXT::eInt32>
{
using Type = int32_t;
};
template <>
struct CppType<LayerSettingTypeEXT, LayerSettingTypeEXT::eInt64>
{
using Type = int64_t;
};
template <>
struct CppType<LayerSettingTypeEXT, LayerSettingTypeEXT::eUint32>
{
using Type = uint32_t;
};
template <>
struct CppType<LayerSettingTypeEXT, LayerSettingTypeEXT::eUint64>
{
using Type = uint64_t;
};
template <>
struct CppType<LayerSettingTypeEXT, LayerSettingTypeEXT::eFloat32>
{
using Type = float;
};
template <>
struct CppType<LayerSettingTypeEXT, LayerSettingTypeEXT::eFloat64>
{
using Type = double;
};
template <>
struct CppType<LayerSettingTypeEXT, LayerSettingTypeEXT::eString>
{
using Type = char *;
};
template <typename T>
bool isSameType( LayerSettingTypeEXT layerSettingType )
{
switch ( layerSettingType )
{
std::string valueName = generateEnumValueName( indexType->first, value.name, false );
assert( valueName.starts_with( "eUint" ) );
auto beginDigit = valueName.begin() + strlen( "eUint" );
assert( isdigit( *beginDigit ) );
auto endDigit = std::find_if( beginDigit, valueName.end(), []( std::string::value_type c ) noexcept { return !isdigit( c ); } );
std::string cppType = "uint" + valueName.substr( strlen( "eUint" ), endDigit - beginDigit ) + "_t";
// from type to enum value
const std::string typeToEnumTemplate = R"(
template <>
struct IndexTypeValue<${cppType}>
{
static VULKAN_HPP_CONST_OR_CONSTEXPR IndexType value = IndexType::${valueName};
};
)";
indexTypeTraits += replaceWithMap( typeToEnumTemplate, { { "cppType", cppType }, { "valueName", valueName } } );
// from enum value to type
const std::string enumToTypeTemplate = R"(
template <>
struct CppType<IndexType, IndexType::${valueName}>
{
using Type = ${cppType};
};
)";
indexTypeTraits += replaceWithMap( enumToTypeTemplate, { { "cppType", cppType }, { "valueName", valueName } } );
case LayerSettingTypeEXT::eBool32: return std::is_same<T, VULKAN_HPP_NAMESPACE::Bool32>::value;
case LayerSettingTypeEXT::eInt32: return std::is_same<T, int32_t>::value;
case LayerSettingTypeEXT::eInt64: return std::is_same<T, int64_t>::value;
case LayerSettingTypeEXT::eUint32: return std::is_same<T, uint32_t>::value;
case LayerSettingTypeEXT::eUint64: return std::is_same<T, uint64_t>::value;
case LayerSettingTypeEXT::eFloat32: return std::is_same<T, float>::value;
case LayerSettingTypeEXT::eFloat64: return std::is_same<T, double>::value;
case LayerSettingTypeEXT::eString: return std::is_same<T, char *>::value;
default: return false;
}
}
)";
return replaceWithMap( indexTypeTraitsTemplate, { { "indexTypeTraits", indexTypeTraits } } );
return typeTraits;
}
std::string VulkanHppGenerator::generateLenInitializer(
@ -10865,9 +10966,51 @@ std::string VulkanHppGenerator::generateStructConstructors( std::pair<std::strin
std::string VulkanHppGenerator::generateStructConstructorsEnhanced( std::pair<std::string, StructureData> const & structData ) const
{
if ( std::any_of( structData.second.members.begin(),
structData.second.members.end(),
[this, &members = structData.second.members]( MemberData const & md ) { return hasLen( md, members ); } ) )
// some structs needs some special handling!
if ( structData.first == "VkLayerSettingEXT" )
{
assert( ( structData.second.members.size() == 5 ) && ( structData.second.members[0].name == "pLayerName" ) &&
( structData.second.members[1].name == "pSettingName" ) && ( structData.second.members[2].name == "type" ) &&
( structData.second.members[3].name == "valueCount" ) && ( structData.second.members[4].name == "pValues" ) );
static const std::string byTypeTemplate =
R"( LayerSettingEXT( char const * pLayerName_, char const * pSettingName_, VULKAN_HPP_NAMESPACE::LayerSettingTypeEXT type_, vk::ArrayProxyNoTemporaries<const ${type}> const & values_ )
: pLayerName( pLayerName_ )
, pSettingName( pSettingName_ )
, type( type_ )
, valueCount( static_cast<uint32_t>( values_.size() ) )
, pValues( values_.data() )
{
VULKAN_HPP_ASSERT( VULKAN_HPP_NAMESPACE::isSameType<${type}>(type) );
})";
static const std::string constructorTemplate = R"(
#if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE )
// NOTE: you need to provide the type because vk::Bool32 and uint32_t are indistinguishable!
${byInt32}
${byInt64}
${byUint32}
${byUint64}
${byFloat32}
${byFloat64}
${byString}
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
)";
return replaceWithMap( constructorTemplate,
{
{ "byInt32", replaceWithMap( byTypeTemplate, { { "type", "int32_t" } } ) },
{ "byInt64", replaceWithMap( byTypeTemplate, { { "type", "int64_t" } } ) },
{ "byUint32", replaceWithMap( byTypeTemplate, { { "type", "uint32_t" } } ) },
{ "byUint64", replaceWithMap( byTypeTemplate, { { "type", "uint64_t" } } ) },
{ "byFloat32", replaceWithMap( byTypeTemplate, { { "type", "float" } } ) },
{ "byFloat64", replaceWithMap( byTypeTemplate, { { "type", "double" } } ) },
{ "byString", replaceWithMap( byTypeTemplate, { { "type", "char *" } } ) },
} );
}
else if ( std::any_of( structData.second.members.begin(),
structData.second.members.end(),
[this, &members = structData.second.members]( MemberData const & md ) { return hasLen( md, members ); } ) )
{
// map from len-members to all the array members using that len
std::map<std::vector<MemberData>::const_iterator, std::vector<std::vector<MemberData>::const_iterator>> lenIts;
@ -11680,6 +11823,41 @@ std::string VulkanHppGenerator::generateStructSetter( std::string const & struct
{ "arraySize", member.arraySizes[0] },
{ "structureName", structureName } } );
}
else if ( ( structureName == "LayerSettingEXT" ) && ( index == 4 ) )
{
// VkLayerSettingEXT::pValues needs some special handling!
assert( member.name == "pValues" );
static const std::string byTypeTemplate =
R"( LayerSettingEXT & setValues( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries<const ${type}> const & values_ ) VULKAN_HPP_NOEXCEPT
{
valueCount = static_cast<uint32_t>( values_.size() );
pValues = values_.data();
return *this;
})";
static const std::string setArrayTemplate = R"(
#if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE )
${byInt32}
${byInt64}
${byUint32}
${byUint64}
${byFloat32}
${byFloat64}
${byString}
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
)";
return replaceWithMap( setArrayTemplate,
{
{ "byInt32", replaceWithMap( byTypeTemplate, { { "type", "int32_t" } } ) },
{ "byInt64", replaceWithMap( byTypeTemplate, { { "type", "int64_t" } } ) },
{ "byUint32", replaceWithMap( byTypeTemplate, { { "type", "uint32_t" } } ) },
{ "byUint64", replaceWithMap( byTypeTemplate, { { "type", "uint64_t" } } ) },
{ "byFloat32", replaceWithMap( byTypeTemplate, { { "type", "float" } } ) },
{ "byFloat64", replaceWithMap( byTypeTemplate, { { "type", "double" } } ) },
{ "byString", replaceWithMap( byTypeTemplate, { { "type", "char *" } } ) },
} );
}
else
{
assert( ( member.lenExpressions[0] == member.lenMembers[0].first ) || ( member.lenExpressions[0] == "codeSize / 4" ) );

View File

@ -756,7 +756,8 @@ private:
std::string generateHandleHashStructures( std::vector<RequireData> const & requireData, std::string const & title ) const;
std::string generateHandleHashStructures() const;
std::string generateHandles() const;
std::string generateIndexTypeTraits() const;
std::string generateIndexTypeTraits( std::pair<std::string, EnumData> const & enumData ) const;
std::string generateLayerSettingTypeTraits() const;
std::string
generateLenInitializer( std::vector<MemberData>::const_iterator mit,
std::map<std::vector<MemberData>::const_iterator, std::vector<std::vector<MemberData>::const_iterator>>::const_iterator litit,

View File

@ -3573,6 +3573,51 @@ namespace VULKAN_HPP_NAMESPACE
eUint8EXT = VK_INDEX_TYPE_UINT8_EXT
};
//=========================
//=== Index Type Traits ===
//=========================
template <typename T>
struct IndexTypeValue
{
};
template <>
struct IndexTypeValue<uint16_t>
{
static VULKAN_HPP_CONST_OR_CONSTEXPR IndexType value = IndexType::eUint16;
};
template <>
struct CppType<IndexType, IndexType::eUint16>
{
using Type = uint16_t;
};
template <>
struct IndexTypeValue<uint32_t>
{
static VULKAN_HPP_CONST_OR_CONSTEXPR IndexType value = IndexType::eUint32;
};
template <>
struct CppType<IndexType, IndexType::eUint32>
{
using Type = uint32_t;
};
template <>
struct IndexTypeValue<uint8_t>
{
static VULKAN_HPP_CONST_OR_CONSTEXPR IndexType value = IndexType::eUint8KHR;
};
template <>
struct CppType<IndexType, IndexType::eUint8KHR>
{
using Type = uint8_t;
};
enum class StencilFaceFlagBits : VkStencilFaceFlags
{
eFront = VK_STENCIL_FACE_FRONT_BIT,
@ -7091,6 +7136,75 @@ namespace VULKAN_HPP_NAMESPACE
eString = VK_LAYER_SETTING_TYPE_STRING_EXT
};
//=================================
//=== Layer Setting Type Traits ===
//=================================
template <>
struct CppType<LayerSettingTypeEXT, LayerSettingTypeEXT::eBool32>
{
using Type = vk::Bool32;
};
template <>
struct CppType<LayerSettingTypeEXT, LayerSettingTypeEXT::eInt32>
{
using Type = int32_t;
};
template <>
struct CppType<LayerSettingTypeEXT, LayerSettingTypeEXT::eInt64>
{
using Type = int64_t;
};
template <>
struct CppType<LayerSettingTypeEXT, LayerSettingTypeEXT::eUint32>
{
using Type = uint32_t;
};
template <>
struct CppType<LayerSettingTypeEXT, LayerSettingTypeEXT::eUint64>
{
using Type = uint64_t;
};
template <>
struct CppType<LayerSettingTypeEXT, LayerSettingTypeEXT::eFloat32>
{
using Type = float;
};
template <>
struct CppType<LayerSettingTypeEXT, LayerSettingTypeEXT::eFloat64>
{
using Type = double;
};
template <>
struct CppType<LayerSettingTypeEXT, LayerSettingTypeEXT::eString>
{
using Type = char *;
};
template <typename T>
bool isSameType( LayerSettingTypeEXT layerSettingType )
{
switch ( layerSettingType )
{
case LayerSettingTypeEXT::eBool32: return std::is_same<T, VULKAN_HPP_NAMESPACE::Bool32>::value;
case LayerSettingTypeEXT::eInt32: return std::is_same<T, int32_t>::value;
case LayerSettingTypeEXT::eInt64: return std::is_same<T, int64_t>::value;
case LayerSettingTypeEXT::eUint32: return std::is_same<T, uint32_t>::value;
case LayerSettingTypeEXT::eUint64: return std::is_same<T, uint64_t>::value;
case LayerSettingTypeEXT::eFloat32: return std::is_same<T, float>::value;
case LayerSettingTypeEXT::eFloat64: return std::is_same<T, double>::value;
case LayerSettingTypeEXT::eString: return std::is_same<T, char *>::value;
default: return false;
}
}
//=== VK_NV_low_latency2 ===
enum class LatencyMarkerNV
@ -7190,51 +7304,6 @@ namespace VULKAN_HPP_NAMESPACE
};
using TimeDomainEXT = TimeDomainKHR;
//=========================
//=== Index Type Traits ===
//=========================
template <typename T>
struct IndexTypeValue
{
};
template <>
struct IndexTypeValue<uint16_t>
{
static VULKAN_HPP_CONST_OR_CONSTEXPR IndexType value = IndexType::eUint16;
};
template <>
struct CppType<IndexType, IndexType::eUint16>
{
using Type = uint16_t;
};
template <>
struct IndexTypeValue<uint32_t>
{
static VULKAN_HPP_CONST_OR_CONSTEXPR IndexType value = IndexType::eUint32;
};
template <>
struct CppType<IndexType, IndexType::eUint32>
{
using Type = uint32_t;
};
template <>
struct IndexTypeValue<uint8_t>
{
static VULKAN_HPP_CONST_OR_CONSTEXPR IndexType value = IndexType::eUint8KHR;
};
template <>
struct CppType<IndexType, IndexType::eUint8KHR>
{
using Type = uint8_t;
};
//===========================================================
//=== Mapping from ObjectType to DebugReportObjectTypeEXT ===
//===========================================================

View File

@ -49835,17 +49835,96 @@ namespace VULKAN_HPP_NAMESPACE
LayerSettingEXT( VkLayerSettingEXT const & rhs ) VULKAN_HPP_NOEXCEPT : LayerSettingEXT( *reinterpret_cast<LayerSettingEXT const *>( &rhs ) ) {}
# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE )
template <typename T>
LayerSettingEXT( const char * pLayerName_,
const char * pSettingName_,
VULKAN_HPP_NAMESPACE::LayerSettingTypeEXT type_,
VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries<const T> const & values_ )
// NOTE: you need to provide the type because vk::Bool32 and uint32_t are indistinguishable!
LayerSettingEXT( char const * pLayerName_,
char const * pSettingName_,
VULKAN_HPP_NAMESPACE::LayerSettingTypeEXT type_,
vk::ArrayProxyNoTemporaries<const int32_t> const & values_ )
: pLayerName( pLayerName_ )
, pSettingName( pSettingName_ )
, type( type_ )
, valueCount( static_cast<uint32_t>( values_.size() * sizeof( T ) ) )
, valueCount( static_cast<uint32_t>( values_.size() ) )
, pValues( values_.data() )
{
VULKAN_HPP_ASSERT( VULKAN_HPP_NAMESPACE::isSameType<int32_t>( type ) );
}
LayerSettingEXT( char const * pLayerName_,
char const * pSettingName_,
VULKAN_HPP_NAMESPACE::LayerSettingTypeEXT type_,
vk::ArrayProxyNoTemporaries<const int64_t> const & values_ )
: pLayerName( pLayerName_ )
, pSettingName( pSettingName_ )
, type( type_ )
, valueCount( static_cast<uint32_t>( values_.size() ) )
, pValues( values_.data() )
{
VULKAN_HPP_ASSERT( VULKAN_HPP_NAMESPACE::isSameType<int64_t>( type ) );
}
LayerSettingEXT( char const * pLayerName_,
char const * pSettingName_,
VULKAN_HPP_NAMESPACE::LayerSettingTypeEXT type_,
vk::ArrayProxyNoTemporaries<const uint32_t> const & values_ )
: pLayerName( pLayerName_ )
, pSettingName( pSettingName_ )
, type( type_ )
, valueCount( static_cast<uint32_t>( values_.size() ) )
, pValues( values_.data() )
{
VULKAN_HPP_ASSERT( VULKAN_HPP_NAMESPACE::isSameType<uint32_t>( type ) );
}
LayerSettingEXT( char const * pLayerName_,
char const * pSettingName_,
VULKAN_HPP_NAMESPACE::LayerSettingTypeEXT type_,
vk::ArrayProxyNoTemporaries<const uint64_t> const & values_ )
: pLayerName( pLayerName_ )
, pSettingName( pSettingName_ )
, type( type_ )
, valueCount( static_cast<uint32_t>( values_.size() ) )
, pValues( values_.data() )
{
VULKAN_HPP_ASSERT( VULKAN_HPP_NAMESPACE::isSameType<uint64_t>( type ) );
}
LayerSettingEXT( char const * pLayerName_,
char const * pSettingName_,
VULKAN_HPP_NAMESPACE::LayerSettingTypeEXT type_,
vk::ArrayProxyNoTemporaries<const float> const & values_ )
: pLayerName( pLayerName_ )
, pSettingName( pSettingName_ )
, type( type_ )
, valueCount( static_cast<uint32_t>( values_.size() ) )
, pValues( values_.data() )
{
VULKAN_HPP_ASSERT( VULKAN_HPP_NAMESPACE::isSameType<float>( type ) );
}
LayerSettingEXT( char const * pLayerName_,
char const * pSettingName_,
VULKAN_HPP_NAMESPACE::LayerSettingTypeEXT type_,
vk::ArrayProxyNoTemporaries<const double> const & values_ )
: pLayerName( pLayerName_ )
, pSettingName( pSettingName_ )
, type( type_ )
, valueCount( static_cast<uint32_t>( values_.size() ) )
, pValues( values_.data() )
{
VULKAN_HPP_ASSERT( VULKAN_HPP_NAMESPACE::isSameType<double>( type ) );
}
LayerSettingEXT( char const * pLayerName_,
char const * pSettingName_,
VULKAN_HPP_NAMESPACE::LayerSettingTypeEXT type_,
vk::ArrayProxyNoTemporaries<const char *> const & values_ )
: pLayerName( pLayerName_ )
, pSettingName( pSettingName_ )
, type( type_ )
, valueCount( static_cast<uint32_t>( values_.size() ) )
, pValues( values_.data() )
{
VULKAN_HPP_ASSERT( VULKAN_HPP_NAMESPACE::isSameType<char *>( type ) );
}
# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
@ -49883,17 +49962,52 @@ namespace VULKAN_HPP_NAMESPACE
return *this;
}
VULKAN_HPP_CONSTEXPR_14 LayerSettingEXT & setPValues( const void * pValues_ ) VULKAN_HPP_NOEXCEPT
# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE )
LayerSettingEXT & setValues( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries<const int32_t> const & values_ ) VULKAN_HPP_NOEXCEPT
{
pValues = pValues_;
valueCount = static_cast<uint32_t>( values_.size() );
pValues = values_.data();
return *this;
}
# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE )
template <typename T>
LayerSettingEXT & setValues( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries<const T> const & values_ ) VULKAN_HPP_NOEXCEPT
LayerSettingEXT & setValues( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries<const int64_t> const & values_ ) VULKAN_HPP_NOEXCEPT
{
valueCount = static_cast<uint32_t>( values_.size() * sizeof( T ) );
valueCount = static_cast<uint32_t>( values_.size() );
pValues = values_.data();
return *this;
}
LayerSettingEXT & setValues( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries<const uint32_t> const & values_ ) VULKAN_HPP_NOEXCEPT
{
valueCount = static_cast<uint32_t>( values_.size() );
pValues = values_.data();
return *this;
}
LayerSettingEXT & setValues( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries<const uint64_t> const & values_ ) VULKAN_HPP_NOEXCEPT
{
valueCount = static_cast<uint32_t>( values_.size() );
pValues = values_.data();
return *this;
}
LayerSettingEXT & setValues( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries<const float> const & values_ ) VULKAN_HPP_NOEXCEPT
{
valueCount = static_cast<uint32_t>( values_.size() );
pValues = values_.data();
return *this;
}
LayerSettingEXT & setValues( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries<const double> const & values_ ) VULKAN_HPP_NOEXCEPT
{
valueCount = static_cast<uint32_t>( values_.size() );
pValues = values_.data();
return *this;
}
LayerSettingEXT & setValues( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries<const char *> const & values_ ) VULKAN_HPP_NOEXCEPT
{
valueCount = static_cast<uint32_t>( values_.size() );
pValues = values_.data();
return *this;
}

View File

@ -2320,6 +2320,51 @@ namespace VULKAN_HPP_NAMESPACE
eUint32 = VK_INDEX_TYPE_UINT32
};
//=========================
//=== Index Type Traits ===
//=========================
template <typename T>
struct IndexTypeValue
{
};
template <>
struct IndexTypeValue<uint16_t>
{
static VULKAN_HPP_CONST_OR_CONSTEXPR IndexType value = IndexType::eUint16;
};
template <>
struct CppType<IndexType, IndexType::eUint16>
{
using Type = uint16_t;
};
template <>
struct IndexTypeValue<uint32_t>
{
static VULKAN_HPP_CONST_OR_CONSTEXPR IndexType value = IndexType::eUint32;
};
template <>
struct CppType<IndexType, IndexType::eUint32>
{
using Type = uint32_t;
};
template <>
struct IndexTypeValue<uint8_t>
{
static VULKAN_HPP_CONST_OR_CONSTEXPR IndexType value = IndexType::eUint8KHR;
};
template <>
struct CppType<IndexType, IndexType::eUint8KHR>
{
using Type = uint8_t;
};
enum class StencilFaceFlagBits : VkStencilFaceFlags
{
eFront = VK_STENCIL_FACE_FRONT_BIT,
@ -3532,51 +3577,6 @@ namespace VULKAN_HPP_NAMESPACE
};
#endif /*VK_USE_PLATFORM_SCI*/
//=========================
//=== Index Type Traits ===
//=========================
template <typename T>
struct IndexTypeValue
{
};
template <>
struct IndexTypeValue<uint16_t>
{
static VULKAN_HPP_CONST_OR_CONSTEXPR IndexType value = IndexType::eUint16;
};
template <>
struct CppType<IndexType, IndexType::eUint16>
{
using Type = uint16_t;
};
template <>
struct IndexTypeValue<uint32_t>
{
static VULKAN_HPP_CONST_OR_CONSTEXPR IndexType value = IndexType::eUint32;
};
template <>
struct CppType<IndexType, IndexType::eUint32>
{
using Type = uint32_t;
};
template <>
struct IndexTypeValue<uint8_t>
{
static VULKAN_HPP_CONST_OR_CONSTEXPR IndexType value = IndexType::eUint8KHR;
};
template <>
struct CppType<IndexType, IndexType::eUint8KHR>
{
using Type = uint8_t;
};
//===========================================================
//=== Mapping from ObjectType to DebugReportObjectTypeEXT ===
//===========================================================