mirror of
https://github.com/KhronosGroup/Vulkan-Hpp.git
synced 2024-10-14 16:32:17 +00:00
Add support for stateful allocators used with functions returning a std::vector. (#263)
+ update Vulkan-Docs
This commit is contained in:
parent
605ff24487
commit
c02200ce37
@ -335,6 +335,14 @@ Sometimes it is required to use `std::vector` with custom allocators. Vulkan-Hpp
|
|||||||
std::vector<LayerProperties, MyCustomAllocator> properties = physicalDevice.enumerateDeviceLayerProperties<MyCustomAllocator>();
|
std::vector<LayerProperties, MyCustomAllocator> properties = physicalDevice.enumerateDeviceLayerProperties<MyCustomAllocator>();
|
||||||
```
|
```
|
||||||
|
|
||||||
|
You can as well use a stateful custom allocator by providing it as an argument to those functions. Unfortunately, to make the compilers happy, you also need to explicitly set the Dispatch argument. To get the default there, a simple ´´´{}´´´ would suffice:
|
||||||
|
|
||||||
|
```c++
|
||||||
|
MyStatefulCustomAllocator allocator;
|
||||||
|
std::vector<LayerProperties, MyStatefulCustomAllocator> properties = physicalDevice.enumerateDeviceLayerProperties( allocator, {} );
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
### Custom assertions
|
### Custom assertions
|
||||||
|
|
||||||
All over vulkan.hpp, there are a couple of calls to an assert function. By defining VULKAN_HPP_ASSERT, you can specifiy your own custom assert function to be called instead.
|
All over vulkan.hpp, there are a couple of calls to an assert function. By defining VULKAN_HPP_ASSERT, you can specifiy your own custom assert function to be called instead.
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 9858c1e89e21246f779226d2be779fd33bb6a50d
|
Subproject commit 8d6a7b23a7decb5161e0e4a3297c4665f9061b0e
|
@ -770,25 +770,25 @@ const std::string deleterClassString = R"(
|
|||||||
class ObjectDestroy
|
class ObjectDestroy
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ObjectDestroy( OwnerType owner = OwnerType(), Optional<const AllocationCallbacks> allocator = nullptr, Dispatch const &dispatch = Dispatch() )
|
ObjectDestroy( OwnerType owner = OwnerType(), Optional<const AllocationCallbacks> allocationCallbacks = nullptr, Dispatch const &dispatch = Dispatch() )
|
||||||
: m_owner( owner )
|
: m_owner( owner )
|
||||||
, m_allocator( allocator )
|
, m_allocationCallbacks( allocationCallbacks )
|
||||||
, m_dispatch( &dispatch )
|
, m_dispatch( &dispatch )
|
||||||
{}
|
{}
|
||||||
|
|
||||||
OwnerType getOwner() const { return m_owner; }
|
OwnerType getOwner() const { return m_owner; }
|
||||||
Optional<const AllocationCallbacks> getAllocator() const { return m_allocator; }
|
Optional<const AllocationCallbacks> getAllocator() const { return m_allocationCallbacks; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void destroy(T t)
|
void destroy(T t)
|
||||||
{
|
{
|
||||||
m_owner.destroy( t, m_allocator, *m_dispatch );
|
m_owner.destroy( t, m_allocationCallbacks, *m_dispatch );
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
OwnerType m_owner;
|
OwnerType m_owner;
|
||||||
Optional<const AllocationCallbacks> m_allocator;
|
Optional<const AllocationCallbacks> m_allocationCallbacks;
|
||||||
Dispatch const* m_dispatch;
|
Dispatch const* m_dispatch;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -798,22 +798,22 @@ const std::string deleterClassString = R"(
|
|||||||
class ObjectDestroy<NoParent,Dispatch>
|
class ObjectDestroy<NoParent,Dispatch>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ObjectDestroy( Optional<const AllocationCallbacks> allocator = nullptr, Dispatch const &dispatch = Dispatch() )
|
ObjectDestroy( Optional<const AllocationCallbacks> allocationCallbacks = nullptr, Dispatch const &dispatch = Dispatch() )
|
||||||
: m_allocator( allocator )
|
: m_allocationCallbacks( allocationCallbacks )
|
||||||
, m_dispatch( &dispatch )
|
, m_dispatch( &dispatch )
|
||||||
{}
|
{}
|
||||||
|
|
||||||
Optional<const AllocationCallbacks> getAllocator() const { return m_allocator; }
|
Optional<const AllocationCallbacks> getAllocator() const { return m_allocationCallbacks; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void destroy(T t)
|
void destroy(T t)
|
||||||
{
|
{
|
||||||
t.destroy( m_allocator, *m_dispatch );
|
t.destroy( m_allocationCallbacks, *m_dispatch );
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Optional<const AllocationCallbacks> m_allocator;
|
Optional<const AllocationCallbacks> m_allocationCallbacks;
|
||||||
Dispatch const* m_dispatch;
|
Dispatch const* m_dispatch;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -821,25 +821,25 @@ const std::string deleterClassString = R"(
|
|||||||
class ObjectFree
|
class ObjectFree
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ObjectFree( OwnerType owner = OwnerType(), Optional<const AllocationCallbacks> allocator = nullptr, Dispatch const &dispatch = Dispatch() )
|
ObjectFree( OwnerType owner = OwnerType(), Optional<const AllocationCallbacks> allocationCallbacks = nullptr, Dispatch const &dispatch = Dispatch() )
|
||||||
: m_owner( owner )
|
: m_owner( owner )
|
||||||
, m_allocator( allocator )
|
, m_allocationCallbacks( allocationCallbacks )
|
||||||
, m_dispatch( &dispatch )
|
, m_dispatch( &dispatch )
|
||||||
{}
|
{}
|
||||||
|
|
||||||
OwnerType getOwner() const { return m_owner; }
|
OwnerType getOwner() const { return m_owner; }
|
||||||
Optional<const AllocationCallbacks> getAllocator() const { return m_allocator; }
|
Optional<const AllocationCallbacks> getAllocator() const { return m_allocationCallbacks; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void destroy(T t)
|
void destroy(T t)
|
||||||
{
|
{
|
||||||
m_owner.free( t, m_allocator, *m_dispatch );
|
m_owner.free( t, m_allocationCallbacks, *m_dispatch );
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
OwnerType m_owner;
|
OwnerType m_owner;
|
||||||
Optional<const AllocationCallbacks> m_allocator;
|
Optional<const AllocationCallbacks> m_allocationCallbacks;
|
||||||
Dispatch const* m_dispatch;
|
Dispatch const* m_dispatch;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -3298,9 +3298,9 @@ void VulkanHppGenerator::writeExceptionsForEnum(std::ostream & os, EnumData cons
|
|||||||
os << std::endl;
|
os << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VulkanHppGenerator::writeFunction(std::ostream & os, std::string const& indentation, CommandData const& commandData, bool definition, bool enhanced, bool singular, bool unique, bool isStructureChain)
|
void VulkanHppGenerator::writeFunction(std::ostream & os, std::string const& indentation, CommandData const& commandData, bool definition, bool enhanced, bool singular, bool unique, bool isStructureChain, bool withAllocator)
|
||||||
{
|
{
|
||||||
writeFunctionHeaderTemplate(os, indentation, commandData, enhanced, unique, !definition, isStructureChain);
|
writeFunctionHeaderTemplate(os, indentation, commandData, enhanced, singular, unique, !definition, isStructureChain);
|
||||||
|
|
||||||
os << indentation << (definition ? "VULKAN_HPP_INLINE " : "");
|
os << indentation << (definition ? "VULKAN_HPP_INLINE " : "");
|
||||||
writeFunctionHeaderReturnType(os, commandData, enhanced, singular, unique, isStructureChain);
|
writeFunctionHeaderReturnType(os, commandData, enhanced, singular, unique, isStructureChain);
|
||||||
@ -3309,7 +3309,7 @@ void VulkanHppGenerator::writeFunction(std::ostream & os, std::string const& ind
|
|||||||
os << commandData.className << "::";
|
os << commandData.className << "::";
|
||||||
}
|
}
|
||||||
writeFunctionHeaderName(os, commandData.reducedName, singular, unique);
|
writeFunctionHeaderName(os, commandData.reducedName, singular, unique);
|
||||||
writeFunctionHeaderArguments(os, commandData, enhanced, singular, !definition);
|
writeFunctionHeaderArguments(os, commandData, enhanced, singular, !definition, withAllocator);
|
||||||
os << (definition ? "" : ";") << std::endl;
|
os << (definition ? "" : ";") << std::endl;
|
||||||
|
|
||||||
if (definition)
|
if (definition)
|
||||||
@ -3318,7 +3318,7 @@ void VulkanHppGenerator::writeFunction(std::ostream & os, std::string const& ind
|
|||||||
os << indentation << "{" << std::endl;
|
os << indentation << "{" << std::endl;
|
||||||
if (enhanced)
|
if (enhanced)
|
||||||
{
|
{
|
||||||
writeFunctionBodyEnhanced(os, indentation, commandData, singular, unique, isStructureChain);
|
writeFunctionBodyEnhanced(os, indentation, commandData, singular, unique, isStructureChain, withAllocator);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -3328,7 +3328,7 @@ void VulkanHppGenerator::writeFunction(std::ostream & os, std::string const& ind
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void VulkanHppGenerator::writeFunctionBodyEnhanced(std::ostream & os, std::string const& indentation, CommandData const& commandData, bool singular, bool unique, bool isStructureChain)
|
void VulkanHppGenerator::writeFunctionBodyEnhanced(std::ostream & os, std::string const& indentation, CommandData const& commandData, bool singular, bool unique, bool isStructureChain, bool withAllocator)
|
||||||
{
|
{
|
||||||
if (unique && !singular && (commandData.vectorParams.find(commandData.returnParam) != commandData.vectorParams.end())) // returns a vector of UniqueStuff
|
if (unique && !singular && (commandData.vectorParams.find(commandData.returnParam) != commandData.vectorParams.end())) // returns a vector of UniqueStuff
|
||||||
{
|
{
|
||||||
@ -3382,7 +3382,7 @@ ${i} return createResultValue( result, ${typeVariable}s, VULKAN_HPP_NAMESPACE_S
|
|||||||
std::string returnName;
|
std::string returnName;
|
||||||
if (commandData.returnParam != INVALID_INDEX)
|
if (commandData.returnParam != INVALID_INDEX)
|
||||||
{
|
{
|
||||||
returnName = writeFunctionBodyEnhancedLocalReturnVariable(os, indentation, commandData, singular, isStructureChain);
|
returnName = writeFunctionBodyEnhancedLocalReturnVariable(os, indentation, commandData, singular, isStructureChain, withAllocator);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (commandData.twoStep)
|
if (commandData.twoStep)
|
||||||
@ -3456,7 +3456,7 @@ void VulkanHppGenerator::writeFunctionBodyTwoStep(std::ostream & os, std::string
|
|||||||
os << replaceWithMap(templateString, replacements);
|
os << replaceWithMap(templateString, replacements);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string VulkanHppGenerator::writeFunctionBodyEnhancedLocalReturnVariable(std::ostream & os, std::string const& indentation, CommandData const& commandData, bool singular, bool isStructureChain)
|
std::string VulkanHppGenerator::writeFunctionBodyEnhancedLocalReturnVariable(std::ostream & os, std::string const& indentation, CommandData const& commandData, bool singular, bool isStructureChain, bool withAllocator)
|
||||||
{
|
{
|
||||||
std::string returnName = startLowerCase(strip(commandData.params[commandData.returnParam].name, "p"));
|
std::string returnName = startLowerCase(strip(commandData.params[commandData.returnParam].name, "p"));
|
||||||
|
|
||||||
@ -3534,7 +3534,11 @@ std::string VulkanHppGenerator::writeFunctionBodyEnhancedLocalReturnVariable(std
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
assert(!size.empty());
|
assert(!size.empty());
|
||||||
os << "( " << size << " )";
|
os << "( " << size << (withAllocator ? ", vectorAllocator" : "") << " )";
|
||||||
|
}
|
||||||
|
else if (withAllocator)
|
||||||
|
{
|
||||||
|
os << "( vectorAllocator )";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
os << ";" << std::endl;
|
os << ";" << std::endl;
|
||||||
@ -3771,12 +3775,12 @@ void VulkanHppGenerator::writeFunctionBodyStandard(std::ostream & os, std::strin
|
|||||||
os << ";" << std::endl;
|
os << ";" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VulkanHppGenerator::writeFunctionHeaderArguments(std::ostream & os, CommandData const& commandData, bool enhanced, bool singular, bool withDefaults)
|
void VulkanHppGenerator::writeFunctionHeaderArguments(std::ostream & os, CommandData const& commandData, bool enhanced, bool singular, bool withDefaults, bool withAllocator)
|
||||||
{
|
{
|
||||||
os << "(";
|
os << "(";
|
||||||
if (enhanced)
|
if (enhanced)
|
||||||
{
|
{
|
||||||
writeFunctionHeaderArgumentsEnhanced(os, commandData, singular, withDefaults);
|
writeFunctionHeaderArgumentsEnhanced(os, commandData, singular, withDefaults, withAllocator);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -3789,7 +3793,7 @@ void VulkanHppGenerator::writeFunctionHeaderArguments(std::ostream & os, Command
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void VulkanHppGenerator::writeFunctionHeaderArgumentsEnhanced(std::ostream & os, CommandData const& commandData, bool singular, bool withDefaults)
|
void VulkanHppGenerator::writeFunctionHeaderArgumentsEnhanced(std::ostream & os, CommandData const& commandData, bool singular, bool withDefaults, bool withAllocator)
|
||||||
{
|
{
|
||||||
// check if there's at least one argument left to put in here
|
// check if there's at least one argument left to put in here
|
||||||
if (commandData.skippedParams.size() + (commandData.className.empty() ? 0 : 1) < commandData.params.size())
|
if (commandData.skippedParams.size() + (commandData.className.empty() ? 0 : 1) < commandData.params.size())
|
||||||
@ -3831,7 +3835,7 @@ void VulkanHppGenerator::writeFunctionHeaderArgumentsEnhanced(std::ostream & os,
|
|||||||
os << "[" << commandData.params[i].arraySize << "]";
|
os << "[" << commandData.params[i].arraySize << "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (withDefaults && (lastArgument == i))
|
if (withDefaults && (lastArgument == i) && !withAllocator)
|
||||||
{
|
{
|
||||||
// check if the very last argument is a flag without any bits -> provide some empty default for it
|
// check if the very last argument is a flag without any bits -> provide some empty default for it
|
||||||
std::map<std::string, BitmaskData>::const_iterator bitmasksIt = m_bitmasks.find(commandData.params[i].pureType);
|
std::map<std::string, BitmaskData>::const_iterator bitmasksIt = m_bitmasks.find(commandData.params[i].pureType);
|
||||||
@ -3858,7 +3862,7 @@ void VulkanHppGenerator::writeFunctionHeaderArgumentsEnhanced(std::ostream & os,
|
|||||||
{
|
{
|
||||||
// for an optional argument, trim the trailing '*' from the type, and the leading 'p' from the name
|
// for an optional argument, trim the trailing '*' from the type, and the leading 'p' from the name
|
||||||
os << "Optional<" << trimEnd(commandData.params[i].type.substr(0, rightStarPos)) << "> " << strippedParameterName;
|
os << "Optional<" << trimEnd(commandData.params[i].type.substr(0, rightStarPos)) << "> " << strippedParameterName;
|
||||||
if (withDefaults)
|
if (withDefaults && !withAllocator)
|
||||||
{
|
{
|
||||||
os << " = nullptr";
|
os << " = nullptr";
|
||||||
}
|
}
|
||||||
@ -3892,7 +3896,7 @@ void VulkanHppGenerator::writeFunctionHeaderArgumentsEnhanced(std::ostream & os,
|
|||||||
if (optional)
|
if (optional)
|
||||||
{
|
{
|
||||||
os << "Optional<const std::string> " << strippedParameterName;
|
os << "Optional<const std::string> " << strippedParameterName;
|
||||||
if (withDefaults)
|
if (withDefaults && !withAllocator)
|
||||||
{
|
{
|
||||||
os << " = nullptr";
|
os << " = nullptr";
|
||||||
}
|
}
|
||||||
@ -3928,8 +3932,12 @@ void VulkanHppGenerator::writeFunctionHeaderArgumentsEnhanced(std::ostream & os,
|
|||||||
os << ", ";
|
os << ", ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (withAllocator)
|
||||||
|
{
|
||||||
|
os << "Allocator const& vectorAllocator, ";
|
||||||
|
}
|
||||||
os << "Dispatch const &d";
|
os << "Dispatch const &d";
|
||||||
if (withDefaults)
|
if (withDefaults && !withAllocator)
|
||||||
{
|
{
|
||||||
os << " = Dispatch()";
|
os << " = Dispatch()";
|
||||||
}
|
}
|
||||||
@ -4050,7 +4058,7 @@ void VulkanHppGenerator::writeFunctionHeaderReturnType(std::ostream & os, Comman
|
|||||||
os << replaceWithMap(templateString, { { "returnType", returnType } });
|
os << replaceWithMap(templateString, { { "returnType", returnType } });
|
||||||
}
|
}
|
||||||
|
|
||||||
void VulkanHppGenerator::writeFunctionHeaderTemplate(std::ostream & os, std::string const& indentation, CommandData const& commandData, bool enhanced, bool unique, bool withDefault, bool isStructureChain)
|
void VulkanHppGenerator::writeFunctionHeaderTemplate(std::ostream & os, std::string const& indentation, CommandData const& commandData, bool enhanced, bool singular, bool unique, bool withDefault, bool isStructureChain)
|
||||||
{
|
{
|
||||||
std::string dispatch = withDefault ? std::string("typename Dispatch = DispatchLoaderStatic") : std::string("typename Dispatch");
|
std::string dispatch = withDefault ? std::string("typename Dispatch = DispatchLoaderStatic") : std::string("typename Dispatch");
|
||||||
if (enhanced && isStructureChain)
|
if (enhanced && isStructureChain)
|
||||||
@ -4063,7 +4071,7 @@ void VulkanHppGenerator::writeFunctionHeaderTemplate(std::ostream & os, std::str
|
|||||||
assert(commandData.enhancedReturnType.find("Allocator") == std::string::npos);
|
assert(commandData.enhancedReturnType.find("Allocator") == std::string::npos);
|
||||||
os << indentation << "template <typename T, " << dispatch << ">" << std::endl;
|
os << indentation << "template <typename T, " << dispatch << ">" << std::endl;
|
||||||
}
|
}
|
||||||
else if (enhanced && (commandData.enhancedReturnType.find("Allocator") != std::string::npos))
|
else if (enhanced && !singular && (commandData.enhancedReturnType.find("Allocator") != std::string::npos))
|
||||||
{
|
{
|
||||||
// otherwise, if there's an Allocator used in the enhanced return type, we templatize on that Allocator
|
// otherwise, if there's an Allocator used in the enhanced return type, we templatize on that Allocator
|
||||||
assert((commandData.enhancedReturnType.substr(0, 12) == "std::vector<") && (commandData.enhancedReturnType.find(',') != std::string::npos) && (12 < commandData.enhancedReturnType.find(',')));
|
assert((commandData.enhancedReturnType.substr(0, 12) == "std::vector<") && (commandData.enhancedReturnType.find(',') != std::string::npos) && (12 < commandData.enhancedReturnType.find(',')));
|
||||||
@ -4465,15 +4473,20 @@ void VulkanHppGenerator::writeTypeCommand(std::ostream & os, std::string const&
|
|||||||
|
|
||||||
// first create the standard version of the function
|
// first create the standard version of the function
|
||||||
std::ostringstream standard;
|
std::ostringstream standard;
|
||||||
writeFunction(standard, indentation, commandData, definition, false, false, false, false);
|
writeFunction(standard, indentation, commandData, definition, false, false, false, false, false);
|
||||||
|
|
||||||
// then the enhanced version, composed by up to five parts
|
// then the enhanced version, composed by up to seven parts
|
||||||
std::ostringstream enhanced;
|
std::ostringstream enhanced;
|
||||||
writeFunction(enhanced, indentation, commandData, definition, true, false, false, false);
|
writeFunction(enhanced, indentation, commandData, definition, true, false, false, false, false);
|
||||||
|
|
||||||
|
if (commandData.enhancedReturnType.find("Allocator") != std::string::npos)
|
||||||
|
{
|
||||||
|
writeFunction(enhanced, indentation, commandData, definition, true, false, false, false, true);
|
||||||
|
}
|
||||||
|
|
||||||
if (isStructureChain)
|
if (isStructureChain)
|
||||||
{
|
{
|
||||||
writeFunction(enhanced, indentation, commandData, definition, true, false, false, true);
|
writeFunction(enhanced, indentation, commandData, definition, true, false, false, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// then a singular version, if a sized vector would be returned
|
// then a singular version, if a sized vector would be returned
|
||||||
@ -4484,7 +4497,7 @@ void VulkanHppGenerator::writeTypeCommand(std::ostream & os, std::string const&
|
|||||||
(commandData.params[returnVector->second].type.back() != '*');
|
(commandData.params[returnVector->second].type.back() != '*');
|
||||||
if (singular)
|
if (singular)
|
||||||
{
|
{
|
||||||
writeFunction(enhanced, indentation, commandData, definition, true, true, false, false);
|
writeFunction(enhanced, indentation, commandData, definition, true, true, false, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// special handling for createDevice and createInstance !
|
// special handling for createDevice and createInstance !
|
||||||
@ -4494,11 +4507,16 @@ void VulkanHppGenerator::writeTypeCommand(std::ostream & os, std::string const&
|
|||||||
if (((m_deleters.find(commandData.className) != m_deleters.end()) || specialWriteUnique) && ((commandData.reducedName.substr(0, 8) == "allocate") || (commandData.reducedName.substr(0, 6) == "create")))
|
if (((m_deleters.find(commandData.className) != m_deleters.end()) || specialWriteUnique) && ((commandData.reducedName.substr(0, 8) == "allocate") || (commandData.reducedName.substr(0, 6) == "create")))
|
||||||
{
|
{
|
||||||
enhanced << "#ifndef VULKAN_HPP_NO_SMART_HANDLE" << std::endl;
|
enhanced << "#ifndef VULKAN_HPP_NO_SMART_HANDLE" << std::endl;
|
||||||
writeFunction(enhanced, indentation, commandData, definition, true, false, true, false);
|
writeFunction(enhanced, indentation, commandData, definition, true, false, true, false, false);
|
||||||
|
|
||||||
|
if (commandData.enhancedReturnType.find("Allocator") != std::string::npos)
|
||||||
|
{
|
||||||
|
writeFunction(enhanced, indentation, commandData, definition, true, false, true, false, true);
|
||||||
|
}
|
||||||
|
|
||||||
if (singular)
|
if (singular)
|
||||||
{
|
{
|
||||||
writeFunction(enhanced, indentation, commandData, definition, true, true, true, false);
|
writeFunction(enhanced, indentation, commandData, definition, true, true, true, false, false);
|
||||||
}
|
}
|
||||||
enhanced << "#endif /*VULKAN_HPP_NO_SMART_HANDLE*/" << std::endl;
|
enhanced << "#endif /*VULKAN_HPP_NO_SMART_HANDLE*/" << std::endl;
|
||||||
}
|
}
|
||||||
|
@ -252,11 +252,11 @@ class VulkanHppGenerator
|
|||||||
void writeCallVulkanTypeParameter(std::ostream & os, ParamData const& paramData);
|
void writeCallVulkanTypeParameter(std::ostream & os, ParamData const& paramData);
|
||||||
void writeEnumsToString(std::ostream & os, EnumData const& enumData);
|
void writeEnumsToString(std::ostream & os, EnumData const& enumData);
|
||||||
void writeExceptionsForEnum(std::ostream & os, EnumData const& enumData);
|
void writeExceptionsForEnum(std::ostream & os, EnumData const& enumData);
|
||||||
void writeFunction(std::ostream & os, std::string const& indentation, CommandData const& commandData, bool definition, bool enhanced, bool singular, bool unique, bool isStructureChain);
|
void writeFunction(std::ostream & os, std::string const& indentation, CommandData const& commandData, bool definition, bool enhanced, bool singular, bool unique, bool isStructureChain, bool withAllocator);
|
||||||
void writeFunctionBodyEnhanced(std::ostream & os, std::string const& indentation, CommandData const& commandData, bool singular, bool unique, bool isStructureChain);
|
void writeFunctionBodyEnhanced(std::ostream & os, std::string const& indentation, CommandData const& commandData, bool singular, bool unique, bool isStructureChain, bool withAllocator);
|
||||||
void writeFunctionBodyEnhanced(std::ostream & os, std::string const& templateString, std::string const& indentation, CommandData const& commandData, bool singular);
|
void writeFunctionBodyEnhanced(std::ostream & os, std::string const& templateString, std::string const& indentation, CommandData const& commandData, bool singular);
|
||||||
void writeFunctionBodyTwoStep(std::ostream & os, std::string const &templateString, std::string const& indentation, std::string const& returnName, std::string const& sizeName, CommandData const& commandData);
|
void writeFunctionBodyTwoStep(std::ostream & os, std::string const &templateString, std::string const& indentation, std::string const& returnName, std::string const& sizeName, CommandData const& commandData);
|
||||||
std::string writeFunctionBodyEnhancedLocalReturnVariable(std::ostream & os, std::string const& indentation, CommandData const& commandData, bool singular, bool isStructureChain);
|
std::string writeFunctionBodyEnhancedLocalReturnVariable(std::ostream & os, std::string const& indentation, CommandData const& commandData, bool singular, bool isStructureChain, bool withAllocator);
|
||||||
void writeFunctionBodyEnhancedCall(std::ostream &os, std::string const& indentation, CommandData const& commandData, bool singular);
|
void writeFunctionBodyEnhancedCall(std::ostream &os, std::string const& indentation, CommandData const& commandData, bool singular);
|
||||||
void writeFunctionBodyEnhancedCallResult(std::ostream &os, std::string const& indentation, CommandData const& commandData, bool singular);
|
void writeFunctionBodyEnhancedCallResult(std::ostream &os, std::string const& indentation, CommandData const& commandData, bool singular);
|
||||||
void writeFunctionBodyEnhancedCallTwoStep(std::ostream & os, std::string const& indentation, std::string const& returnName, std::string const& sizeName, CommandData const& commandData);
|
void writeFunctionBodyEnhancedCallTwoStep(std::ostream & os, std::string const& indentation, std::string const& returnName, std::string const& sizeName, CommandData const& commandData);
|
||||||
@ -266,11 +266,11 @@ class VulkanHppGenerator
|
|||||||
void writeFunctionBodyEnhancedMultiVectorSizeCheck(std::ostream & os, std::string const& indentation, CommandData const& commandData);
|
void writeFunctionBodyEnhancedMultiVectorSizeCheck(std::ostream & os, std::string const& indentation, CommandData const& commandData);
|
||||||
void writeFunctionBodyEnhancedReturnResultValue(std::ostream & os, std::string const& indentation, std::string const& returnName, CommandData const& commandData, bool singular, bool unique);
|
void writeFunctionBodyEnhancedReturnResultValue(std::ostream & os, std::string const& indentation, std::string const& returnName, CommandData const& commandData, bool singular, bool unique);
|
||||||
void writeFunctionBodyStandard(std::ostream & os, std::string const& indentation, CommandData const& commandData);
|
void writeFunctionBodyStandard(std::ostream & os, std::string const& indentation, CommandData const& commandData);
|
||||||
void writeFunctionHeaderArguments(std::ostream & os, CommandData const& commandData, bool enhanced, bool singular, bool withDefaults);
|
void writeFunctionHeaderArguments(std::ostream & os, CommandData const& commandData, bool enhanced, bool singular, bool withDefaults, bool withAllocator);
|
||||||
void writeFunctionHeaderArgumentsEnhanced(std::ostream & os, CommandData const& commandData, bool singular, bool withDefaults);
|
void writeFunctionHeaderArgumentsEnhanced(std::ostream & os, CommandData const& commandData, bool singular, bool withDefaults, bool withAllocator);
|
||||||
void writeFunctionHeaderArgumentsStandard(std::ostream & os, CommandData const& commandData, bool withDefaults);
|
void writeFunctionHeaderArgumentsStandard(std::ostream & os, CommandData const& commandData, bool withDefaults);
|
||||||
void writeFunctionHeaderReturnType(std::ostream & os, CommandData const& commandData, bool enhanced, bool singular, bool unique, bool isStructureChain);
|
void writeFunctionHeaderReturnType(std::ostream & os, CommandData const& commandData, bool enhanced, bool singular, bool unique, bool isStructureChain);
|
||||||
void writeFunctionHeaderTemplate(std::ostream & os, std::string const& indentation, CommandData const& commandData, bool enhanced, bool unique, bool withDefault, bool isStructureChain);
|
void writeFunctionHeaderTemplate(std::ostream & os, std::string const& indentation, CommandData const& commandData, bool enhanced, bool singular, bool unique, bool withDefault, bool isStructureChain);
|
||||||
void writeIndentation(std::ostream & os, size_t indentLength);
|
void writeIndentation(std::ostream & os, size_t indentLength);
|
||||||
void writeStructConstructor(std::ostream & os, std::string const& name, StructData const& structData, std::map<std::string, std::string> const& defaultValues);
|
void writeStructConstructor(std::ostream & os, std::string const& name, StructData const& structData, std::map<std::string, std::string> const& defaultValues);
|
||||||
bool writeStructConstructorArgument(std::ostream & os, bool listedArgument, size_t indentLength, MemberData const& memberData, std::map<std::string, std::string> const& defaultValues);
|
bool writeStructConstructorArgument(std::ostream & os, bool listedArgument, size_t indentLength, MemberData const& memberData, std::map<std::string, std::string> const& defaultValues);
|
||||||
|
2433
vulkan/vulkan.hpp
2433
vulkan/vulkan.hpp
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user