mirror of
https://github.com/KhronosGroup/Vulkan-Hpp.git
synced 2024-10-14 16:32:17 +00:00
changed enhanced version of CommandBuffer::pushConstants to be templated by value type, corrected CommandBuffer::pushConstant to be templated by value type as well
This commit is contained in:
parent
ab89b93948
commit
4d67b6d1a5
@ -603,7 +603,7 @@ size_t findTemplateIndex(CommandData const& commandData, std::map<size_t, size_t
|
|||||||
{
|
{
|
||||||
for (size_t i = 0; i < commandData.arguments.size(); i++)
|
for (size_t i = 0; i < commandData.arguments.size(); i++)
|
||||||
{
|
{
|
||||||
if (commandData.arguments[i].name == "pData")
|
if ((commandData.arguments[i].name == "pData") || (commandData.arguments[i].name == "pValues"))
|
||||||
{
|
{
|
||||||
assert(vectorParameters.find(i) != vectorParameters.end());
|
assert(vectorParameters.find(i) != vectorParameters.end());
|
||||||
return i;
|
return i;
|
||||||
|
@ -18231,14 +18231,16 @@ namespace vk
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef VKCPP_ENHANCED_MODE
|
#ifdef VKCPP_ENHANCED_MODE
|
||||||
void pushConstants( PipelineLayout layout, ShaderStageFlags stageFlags, uint32_t offset, std::vector<uint8_t> const & values ) const
|
template <typename T>
|
||||||
|
void pushConstants( PipelineLayout layout, ShaderStageFlags stageFlags, uint32_t offset, std::vector<T> const & values ) const
|
||||||
{
|
{
|
||||||
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() * sizeof( T ) ), reinterpret_cast<const void*>( values.data() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void pushConstant( PipelineLayout layout, ShaderStageFlags stageFlags, uint32_t offset, std::vector<uint8_t> const & value ) const
|
template <typename T>
|
||||||
|
void pushConstant( PipelineLayout layout, ShaderStageFlags stageFlags, uint32_t offset, T const & value ) const
|
||||||
{
|
{
|
||||||
vkCmdPushConstants( m_commandBuffer, static_cast<VkPipelineLayout>( layout ), static_cast<VkShaderStageFlags>( stageFlags ), offset, 1, &value );
|
vkCmdPushConstants( m_commandBuffer, static_cast<VkPipelineLayout>( layout ), static_cast<VkShaderStageFlags>( stageFlags ), offset, static_cast<uint32_t>( sizeof( T ) ), reinterpret_cast<const void*>( &value ) );
|
||||||
}
|
}
|
||||||
#endif /*VKCPP_ENHANCED_MODE*/
|
#endif /*VKCPP_ENHANCED_MODE*/
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user