Merge pull request #93 from asuessenbach/singular

Introduced version of functions handling singular element arguments i…
This commit is contained in:
Markus Tavenrath 2016-04-05 22:24:19 -07:00
commit ab89b93948
2 changed files with 313 additions and 45 deletions

View File

@ -385,16 +385,16 @@ void readTypeUnionMember( tinyxml2::XMLElement * element, std::vector<MemberData
void readTags(tinyxml2::XMLElement * element, std::set<std::string> & tags); void readTags(tinyxml2::XMLElement * element, std::set<std::string> & tags);
void readTypes(tinyxml2::XMLElement * element, VkData & vkData); void readTypes(tinyxml2::XMLElement * element, VkData & vkData);
void sortDependencies( std::list<DependencyData> & dependencies ); void sortDependencies( std::list<DependencyData> & dependencies );
std::string reduceName(std::string const& name); std::string reduceName(std::string const& name, bool stripTrailingS = false);
std::string strip(std::string const& value, std::string const& prefix, std::string const& tag = std::string()); std::string strip(std::string const& value, std::string const& prefix, std::string const& tag = std::string());
std::string stripCommand(std::string const& value); std::string stripCommand(std::string const& value);
std::string toCamelCase(std::string const& value); std::string toCamelCase(std::string const& value);
std::string toUpperCase(std::string const& name); std::string toUpperCase(std::string const& name);
void writeCall(std::ofstream & ofs, std::string const& name, size_t templateIndex, CommandData const& commandData, std::set<std::string> const& vkTypes, std::map<size_t, size_t> const& vectorParameters, size_t returnIndex, bool firstCall); void writeCall(std::ofstream & ofs, std::string const& name, size_t templateIndex, CommandData const& commandData, std::set<std::string> const& vkTypes, std::map<size_t, size_t> const& vectorParameters, size_t returnIndex, bool firstCall, bool singular);
void writeEnumsToString(std::ofstream & ofs, VkData const& vkData); void writeEnumsToString(std::ofstream & ofs, VkData const& vkData);
void writeExceptionCheck(std::ofstream & ofs, std::string const& indentation, std::string const& className, std::string const& functionName, std::vector<std::string> const& successCodes); void writeExceptionCheck(std::ofstream & ofs, std::string const& indentation, std::string const& className, std::string const& functionName, std::vector<std::string> const& successCodes);
void writeFunctionBody(std::ofstream & ofs, std::string const& indentation, std::string const& className, std::string const& functionName, std::string const& returnType, size_t templateIndex, DependencyData const& dependencyData, CommandData const& commandData, std::set<std::string> const& vkTypes, size_t returnIndex, std::map<size_t, size_t> const& vectorParameters); void writeFunctionBody(std::ofstream & ofs, std::string const& indentation, std::string const& className, std::string const& functionName, std::string const& returnType, size_t templateIndex, DependencyData const& dependencyData, CommandData const& commandData, std::set<std::string> const& vkTypes, size_t returnIndex, std::map<size_t, size_t> const& vectorParameters, bool singular);
void writeFunctionHeader(std::ofstream & ofs, std::string const& indentation, std::string const& returnType, std::string const& name, CommandData const& commandData, size_t returnIndex, size_t templateIndex, std::map<size_t, size_t> const& vectorParameters); void writeFunctionHeader(std::ofstream & ofs, std::string const& indentation, std::string const& returnType, std::string const& name, CommandData const& commandData, size_t returnIndex, size_t templateIndex, std::map<size_t, size_t> const& vectorParameters, bool singular);
void writeMemberData(std::ofstream & ofs, MemberData const& memberData, std::set<std::string> const& vkTypes); void writeMemberData(std::ofstream & ofs, MemberData const& memberData, std::set<std::string> const& vkTypes);
void writeStructConstructor( std::ofstream & ofs, std::string const& name, std::string const& memberName, StructData const& structData, std::set<std::string> const& vkTypes, std::map<std::string,std::string> const& defaultValues ); void writeStructConstructor( std::ofstream & ofs, std::string const& name, std::string const& memberName, StructData const& structData, std::set<std::string> const& vkTypes, std::map<std::string,std::string> const& defaultValues );
void writeStructGetter( std::ofstream & ofs, MemberData const& memberData, std::string const& memberName, std::set<std::string> const& vkTypes, bool constVersion ); void writeStructGetter( std::ofstream & ofs, MemberData const& memberData, std::string const& memberName, std::set<std::string> const& vkTypes, bool constVersion );
@ -1464,16 +1464,26 @@ void sortDependencies( std::list<DependencyData> & dependencies )
dependencies.swap(sortedDependencies); dependencies.swap(sortedDependencies);
} }
std::string reduceName(std::string const& name) std::string reduceName(std::string const& name, bool stripTrailingS)
{ {
assert(1 < name.length()); assert(1 < name.length());
std::string reducedName;
if ((name[0] == 'p') && (isupper(name[1]) || name[1] == 'p')) if ((name[0] == 'p') && (isupper(name[1]) || name[1] == 'p'))
{ {
std::string reducedName = strip(name, "p"); reducedName = strip(name, "p");
reducedName[0] = tolower(reducedName[0]); reducedName[0] = tolower(reducedName[0]);
return reducedName;
} }
return name; else
{
reducedName = name;
}
if (stripTrailingS && (reducedName.back() == 's'))
{
reducedName.pop_back();
}
return reducedName;
} }
std::string strip(std::string const& value, std::string const& prefix, std::string const& postfix) std::string strip(std::string const& value, std::string const& prefix, std::string const& postfix)
@ -1539,7 +1549,7 @@ std::string toUpperCase(std::string const& name)
return convertedName; return convertedName;
} }
void writeCall(std::ofstream & ofs, std::string const& name, size_t templateIndex, CommandData const& commandData, std::set<std::string> const& vkTypes, std::map<size_t, size_t> const& vectorParameters, size_t returnIndex, bool firstCall) void writeCall(std::ofstream & ofs, std::string const& name, size_t templateIndex, CommandData const& commandData, std::set<std::string> const& vkTypes, std::map<size_t, size_t> const& vectorParameters, size_t returnIndex, bool firstCall, bool singular)
{ {
std::map<size_t,size_t> countIndices; std::map<size_t,size_t> countIndices;
for (std::map<size_t, size_t>::const_iterator it = vectorParameters.begin(); it != vectorParameters.end(); ++it) for (std::map<size_t, size_t>::const_iterator it = vectorParameters.begin(); it != vectorParameters.end(); ++it)
@ -1575,6 +1585,19 @@ void writeCall(std::ofstream & ofs, std::string const& name, size_t templateInde
ofs << "&" << reduceName(commandData.arguments[it->first].name); ofs << "&" << reduceName(commandData.arguments[it->first].name);
} }
else else
{
if (singular)
{
if (templateIndex == it->second)
{
ofs << "static_cast<" << commandData.arguments[it->first].pureType << ">( sizeof( T ) )";
}
else
{
ofs << "1";
}
}
else
{ {
ofs << "static_cast<" << commandData.arguments[it->first].pureType << ">( " << reduceName(commandData.arguments[it->second].name) << ".size() "; ofs << "static_cast<" << commandData.arguments[it->first].pureType << ">( " << reduceName(commandData.arguments[it->second].name) << ".size() ";
if (templateIndex == it->second) if (templateIndex == it->second)
@ -1584,6 +1607,7 @@ void writeCall(std::ofstream & ofs, std::string const& name, size_t templateInde
ofs << ")"; ofs << ")";
} }
} }
}
else else
{ {
it = vectorParameters.find(i); it = vectorParameters.find(i);
@ -1608,7 +1632,17 @@ void writeCall(std::ofstream & ofs, std::string const& name, size_t templateInde
{ {
ofs << "Vk"; ofs << "Vk";
} }
ofs << commandData.arguments[it->first].pureType << "*>( " << reduceName(commandData.arguments[it->first].name) << ".data() )"; ofs << commandData.arguments[it->first].pureType << "*>( ";
if (singular)
{
ofs << "&";
}
ofs << reduceName(commandData.arguments[it->first].name, singular);
if (!singular)
{
ofs << ".data()";
}
ofs << " )";
} }
else if (commandData.arguments[it->first].pureType == "char") else if (commandData.arguments[it->first].pureType == "char")
{ {
@ -1624,7 +1658,15 @@ void writeCall(std::ofstream & ofs, std::string const& name, size_t templateInde
} }
else else
{ {
ofs << reduceName(commandData.arguments[it->first].name) << ".data()"; if (singular)
{
ofs << "&";
}
ofs << reduceName(commandData.arguments[it->first].name, singular);
if (!singular)
{
ofs << ".data()";
}
} }
} }
} }
@ -1711,7 +1753,7 @@ void writeExceptionCheck(std::ofstream & ofs, std::string const& indentation, st
<< indentation << " }" << std::endl; << indentation << " }" << std::endl;
} }
void writeFunctionBody(std::ofstream & ofs, std::string const& indentation, std::string const& className, std::string const& functionName, std::string const& returnType, size_t templateIndex, DependencyData const& dependencyData, CommandData const& commandData, std::set<std::string> const& vkTypes, size_t returnIndex, std::map<size_t, size_t> const& vectorParameters) void writeFunctionBody(std::ofstream & ofs, std::string const& indentation, std::string const& className, std::string const& functionName, std::string const& returnType, size_t templateIndex, DependencyData const& dependencyData, CommandData const& commandData, std::set<std::string> const& vkTypes, size_t returnIndex, std::map<size_t, size_t> const& vectorParameters, bool singular)
{ {
ofs << indentation << "{" << std::endl; ofs << indentation << "{" << std::endl;
@ -1722,7 +1764,7 @@ void writeFunctionBody(std::ofstream & ofs, std::string const& indentation, std:
} }
// add some error checks if multiple vectors need to have the same size // add some error checks if multiple vectors need to have the same size
if (1 < vectorParameters.size()) if (!singular && (1 < vectorParameters.size()))
{ {
for (std::map<size_t, size_t>::const_iterator it0 = vectorParameters.begin(); it0 != vectorParameters.end(); ++it0) for (std::map<size_t, size_t>::const_iterator it0 = vectorParameters.begin(); it0 != vectorParameters.end(); ++it0)
{ {
@ -1745,8 +1787,10 @@ void writeFunctionBody(std::ofstream & ofs, std::string const& indentation, std:
// write the local variable to hold a returned value // write the local variable to hold a returned value
if ((returnIndex != ~0) && (commandData.returnType != returnType)) if ((returnIndex != ~0) && (commandData.returnType != returnType))
{ {
ofs << indentation << " " << returnType << " " << reduceName(commandData.arguments[returnIndex].name); ofs << indentation << " " << (singular ? commandData.arguments[returnIndex].pureType : returnType) << " " << reduceName(commandData.arguments[returnIndex].name, singular);
if (!singular)
{
std::map<size_t, size_t>::const_iterator it = vectorParameters.find(returnIndex); std::map<size_t, size_t>::const_iterator it = vectorParameters.find(returnIndex);
if (it != vectorParameters.end() && !commandData.twoStep) if (it != vectorParameters.end() && !commandData.twoStep)
{ {
@ -1773,6 +1817,7 @@ void writeFunctionBody(std::ofstream & ofs, std::string const& indentation, std:
assert(!size.empty()); assert(!size.empty());
ofs << "( " << size << " )"; ofs << "( " << size << " )";
} }
}
ofs << ";" << std::endl; ofs << ";" << std::endl;
} }
@ -1809,7 +1854,7 @@ void writeFunctionBody(std::ofstream & ofs, std::string const& indentation, std:
assert(!commandData.twoStep); assert(!commandData.twoStep);
ofs << "return "; ofs << "return ";
} }
writeCall(ofs, dependencyData.name, templateIndex, commandData, vkTypes, vectorParameters, returnIndex, true); writeCall(ofs, dependencyData.name, templateIndex, commandData, vkTypes, vectorParameters, returnIndex, true, singular);
if (commandData.returnType == "Result") if (commandData.returnType == "Result")
{ {
ofs << " )"; ofs << " )";
@ -1843,7 +1888,7 @@ void writeFunctionBody(std::ofstream & ofs, std::string const& indentation, std:
{ {
ofs << indentation << " "; ofs << indentation << " ";
} }
writeCall(ofs, dependencyData.name, templateIndex, commandData, vkTypes, vectorParameters, returnIndex, false); writeCall(ofs, dependencyData.name, templateIndex, commandData, vkTypes, vectorParameters, returnIndex, false, singular);
if (commandData.returnType == "Result") if (commandData.returnType == "Result")
{ {
ofs << " )"; ofs << " )";
@ -1867,7 +1912,7 @@ void writeFunctionBody(std::ofstream & ofs, std::string const& indentation, std:
// return the returned value // return the returned value
if ((returnIndex != ~0) && (commandData.returnType != returnType)) if ((returnIndex != ~0) && (commandData.returnType != returnType))
{ {
ofs << indentation << " return " << reduceName(commandData.arguments[returnIndex].name) << ";" << std::endl; ofs << indentation << " return " << reduceName(commandData.arguments[returnIndex].name, singular) << ";" << std::endl;
} }
else if (returnType == "Result") else if (returnType == "Result")
{ {
@ -1877,7 +1922,7 @@ void writeFunctionBody(std::ofstream & ofs, std::string const& indentation, std:
ofs << indentation << "}" << std::endl; ofs << indentation << "}" << std::endl;
} }
void writeFunctionHeader(std::ofstream & ofs, std::string const& indentation, std::string const& returnType, std::string const& name, CommandData const& commandData, size_t returnIndex, size_t templateIndex, std::map<size_t, size_t> const& vectorParameters) void writeFunctionHeader(std::ofstream & ofs, std::string const& indentation, std::string const& returnType, std::string const& name, CommandData const& commandData, size_t returnIndex, size_t templateIndex, std::map<size_t, size_t> const& vectorParameters, bool singular)
{ {
std::set<size_t> skippedArguments; std::set<size_t> skippedArguments;
for (std::map<size_t, size_t>::const_iterator it = vectorParameters.begin(); it != vectorParameters.end(); ++it) for (std::map<size_t, size_t>::const_iterator it = vectorParameters.begin(); it != vectorParameters.end(); ++it)
@ -1908,7 +1953,7 @@ void writeFunctionHeader(std::ofstream & ofs, std::string const& indentation, st
{ {
ofs << "inline "; ofs << "inline ";
} }
ofs << returnType << " " << name << "("; ofs << ((singular && (returnIndex != ~0)) ? commandData.arguments[returnIndex].pureType : returnType) << " " << reduceName(name, singular) << "(";
if (skippedArguments.size() + (commandData.handleCommand ? 1 : 0) < commandData.arguments.size()) if (skippedArguments.size() + (commandData.handleCommand ? 1 : 0) < commandData.arguments.size())
{ {
size_t lastArgument = ~0; size_t lastArgument = ~0;
@ -1966,7 +2011,7 @@ void writeFunctionHeader(std::ofstream & ofs, std::string const& indentation, st
{ {
if (templateIndex == i) if (templateIndex == i)
{ {
ofs << "std::vector<T>"; ofs << (singular ? "T" : "std::vector<T>");
} }
else if (commandData.arguments[i].pureType == "char") else if (commandData.arguments[i].pureType == "char")
{ {
@ -1976,6 +2021,10 @@ void writeFunctionHeader(std::ofstream & ofs, std::string const& indentation, st
{ {
ofs << "std::vector<uint8_t>"; ofs << "std::vector<uint8_t>";
} }
else if (singular)
{
ofs << commandData.arguments[i].pureType;
}
else else
{ {
ofs << "std::vector<" << commandData.arguments[i].pureType << ">"; ofs << "std::vector<" << commandData.arguments[i].pureType << ">";
@ -1989,7 +2038,7 @@ void writeFunctionHeader(std::ofstream & ofs, std::string const& indentation, st
{ {
ofs << "> const"; ofs << "> const";
} }
ofs << " & " << reduceName(commandData.arguments[i].name); ofs << " & " << reduceName(commandData.arguments[i].name, singular);
if (optional && (i == lastArgument)) if (optional && (i == lastArgument))
{ {
ofs << " = nullptr"; ofs << " = nullptr";
@ -2269,6 +2318,18 @@ void writeTypeCommand( std::ofstream & ofs, DependencyData const& dependencyData
} }
} }
bool hasSizedVectorParameter(std::map<size_t, size_t> const& vectorParameters, size_t returnIndex)
{
for (auto it = vectorParameters.begin(); it != vectorParameters.end(); ++it)
{
if ((it->first != returnIndex) && (it->second != ~0))
{
return true;
}
}
return false;
}
void writeTypeCommandEnhanced(std::ofstream & ofs, std::string const& indentation, std::string const& className, std::string const& functionName, DependencyData const& dependencyData, CommandData const& commandData, std::set<std::string> const& vkTypes) void writeTypeCommandEnhanced(std::ofstream & ofs, std::string const& indentation, std::string const& className, std::string const& functionName, DependencyData const& dependencyData, CommandData const& commandData, std::set<std::string> const& vkTypes)
{ {
enterProtect(ofs, commandData.protect); enterProtect(ofs, commandData.protect);
@ -2278,8 +2339,14 @@ void writeTypeCommandEnhanced(std::ofstream & ofs, std::string const& indentatio
std::map<size_t, size_t>::const_iterator returnVector = vectorParameters.find(returnIndex); std::map<size_t, size_t>::const_iterator returnVector = vectorParameters.find(returnIndex);
std::string returnType = determineReturnType(commandData, returnIndex, returnVector != vectorParameters.end()); std::string returnType = determineReturnType(commandData, returnIndex, returnVector != vectorParameters.end());
writeFunctionHeader(ofs, indentation, returnType, functionName, commandData, returnIndex, templateIndex, vectorParameters); writeFunctionHeader(ofs, indentation, returnType, functionName, commandData, returnIndex, templateIndex, vectorParameters, false);
writeFunctionBody(ofs, indentation, className, functionName, returnType, templateIndex, dependencyData, commandData, vkTypes, returnIndex, vectorParameters); writeFunctionBody(ofs, indentation, className, functionName, returnType, templateIndex, dependencyData, commandData, vkTypes, returnIndex, vectorParameters, false);
if (hasSizedVectorParameter(vectorParameters, returnIndex))
{
ofs << std::endl;
writeFunctionHeader(ofs, indentation, returnType, functionName, commandData, returnIndex, templateIndex, vectorParameters, true);
writeFunctionBody(ofs, indentation, className, functionName, returnType, templateIndex, dependencyData, commandData, vkTypes, returnIndex, vectorParameters, true);
}
leaveProtect(ofs, commandData.protect); leaveProtect(ofs, commandData.protect);
} }

View File

@ -17654,6 +17654,11 @@ namespace vk
{ {
vkCmdSetViewport( m_commandBuffer, firstViewport, static_cast<uint32_t>( viewports.size() ), reinterpret_cast<const VkViewport*>( viewports.data() ) ); vkCmdSetViewport( m_commandBuffer, firstViewport, static_cast<uint32_t>( viewports.size() ), reinterpret_cast<const VkViewport*>( viewports.data() ) );
} }
void setViewport( uint32_t firstViewport, Viewport const & viewport ) const
{
vkCmdSetViewport( m_commandBuffer, firstViewport, 1, reinterpret_cast<const VkViewport*>( &viewport ) );
}
#endif /*VKCPP_ENHANCED_MODE*/ #endif /*VKCPP_ENHANCED_MODE*/
void setScissor( uint32_t firstScissor, uint32_t scissorCount, const Rect2D* pScissors ) const void setScissor( uint32_t firstScissor, uint32_t scissorCount, const Rect2D* pScissors ) const
@ -17666,6 +17671,11 @@ namespace vk
{ {
vkCmdSetScissor( m_commandBuffer, firstScissor, static_cast<uint32_t>( scissors.size() ), reinterpret_cast<const VkRect2D*>( scissors.data() ) ); vkCmdSetScissor( m_commandBuffer, firstScissor, static_cast<uint32_t>( scissors.size() ), reinterpret_cast<const VkRect2D*>( scissors.data() ) );
} }
void setScissor( uint32_t firstScissor, Rect2D const & scissor ) const
{
vkCmdSetScissor( m_commandBuffer, firstScissor, 1, reinterpret_cast<const VkRect2D*>( &scissor ) );
}
#endif /*VKCPP_ENHANCED_MODE*/ #endif /*VKCPP_ENHANCED_MODE*/
#ifndef VKCPP_ENHANCED_MODE #ifndef VKCPP_ENHANCED_MODE
@ -17776,6 +17786,11 @@ namespace vk
{ {
vkCmdBindDescriptorSets( m_commandBuffer, static_cast<VkPipelineBindPoint>( pipelineBindPoint ), static_cast<VkPipelineLayout>( layout ), firstSet, static_cast<uint32_t>( descriptorSets.size() ), reinterpret_cast<const VkDescriptorSet*>( descriptorSets.data() ), static_cast<uint32_t>( dynamicOffsets.size() ), dynamicOffsets.data() ); vkCmdBindDescriptorSets( m_commandBuffer, static_cast<VkPipelineBindPoint>( pipelineBindPoint ), static_cast<VkPipelineLayout>( layout ), firstSet, static_cast<uint32_t>( descriptorSets.size() ), reinterpret_cast<const VkDescriptorSet*>( descriptorSets.data() ), static_cast<uint32_t>( dynamicOffsets.size() ), dynamicOffsets.data() );
} }
void bindDescriptorSet( PipelineBindPoint pipelineBindPoint, PipelineLayout layout, uint32_t firstSet, DescriptorSet const & descriptorSet, uint32_t const & dynamicOffset ) const
{
vkCmdBindDescriptorSets( m_commandBuffer, static_cast<VkPipelineBindPoint>( pipelineBindPoint ), static_cast<VkPipelineLayout>( layout ), firstSet, 1, reinterpret_cast<const VkDescriptorSet*>( &descriptorSet ), 1, &dynamicOffset );
}
#endif /*VKCPP_ENHANCED_MODE*/ #endif /*VKCPP_ENHANCED_MODE*/
#ifndef VKCPP_ENHANCED_MODE #ifndef VKCPP_ENHANCED_MODE
@ -17806,6 +17821,11 @@ namespace vk
} }
vkCmdBindVertexBuffers( m_commandBuffer, firstBinding, static_cast<uint32_t>( buffers.size() ), reinterpret_cast<const VkBuffer*>( buffers.data() ), offsets.data() ); vkCmdBindVertexBuffers( m_commandBuffer, firstBinding, static_cast<uint32_t>( buffers.size() ), reinterpret_cast<const VkBuffer*>( buffers.data() ), offsets.data() );
} }
void bindVertexBuffer( uint32_t firstBinding, Buffer const & buffer, DeviceSize const & offset ) const
{
vkCmdBindVertexBuffers( m_commandBuffer, firstBinding, 1, reinterpret_cast<const VkBuffer*>( &buffer ), &offset );
}
#endif /*VKCPP_ENHANCED_MODE*/ #endif /*VKCPP_ENHANCED_MODE*/
#ifndef VKCPP_ENHANCED_MODE #ifndef VKCPP_ENHANCED_MODE
@ -17902,6 +17922,11 @@ namespace vk
{ {
vkCmdCopyBuffer( m_commandBuffer, static_cast<VkBuffer>( srcBuffer ), static_cast<VkBuffer>( dstBuffer ), static_cast<uint32_t>( regions.size() ), reinterpret_cast<const VkBufferCopy*>( regions.data() ) ); vkCmdCopyBuffer( m_commandBuffer, static_cast<VkBuffer>( srcBuffer ), static_cast<VkBuffer>( dstBuffer ), static_cast<uint32_t>( regions.size() ), reinterpret_cast<const VkBufferCopy*>( regions.data() ) );
} }
void copyBuffer( Buffer srcBuffer, Buffer dstBuffer, BufferCopy const & region ) const
{
vkCmdCopyBuffer( m_commandBuffer, static_cast<VkBuffer>( srcBuffer ), static_cast<VkBuffer>( dstBuffer ), 1, reinterpret_cast<const VkBufferCopy*>( &region ) );
}
#endif /*VKCPP_ENHANCED_MODE*/ #endif /*VKCPP_ENHANCED_MODE*/
void copyImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, uint32_t regionCount, const ImageCopy* pRegions ) const void copyImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, uint32_t regionCount, const ImageCopy* pRegions ) const
@ -17914,6 +17939,11 @@ namespace vk
{ {
vkCmdCopyImage( m_commandBuffer, static_cast<VkImage>( srcImage ), static_cast<VkImageLayout>( srcImageLayout ), static_cast<VkImage>( dstImage ), static_cast<VkImageLayout>( dstImageLayout ), static_cast<uint32_t>( regions.size() ), reinterpret_cast<const VkImageCopy*>( regions.data() ) ); vkCmdCopyImage( m_commandBuffer, static_cast<VkImage>( srcImage ), static_cast<VkImageLayout>( srcImageLayout ), static_cast<VkImage>( dstImage ), static_cast<VkImageLayout>( dstImageLayout ), static_cast<uint32_t>( regions.size() ), reinterpret_cast<const VkImageCopy*>( regions.data() ) );
} }
void copyImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, ImageCopy const & region ) const
{
vkCmdCopyImage( m_commandBuffer, static_cast<VkImage>( srcImage ), static_cast<VkImageLayout>( srcImageLayout ), static_cast<VkImage>( dstImage ), static_cast<VkImageLayout>( dstImageLayout ), 1, reinterpret_cast<const VkImageCopy*>( &region ) );
}
#endif /*VKCPP_ENHANCED_MODE*/ #endif /*VKCPP_ENHANCED_MODE*/
void blitImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, uint32_t regionCount, const ImageBlit* pRegions, Filter filter ) const void blitImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, uint32_t regionCount, const ImageBlit* pRegions, Filter filter ) const
@ -17926,6 +17956,11 @@ namespace vk
{ {
vkCmdBlitImage( m_commandBuffer, static_cast<VkImage>( srcImage ), static_cast<VkImageLayout>( srcImageLayout ), static_cast<VkImage>( dstImage ), static_cast<VkImageLayout>( dstImageLayout ), static_cast<uint32_t>( regions.size() ), reinterpret_cast<const VkImageBlit*>( regions.data() ), static_cast<VkFilter>( filter ) ); vkCmdBlitImage( m_commandBuffer, static_cast<VkImage>( srcImage ), static_cast<VkImageLayout>( srcImageLayout ), static_cast<VkImage>( dstImage ), static_cast<VkImageLayout>( dstImageLayout ), static_cast<uint32_t>( regions.size() ), reinterpret_cast<const VkImageBlit*>( regions.data() ), static_cast<VkFilter>( filter ) );
} }
void blitImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, ImageBlit const & region, Filter filter ) const
{
vkCmdBlitImage( m_commandBuffer, static_cast<VkImage>( srcImage ), static_cast<VkImageLayout>( srcImageLayout ), static_cast<VkImage>( dstImage ), static_cast<VkImageLayout>( dstImageLayout ), 1, reinterpret_cast<const VkImageBlit*>( &region ), static_cast<VkFilter>( filter ) );
}
#endif /*VKCPP_ENHANCED_MODE*/ #endif /*VKCPP_ENHANCED_MODE*/
void copyBufferToImage( Buffer srcBuffer, Image dstImage, ImageLayout dstImageLayout, uint32_t regionCount, const BufferImageCopy* pRegions ) const void copyBufferToImage( Buffer srcBuffer, Image dstImage, ImageLayout dstImageLayout, uint32_t regionCount, const BufferImageCopy* pRegions ) const
@ -17938,6 +17973,11 @@ namespace vk
{ {
vkCmdCopyBufferToImage( m_commandBuffer, static_cast<VkBuffer>( srcBuffer ), static_cast<VkImage>( dstImage ), static_cast<VkImageLayout>( dstImageLayout ), static_cast<uint32_t>( regions.size() ), reinterpret_cast<const VkBufferImageCopy*>( regions.data() ) ); vkCmdCopyBufferToImage( m_commandBuffer, static_cast<VkBuffer>( srcBuffer ), static_cast<VkImage>( dstImage ), static_cast<VkImageLayout>( dstImageLayout ), static_cast<uint32_t>( regions.size() ), reinterpret_cast<const VkBufferImageCopy*>( regions.data() ) );
} }
void copyBufferToImage( Buffer srcBuffer, Image dstImage, ImageLayout dstImageLayout, BufferImageCopy const & region ) const
{
vkCmdCopyBufferToImage( m_commandBuffer, static_cast<VkBuffer>( srcBuffer ), static_cast<VkImage>( dstImage ), static_cast<VkImageLayout>( dstImageLayout ), 1, reinterpret_cast<const VkBufferImageCopy*>( &region ) );
}
#endif /*VKCPP_ENHANCED_MODE*/ #endif /*VKCPP_ENHANCED_MODE*/
void copyImageToBuffer( Image srcImage, ImageLayout srcImageLayout, Buffer dstBuffer, uint32_t regionCount, const BufferImageCopy* pRegions ) const void copyImageToBuffer( Image srcImage, ImageLayout srcImageLayout, Buffer dstBuffer, uint32_t regionCount, const BufferImageCopy* pRegions ) const
@ -17950,6 +17990,11 @@ namespace vk
{ {
vkCmdCopyImageToBuffer( m_commandBuffer, static_cast<VkImage>( srcImage ), static_cast<VkImageLayout>( srcImageLayout ), static_cast<VkBuffer>( dstBuffer ), static_cast<uint32_t>( regions.size() ), reinterpret_cast<const VkBufferImageCopy*>( regions.data() ) ); vkCmdCopyImageToBuffer( m_commandBuffer, static_cast<VkImage>( srcImage ), static_cast<VkImageLayout>( srcImageLayout ), static_cast<VkBuffer>( dstBuffer ), static_cast<uint32_t>( regions.size() ), reinterpret_cast<const VkBufferImageCopy*>( regions.data() ) );
} }
void copyImageToBuffer( Image srcImage, ImageLayout srcImageLayout, Buffer dstBuffer, BufferImageCopy const & region ) const
{
vkCmdCopyImageToBuffer( m_commandBuffer, static_cast<VkImage>( srcImage ), static_cast<VkImageLayout>( srcImageLayout ), static_cast<VkBuffer>( dstBuffer ), 1, reinterpret_cast<const VkBufferImageCopy*>( &region ) );
}
#endif /*VKCPP_ENHANCED_MODE*/ #endif /*VKCPP_ENHANCED_MODE*/
void updateBuffer( Buffer dstBuffer, DeviceSize dstOffset, DeviceSize dataSize, const uint32_t* pData ) const void updateBuffer( Buffer dstBuffer, DeviceSize dstOffset, DeviceSize dataSize, const uint32_t* pData ) const
@ -17990,6 +18035,11 @@ namespace vk
{ {
vkCmdClearColorImage( m_commandBuffer, static_cast<VkImage>( image ), static_cast<VkImageLayout>( imageLayout ), reinterpret_cast<const VkClearColorValue*>( &color ), static_cast<uint32_t>( ranges.size() ), reinterpret_cast<const VkImageSubresourceRange*>( ranges.data() ) ); vkCmdClearColorImage( m_commandBuffer, static_cast<VkImage>( image ), static_cast<VkImageLayout>( imageLayout ), reinterpret_cast<const VkClearColorValue*>( &color ), static_cast<uint32_t>( ranges.size() ), reinterpret_cast<const VkImageSubresourceRange*>( ranges.data() ) );
} }
void clearColorImage( Image image, ImageLayout imageLayout, const ClearColorValue & color, ImageSubresourceRange const & range ) const
{
vkCmdClearColorImage( m_commandBuffer, static_cast<VkImage>( image ), static_cast<VkImageLayout>( imageLayout ), reinterpret_cast<const VkClearColorValue*>( &color ), 1, reinterpret_cast<const VkImageSubresourceRange*>( &range ) );
}
#endif /*VKCPP_ENHANCED_MODE*/ #endif /*VKCPP_ENHANCED_MODE*/
void clearDepthStencilImage( Image image, ImageLayout imageLayout, const ClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, const ImageSubresourceRange* pRanges ) const void clearDepthStencilImage( Image image, ImageLayout imageLayout, const ClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, const ImageSubresourceRange* pRanges ) const
@ -18002,6 +18052,11 @@ namespace vk
{ {
vkCmdClearDepthStencilImage( m_commandBuffer, static_cast<VkImage>( image ), static_cast<VkImageLayout>( imageLayout ), reinterpret_cast<const VkClearDepthStencilValue*>( &depthStencil ), static_cast<uint32_t>( ranges.size() ), reinterpret_cast<const VkImageSubresourceRange*>( ranges.data() ) ); vkCmdClearDepthStencilImage( m_commandBuffer, static_cast<VkImage>( image ), static_cast<VkImageLayout>( imageLayout ), reinterpret_cast<const VkClearDepthStencilValue*>( &depthStencil ), static_cast<uint32_t>( ranges.size() ), reinterpret_cast<const VkImageSubresourceRange*>( ranges.data() ) );
} }
void clearDepthStencilImage( Image image, ImageLayout imageLayout, const ClearDepthStencilValue & depthStencil, ImageSubresourceRange const & range ) const
{
vkCmdClearDepthStencilImage( m_commandBuffer, static_cast<VkImage>( image ), static_cast<VkImageLayout>( imageLayout ), reinterpret_cast<const VkClearDepthStencilValue*>( &depthStencil ), 1, reinterpret_cast<const VkImageSubresourceRange*>( &range ) );
}
#endif /*VKCPP_ENHANCED_MODE*/ #endif /*VKCPP_ENHANCED_MODE*/
void clearAttachments( uint32_t attachmentCount, const ClearAttachment* pAttachments, uint32_t rectCount, const ClearRect* pRects ) const void clearAttachments( uint32_t attachmentCount, const ClearAttachment* pAttachments, uint32_t rectCount, const ClearRect* pRects ) const
@ -18014,6 +18069,11 @@ namespace vk
{ {
vkCmdClearAttachments( m_commandBuffer, static_cast<uint32_t>( attachments.size() ), reinterpret_cast<const VkClearAttachment*>( attachments.data() ), static_cast<uint32_t>( rects.size() ), reinterpret_cast<const VkClearRect*>( rects.data() ) ); vkCmdClearAttachments( m_commandBuffer, static_cast<uint32_t>( attachments.size() ), reinterpret_cast<const VkClearAttachment*>( attachments.data() ), static_cast<uint32_t>( rects.size() ), reinterpret_cast<const VkClearRect*>( rects.data() ) );
} }
void clearAttachment( ClearAttachment const & attachment, ClearRect const & rect ) const
{
vkCmdClearAttachments( m_commandBuffer, 1, reinterpret_cast<const VkClearAttachment*>( &attachment ), 1, reinterpret_cast<const VkClearRect*>( &rect ) );
}
#endif /*VKCPP_ENHANCED_MODE*/ #endif /*VKCPP_ENHANCED_MODE*/
void resolveImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, uint32_t regionCount, const ImageResolve* pRegions ) const void resolveImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, uint32_t regionCount, const ImageResolve* pRegions ) const
@ -18026,6 +18086,11 @@ namespace vk
{ {
vkCmdResolveImage( m_commandBuffer, static_cast<VkImage>( srcImage ), static_cast<VkImageLayout>( srcImageLayout ), static_cast<VkImage>( dstImage ), static_cast<VkImageLayout>( dstImageLayout ), static_cast<uint32_t>( regions.size() ), reinterpret_cast<const VkImageResolve*>( regions.data() ) ); vkCmdResolveImage( m_commandBuffer, static_cast<VkImage>( srcImage ), static_cast<VkImageLayout>( srcImageLayout ), static_cast<VkImage>( dstImage ), static_cast<VkImageLayout>( dstImageLayout ), static_cast<uint32_t>( regions.size() ), reinterpret_cast<const VkImageResolve*>( regions.data() ) );
} }
void resolveImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, ImageResolve const & region ) const
{
vkCmdResolveImage( m_commandBuffer, static_cast<VkImage>( srcImage ), static_cast<VkImageLayout>( srcImageLayout ), static_cast<VkImage>( dstImage ), static_cast<VkImageLayout>( dstImageLayout ), 1, reinterpret_cast<const VkImageResolve*>( &region ) );
}
#endif /*VKCPP_ENHANCED_MODE*/ #endif /*VKCPP_ENHANCED_MODE*/
#ifndef VKCPP_ENHANCED_MODE #ifndef VKCPP_ENHANCED_MODE
@ -18066,6 +18131,11 @@ namespace vk
{ {
vkCmdWaitEvents( m_commandBuffer, static_cast<uint32_t>( events.size() ), reinterpret_cast<const VkEvent*>( events.data() ), static_cast<VkPipelineStageFlags>( srcStageMask ), static_cast<VkPipelineStageFlags>( dstStageMask ), static_cast<uint32_t>( memoryBarriers.size() ), reinterpret_cast<const VkMemoryBarrier*>( memoryBarriers.data() ), static_cast<uint32_t>( bufferMemoryBarriers.size() ), reinterpret_cast<const VkBufferMemoryBarrier*>( bufferMemoryBarriers.data() ), static_cast<uint32_t>( imageMemoryBarriers.size() ), reinterpret_cast<const VkImageMemoryBarrier*>( imageMemoryBarriers.data() ) ); vkCmdWaitEvents( m_commandBuffer, static_cast<uint32_t>( events.size() ), reinterpret_cast<const VkEvent*>( events.data() ), static_cast<VkPipelineStageFlags>( srcStageMask ), static_cast<VkPipelineStageFlags>( dstStageMask ), static_cast<uint32_t>( memoryBarriers.size() ), reinterpret_cast<const VkMemoryBarrier*>( memoryBarriers.data() ), static_cast<uint32_t>( bufferMemoryBarriers.size() ), reinterpret_cast<const VkBufferMemoryBarrier*>( bufferMemoryBarriers.data() ), static_cast<uint32_t>( imageMemoryBarriers.size() ), reinterpret_cast<const VkImageMemoryBarrier*>( imageMemoryBarriers.data() ) );
} }
void waitEvent( Event const & event, PipelineStageFlags srcStageMask, PipelineStageFlags dstStageMask, MemoryBarrier const & memoryBarrier, BufferMemoryBarrier const & bufferMemoryBarrier, ImageMemoryBarrier const & imageMemoryBarrier ) const
{
vkCmdWaitEvents( m_commandBuffer, 1, reinterpret_cast<const VkEvent*>( &event ), static_cast<VkPipelineStageFlags>( srcStageMask ), static_cast<VkPipelineStageFlags>( dstStageMask ), 1, reinterpret_cast<const VkMemoryBarrier*>( &memoryBarrier ), 1, reinterpret_cast<const VkBufferMemoryBarrier*>( &bufferMemoryBarrier ), 1, reinterpret_cast<const VkImageMemoryBarrier*>( &imageMemoryBarrier ) );
}
#endif /*VKCPP_ENHANCED_MODE*/ #endif /*VKCPP_ENHANCED_MODE*/
void pipelineBarrier( PipelineStageFlags srcStageMask, PipelineStageFlags dstStageMask, DependencyFlags dependencyFlags, uint32_t memoryBarrierCount, const MemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const BufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const ImageMemoryBarrier* pImageMemoryBarriers ) const void pipelineBarrier( PipelineStageFlags srcStageMask, PipelineStageFlags dstStageMask, DependencyFlags dependencyFlags, uint32_t memoryBarrierCount, const MemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const BufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const ImageMemoryBarrier* pImageMemoryBarriers ) const
@ -18078,6 +18148,11 @@ namespace vk
{ {
vkCmdPipelineBarrier( m_commandBuffer, static_cast<VkPipelineStageFlags>( srcStageMask ), static_cast<VkPipelineStageFlags>( dstStageMask ), static_cast<VkDependencyFlags>( dependencyFlags ), static_cast<uint32_t>( memoryBarriers.size() ), reinterpret_cast<const VkMemoryBarrier*>( memoryBarriers.data() ), static_cast<uint32_t>( bufferMemoryBarriers.size() ), reinterpret_cast<const VkBufferMemoryBarrier*>( bufferMemoryBarriers.data() ), static_cast<uint32_t>( imageMemoryBarriers.size() ), reinterpret_cast<const VkImageMemoryBarrier*>( imageMemoryBarriers.data() ) ); vkCmdPipelineBarrier( m_commandBuffer, static_cast<VkPipelineStageFlags>( srcStageMask ), static_cast<VkPipelineStageFlags>( dstStageMask ), static_cast<VkDependencyFlags>( dependencyFlags ), static_cast<uint32_t>( memoryBarriers.size() ), reinterpret_cast<const VkMemoryBarrier*>( memoryBarriers.data() ), static_cast<uint32_t>( bufferMemoryBarriers.size() ), reinterpret_cast<const VkBufferMemoryBarrier*>( bufferMemoryBarriers.data() ), static_cast<uint32_t>( imageMemoryBarriers.size() ), reinterpret_cast<const VkImageMemoryBarrier*>( imageMemoryBarriers.data() ) );
} }
void pipelineBarrier( PipelineStageFlags srcStageMask, PipelineStageFlags dstStageMask, DependencyFlags dependencyFlags, MemoryBarrier const & memoryBarrier, BufferMemoryBarrier const & bufferMemoryBarrier, ImageMemoryBarrier const & imageMemoryBarrier ) const
{
vkCmdPipelineBarrier( m_commandBuffer, static_cast<VkPipelineStageFlags>( srcStageMask ), static_cast<VkPipelineStageFlags>( dstStageMask ), static_cast<VkDependencyFlags>( dependencyFlags ), 1, reinterpret_cast<const VkMemoryBarrier*>( &memoryBarrier ), 1, reinterpret_cast<const VkBufferMemoryBarrier*>( &bufferMemoryBarrier ), 1, reinterpret_cast<const VkImageMemoryBarrier*>( &imageMemoryBarrier ) );
}
#endif /*VKCPP_ENHANCED_MODE*/ #endif /*VKCPP_ENHANCED_MODE*/
#ifndef VKCPP_ENHANCED_MODE #ifndef VKCPP_ENHANCED_MODE
@ -18160,6 +18235,11 @@ namespace vk
{ {
vkCmdPushConstants( m_commandBuffer, static_cast<VkPipelineLayout>( layout ), static_cast<VkShaderStageFlags>( stageFlags ), offset, static_cast<uint32_t>( values.size() ), values.data() ); vkCmdPushConstants( m_commandBuffer, static_cast<VkPipelineLayout>( layout ), static_cast<VkShaderStageFlags>( stageFlags ), offset, static_cast<uint32_t>( values.size() ), values.data() );
} }
void pushConstant( PipelineLayout layout, ShaderStageFlags stageFlags, uint32_t offset, std::vector<uint8_t> const & value ) const
{
vkCmdPushConstants( m_commandBuffer, static_cast<VkPipelineLayout>( layout ), static_cast<VkShaderStageFlags>( stageFlags ), offset, 1, &value );
}
#endif /*VKCPP_ENHANCED_MODE*/ #endif /*VKCPP_ENHANCED_MODE*/
void beginRenderPass( const RenderPassBeginInfo* pRenderPassBegin, SubpassContents contents ) const void beginRenderPass( const RenderPassBeginInfo* pRenderPassBegin, SubpassContents contents ) const
@ -18212,6 +18292,11 @@ namespace vk
{ {
vkCmdExecuteCommands( m_commandBuffer, static_cast<uint32_t>( commandBuffers.size() ), reinterpret_cast<const VkCommandBuffer*>( commandBuffers.data() ) ); vkCmdExecuteCommands( m_commandBuffer, static_cast<uint32_t>( commandBuffers.size() ), reinterpret_cast<const VkCommandBuffer*>( commandBuffers.data() ) );
} }
void executeCommand( CommandBuffer const & commandBuffer ) const
{
vkCmdExecuteCommands( m_commandBuffer, 1, reinterpret_cast<const VkCommandBuffer*>( &commandBuffer ) );
}
#endif /*VKCPP_ENHANCED_MODE*/ #endif /*VKCPP_ENHANCED_MODE*/
#if !defined(VK_CPP_TYPESAFE_CONVERSION) #if !defined(VK_CPP_TYPESAFE_CONVERSION)
@ -18791,6 +18876,15 @@ namespace vk
throw std::system_error( result, "vk::Queue::submit" ); throw std::system_error( result, "vk::Queue::submit" );
} }
} }
void submit( SubmitInfo const & submit, Fence fence ) const
{
Result result = static_cast<Result>( vkQueueSubmit( m_queue, 1, reinterpret_cast<const VkSubmitInfo*>( &submit ), static_cast<VkFence>( fence ) ) );
if ( result != Result::eSuccess )
{
throw std::system_error( result, "vk::Queue::submit" );
}
}
#endif /*VKCPP_ENHANCED_MODE*/ #endif /*VKCPP_ENHANCED_MODE*/
#ifndef VKCPP_ENHANCED_MODE #ifndef VKCPP_ENHANCED_MODE
@ -18825,6 +18919,15 @@ namespace vk
throw std::system_error( result, "vk::Queue::bindSparse" ); throw std::system_error( result, "vk::Queue::bindSparse" );
} }
} }
void bindSparse( BindSparseInfo const & bindInfo, Fence fence ) const
{
Result result = static_cast<Result>( vkQueueBindSparse( m_queue, 1, reinterpret_cast<const VkBindSparseInfo*>( &bindInfo ), static_cast<VkFence>( fence ) ) );
if ( result != Result::eSuccess )
{
throw std::system_error( result, "vk::Queue::bindSparse" );
}
}
#endif /*VKCPP_ENHANCED_MODE*/ #endif /*VKCPP_ENHANCED_MODE*/
Result presentKHR( const PresentInfoKHR* pPresentInfo ) const Result presentKHR( const PresentInfoKHR* pPresentInfo ) const
@ -20227,6 +20330,15 @@ namespace vk
throw std::system_error( result, "vk::Device::flushMappedMemoryRanges" ); throw std::system_error( result, "vk::Device::flushMappedMemoryRanges" );
} }
} }
void flushMappedMemoryRange( MappedMemoryRange const & memoryRange ) const
{
Result result = static_cast<Result>( vkFlushMappedMemoryRanges( m_device, 1, reinterpret_cast<const VkMappedMemoryRange*>( &memoryRange ) ) );
if ( result != Result::eSuccess )
{
throw std::system_error( result, "vk::Device::flushMappedMemoryRanges" );
}
}
#endif /*VKCPP_ENHANCED_MODE*/ #endif /*VKCPP_ENHANCED_MODE*/
Result invalidateMappedMemoryRanges( uint32_t memoryRangeCount, const MappedMemoryRange* pMemoryRanges ) const Result invalidateMappedMemoryRanges( uint32_t memoryRangeCount, const MappedMemoryRange* pMemoryRanges ) const
@ -20243,6 +20355,15 @@ namespace vk
throw std::system_error( result, "vk::Device::invalidateMappedMemoryRanges" ); throw std::system_error( result, "vk::Device::invalidateMappedMemoryRanges" );
} }
} }
void invalidateMappedMemoryRange( MappedMemoryRange const & memoryRange ) const
{
Result result = static_cast<Result>( vkInvalidateMappedMemoryRanges( m_device, 1, reinterpret_cast<const VkMappedMemoryRange*>( &memoryRange ) ) );
if ( result != Result::eSuccess )
{
throw std::system_error( result, "vk::Device::invalidateMappedMemoryRanges" );
}
}
#endif /*VKCPP_ENHANCED_MODE*/ #endif /*VKCPP_ENHANCED_MODE*/
void getMemoryCommitment( DeviceMemory memory, DeviceSize* pCommittedMemoryInBytes ) const void getMemoryCommitment( DeviceMemory memory, DeviceSize* pCommittedMemoryInBytes ) const
@ -20384,6 +20505,15 @@ namespace vk
throw std::system_error( result, "vk::Device::resetFences" ); throw std::system_error( result, "vk::Device::resetFences" );
} }
} }
void resetFence( Fence const & fence ) const
{
Result result = static_cast<Result>( vkResetFences( m_device, 1, reinterpret_cast<const VkFence*>( &fence ) ) );
if ( result != Result::eSuccess )
{
throw std::system_error( result, "vk::Device::resetFences" );
}
}
#endif /*VKCPP_ENHANCED_MODE*/ #endif /*VKCPP_ENHANCED_MODE*/
#ifndef VKCPP_ENHANCED_MODE #ifndef VKCPP_ENHANCED_MODE
@ -20420,6 +20550,16 @@ namespace vk
} }
return result; return result;
} }
Result waitForFence( Fence const & fence, Bool32 waitAll, uint64_t timeout ) const
{
Result result = static_cast<Result>( vkWaitForFences( m_device, 1, reinterpret_cast<const VkFence*>( &fence ), waitAll, timeout ) );
if ( ( result != Result::eSuccess ) && ( result != Result::eTimeout ) )
{
throw std::system_error( result, "vk::Device::waitForFences" );
}
return result;
}
#endif /*VKCPP_ENHANCED_MODE*/ #endif /*VKCPP_ENHANCED_MODE*/
Result createSemaphore( const SemaphoreCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Semaphore* pSemaphore ) const Result createSemaphore( const SemaphoreCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Semaphore* pSemaphore ) const
@ -20817,6 +20957,15 @@ namespace vk
throw std::system_error( result, "vk::Device::mergePipelineCaches" ); throw std::system_error( result, "vk::Device::mergePipelineCaches" );
} }
} }
void mergePipelineCache( PipelineCache dstCache, PipelineCache const & srcCache ) const
{
Result result = static_cast<Result>( vkMergePipelineCaches( m_device, static_cast<VkPipelineCache>( dstCache ), 1, reinterpret_cast<const VkPipelineCache*>( &srcCache ) ) );
if ( result != Result::eSuccess )
{
throw std::system_error( result, "vk::Device::mergePipelineCaches" );
}
}
#endif /*VKCPP_ENHANCED_MODE*/ #endif /*VKCPP_ENHANCED_MODE*/
Result createGraphicsPipelines( PipelineCache pipelineCache, uint32_t createInfoCount, const GraphicsPipelineCreateInfo* pCreateInfos, const AllocationCallbacks* pAllocator, Pipeline* pPipelines ) const Result createGraphicsPipelines( PipelineCache pipelineCache, uint32_t createInfoCount, const GraphicsPipelineCreateInfo* pCreateInfos, const AllocationCallbacks* pAllocator, Pipeline* pPipelines ) const
@ -20835,6 +20984,17 @@ namespace vk
} }
return pipelines; return pipelines;
} }
Pipeline createGraphicsPipeline( PipelineCache pipelineCache, GraphicsPipelineCreateInfo const & createInfo, Optional<const AllocationCallbacks> const & allocator = nullptr ) const
{
Pipeline pipeline;
Result result = static_cast<Result>( vkCreateGraphicsPipelines( m_device, static_cast<VkPipelineCache>( pipelineCache ), 1, reinterpret_cast<const VkGraphicsPipelineCreateInfo*>( &createInfo ), reinterpret_cast<const VkAllocationCallbacks*>( static_cast<const AllocationCallbacks*>( allocator)), reinterpret_cast<VkPipeline*>( &pipeline ) ) );
if ( result != Result::eSuccess )
{
throw std::system_error( result, "vk::Device::createGraphicsPipelines" );
}
return pipeline;
}
#endif /*VKCPP_ENHANCED_MODE*/ #endif /*VKCPP_ENHANCED_MODE*/
Result createComputePipelines( PipelineCache pipelineCache, uint32_t createInfoCount, const ComputePipelineCreateInfo* pCreateInfos, const AllocationCallbacks* pAllocator, Pipeline* pPipelines ) const Result createComputePipelines( PipelineCache pipelineCache, uint32_t createInfoCount, const ComputePipelineCreateInfo* pCreateInfos, const AllocationCallbacks* pAllocator, Pipeline* pPipelines ) const
@ -20853,6 +21013,17 @@ namespace vk
} }
return pipelines; return pipelines;
} }
Pipeline createComputePipeline( PipelineCache pipelineCache, ComputePipelineCreateInfo const & createInfo, Optional<const AllocationCallbacks> const & allocator = nullptr ) const
{
Pipeline pipeline;
Result result = static_cast<Result>( vkCreateComputePipelines( m_device, static_cast<VkPipelineCache>( pipelineCache ), 1, reinterpret_cast<const VkComputePipelineCreateInfo*>( &createInfo ), reinterpret_cast<const VkAllocationCallbacks*>( static_cast<const AllocationCallbacks*>( allocator)), reinterpret_cast<VkPipeline*>( &pipeline ) ) );
if ( result != Result::eSuccess )
{
throw std::system_error( result, "vk::Device::createComputePipelines" );
}
return pipeline;
}
#endif /*VKCPP_ENHANCED_MODE*/ #endif /*VKCPP_ENHANCED_MODE*/
void destroyPipeline( Pipeline pipeline, const AllocationCallbacks* pAllocator ) const void destroyPipeline( Pipeline pipeline, const AllocationCallbacks* pAllocator ) const
@ -21037,6 +21208,15 @@ namespace vk
throw std::system_error( result, "vk::Device::freeDescriptorSets" ); throw std::system_error( result, "vk::Device::freeDescriptorSets" );
} }
} }
void freeDescriptorSet( DescriptorPool descriptorPool, DescriptorSet const & descriptorSet ) const
{
Result result = static_cast<Result>( vkFreeDescriptorSets( m_device, static_cast<VkDescriptorPool>( descriptorPool ), 1, reinterpret_cast<const VkDescriptorSet*>( &descriptorSet ) ) );
if ( result != Result::eSuccess )
{
throw std::system_error( result, "vk::Device::freeDescriptorSets" );
}
}
#endif /*VKCPP_ENHANCED_MODE*/ #endif /*VKCPP_ENHANCED_MODE*/
void updateDescriptorSets( uint32_t descriptorWriteCount, const WriteDescriptorSet* pDescriptorWrites, uint32_t descriptorCopyCount, const CopyDescriptorSet* pDescriptorCopies ) const void updateDescriptorSets( uint32_t descriptorWriteCount, const WriteDescriptorSet* pDescriptorWrites, uint32_t descriptorCopyCount, const CopyDescriptorSet* pDescriptorCopies ) const
@ -21049,6 +21229,11 @@ namespace vk
{ {
vkUpdateDescriptorSets( m_device, static_cast<uint32_t>( descriptorWrites.size() ), reinterpret_cast<const VkWriteDescriptorSet*>( descriptorWrites.data() ), static_cast<uint32_t>( descriptorCopies.size() ), reinterpret_cast<const VkCopyDescriptorSet*>( descriptorCopies.data() ) ); vkUpdateDescriptorSets( m_device, static_cast<uint32_t>( descriptorWrites.size() ), reinterpret_cast<const VkWriteDescriptorSet*>( descriptorWrites.data() ), static_cast<uint32_t>( descriptorCopies.size() ), reinterpret_cast<const VkCopyDescriptorSet*>( descriptorCopies.data() ) );
} }
void updateDescriptorSet( WriteDescriptorSet const & descriptorWrite, CopyDescriptorSet const & descriptorCopie ) const
{
vkUpdateDescriptorSets( m_device, 1, reinterpret_cast<const VkWriteDescriptorSet*>( &descriptorWrite ), 1, reinterpret_cast<const VkCopyDescriptorSet*>( &descriptorCopie ) );
}
#endif /*VKCPP_ENHANCED_MODE*/ #endif /*VKCPP_ENHANCED_MODE*/
Result createFramebuffer( const FramebufferCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Framebuffer* pFramebuffer ) const Result createFramebuffer( const FramebufferCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Framebuffer* pFramebuffer ) const
@ -21201,6 +21386,11 @@ namespace vk
{ {
vkFreeCommandBuffers( m_device, static_cast<VkCommandPool>( commandPool ), static_cast<uint32_t>( commandBuffers.size() ), reinterpret_cast<const VkCommandBuffer*>( commandBuffers.data() ) ); vkFreeCommandBuffers( m_device, static_cast<VkCommandPool>( commandPool ), static_cast<uint32_t>( commandBuffers.size() ), reinterpret_cast<const VkCommandBuffer*>( commandBuffers.data() ) );
} }
void freeCommandBuffer( CommandPool commandPool, CommandBuffer const & commandBuffer ) const
{
vkFreeCommandBuffers( m_device, static_cast<VkCommandPool>( commandPool ), 1, reinterpret_cast<const VkCommandBuffer*>( &commandBuffer ) );
}
#endif /*VKCPP_ENHANCED_MODE*/ #endif /*VKCPP_ENHANCED_MODE*/
Result createSharedSwapchainsKHR( uint32_t swapchainCount, const SwapchainCreateInfoKHR* pCreateInfos, const AllocationCallbacks* pAllocator, SwapchainKHR* pSwapchains ) const Result createSharedSwapchainsKHR( uint32_t swapchainCount, const SwapchainCreateInfoKHR* pCreateInfos, const AllocationCallbacks* pAllocator, SwapchainKHR* pSwapchains ) const
@ -21219,6 +21409,17 @@ namespace vk
} }
return swapchains; return swapchains;
} }
SwapchainKHR createSharedSwapchainsKHR( SwapchainCreateInfoKHR const & createInfo, Optional<const AllocationCallbacks> const & allocator = nullptr ) const
{
SwapchainKHR swapchain;
Result result = static_cast<Result>( vkCreateSharedSwapchainsKHR( m_device, 1, reinterpret_cast<const VkSwapchainCreateInfoKHR*>( &createInfo ), reinterpret_cast<const VkAllocationCallbacks*>( static_cast<const AllocationCallbacks*>( allocator)), reinterpret_cast<VkSwapchainKHR*>( &swapchain ) ) );
if ( result != Result::eSuccess )
{
throw std::system_error( result, "vk::Device::createSharedSwapchainsKHR" );
}
return swapchain;
}
#endif /*VKCPP_ENHANCED_MODE*/ #endif /*VKCPP_ENHANCED_MODE*/
Result createSwapchainKHR( const SwapchainCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SwapchainKHR* pSwapchain ) const Result createSwapchainKHR( const SwapchainCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SwapchainKHR* pSwapchain ) const