diff --git a/kraken/KRPipeline.cpp b/kraken/KRPipeline.cpp index 650952e..e28e78c 100644 --- a/kraken/KRPipeline.cpp +++ b/kraken/KRPipeline.cpp @@ -651,11 +651,8 @@ void KRPipeline::updateDescriptorBinding() // Vulkan Refactoring } -bool KRPipeline::bind(KRNode::RenderInfo& ri, const Matrix4& matModel) +void KRPipeline::updatePushConstants(KRNode::RenderInfo& ri, const Matrix4& matModel) { - updateDescriptorBinding(); - updateDescriptorSets(); - bindDescriptorSets(ri.commandBuffer); setPushConstant(PushConstant::absolute_time, getContext().getAbsoluteTime()); int light_directional_count = 0; @@ -841,6 +838,14 @@ bool KRPipeline::bind(KRNode::RenderInfo& ri, const Matrix4& matModel) vkCmdPushConstants(ri.commandBuffer, pushConstants.layout, VK_SHADER_STAGE_VERTEX_BIT, 0, pushConstants.bufferSize, pushConstants.buffer); } } +} + +bool KRPipeline::bind(KRNode::RenderInfo& ri, const Matrix4& matModel) +{ + updateDescriptorBinding(); + updateDescriptorSets(); + bindDescriptorSets(ri.commandBuffer); + updatePushConstants(ri, matModel); if (ri.pipeline != this) { vkCmdBindPipeline(ri.commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, m_graphicsPipeline); diff --git a/kraken/KRPipeline.h b/kraken/KRPipeline.h index b2c5996..6140494 100644 --- a/kraken/KRPipeline.h +++ b/kraken/KRPipeline.h @@ -306,11 +306,12 @@ public: void setImageBinding(const std::string& name, KRTexture* texture, KRSampler* sampler); VkPipeline& getPipeline(); - void updateDescriptorBinding(); - void updateDescriptorSets(); void bindDescriptorSets(VkCommandBuffer& commandBuffer); private: + void updateDescriptorBinding(); + void updateDescriptorSets(); + void updatePushConstants(KRNode::RenderInfo& ri, const hydra::Matrix4& matModel); static const char* KRENGINE_PUSH_CONSTANT_NAMES[]; struct PushConstantInfo