mirror of
https://github.com/KhronosGroup/Vulkan-Hpp
synced 2024-11-22 12:20:05 +00:00
Add support of attribute "type" for a enums in an extension, storing them as a constant. (#1668)
This commit is contained in:
parent
f3cdc24a13
commit
9aa679e5e8
@ -13841,9 +13841,10 @@ void VulkanHppGenerator::readRequireEnum(
|
|||||||
{ "extnumber", {} },
|
{ "extnumber", {} },
|
||||||
{ "offset", {} },
|
{ "offset", {} },
|
||||||
{ "protect", { "VK_ENABLE_BETA_EXTENSIONS" } },
|
{ "protect", { "VK_ENABLE_BETA_EXTENSIONS" } },
|
||||||
|
{ "type", { "uint32_t" } },
|
||||||
{ "value", {} } } );
|
{ "value", {} } } );
|
||||||
|
|
||||||
std::string api, bitpos, extends, name, offset, protect, value;
|
std::string api, bitpos, extends, name, offset, protect, type, value;
|
||||||
for ( auto const & attribute : attributes )
|
for ( auto const & attribute : attributes )
|
||||||
{
|
{
|
||||||
if ( attribute.first == "api" )
|
if ( attribute.first == "api" )
|
||||||
@ -13870,6 +13871,10 @@ void VulkanHppGenerator::readRequireEnum(
|
|||||||
{
|
{
|
||||||
protect = attribute.second;
|
protect = attribute.second;
|
||||||
}
|
}
|
||||||
|
else if (attribute.first == "type")
|
||||||
|
{
|
||||||
|
type = attribute.second;
|
||||||
|
}
|
||||||
else if ( attribute.first == "value" )
|
else if ( attribute.first == "value" )
|
||||||
{
|
{
|
||||||
value = attribute.second;
|
value = attribute.second;
|
||||||
@ -13892,6 +13897,11 @@ void VulkanHppGenerator::readRequireEnum(
|
|||||||
checkForError( m_types.insert( { name, TypeData{ TypeCategory::Constant, { requiredBy }, line } } ).second,
|
checkForError( m_types.insert( { name, TypeData{ TypeCategory::Constant, { requiredBy }, line } } ).second,
|
||||||
line,
|
line,
|
||||||
"required enum <" + name + "> specified by value <" + value + "> is already specified" );
|
"required enum <" + name + "> specified by value <" + value + "> is already specified" );
|
||||||
|
if (type == "uint32_t")
|
||||||
|
{
|
||||||
|
assert( !m_constants.contains( name ) );
|
||||||
|
m_constants[name] = { type, value, line };
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user