mirror of
https://github.com/KhronosGroup/Vulkan-Hpp.git
synced 2024-10-14 16:32:17 +00:00
Merge pull request #96 from asuessenbach/singular_fix
changed enhanced version of CommandBuffer::pushConstants to be templa…
This commit is contained in:
commit
757d3b7aed
@ -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++)
|
||||
{
|
||||
if (commandData.arguments[i].name == "pData")
|
||||
if ((commandData.arguments[i].name == "pData") || (commandData.arguments[i].name == "pValues"))
|
||||
{
|
||||
assert(vectorParameters.find(i) != vectorParameters.end());
|
||||
return i;
|
||||
|
@ -18231,14 +18231,16 @@ namespace vk
|
||||
}
|
||||
|
||||
#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*/
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user