diff --git a/kraken/KRPipeline.cpp b/kraken/KRPipeline.cpp index a075c75..a0054f5 100644 --- a/kraken/KRPipeline.cpp +++ b/kraken/KRPipeline.cpp @@ -585,7 +585,7 @@ bool KRPipeline::setPushConstants(const KRCamera* camera, const std::vector(location)] == sizeof(value)) { - float* constant = (float*)(pushConstants.buffer + pushConstants.offset[static_cast(location)]); - *constant = value; - } - } -} - - -void KRPipeline::setPushConstant(ShaderValue location, int value) -{ - for (StageInfo& stageInfo : m_stages) { - PushConstantInfo& pushConstants = stageInfo.pushConstants; - if (pushConstants.size[static_cast(location)] == sizeof(value)) { - int* constant = (int*)(pushConstants.buffer + pushConstants.offset[static_cast(location)]); - *constant = value; - } - } -} - -void KRPipeline::setPushConstant(ShaderValue location, const Vector2& value) -{ - for (StageInfo& stageInfo : m_stages) { - PushConstantInfo& pushConstants = stageInfo.pushConstants; - if (pushConstants.size[static_cast(location)] == sizeof(value)) { - Vector2* constant = (Vector2*)(pushConstants.buffer + pushConstants.offset[static_cast(location)]); - *constant = value; - } - } -} - -void KRPipeline::setPushConstant(ShaderValue location, const Vector3& value) -{ - for (StageInfo& stageInfo : m_stages) { - PushConstantInfo& pushConstants = stageInfo.pushConstants; - if (pushConstants.size[static_cast(location)] == sizeof(value)) { - Vector3* constant = (Vector3*)(pushConstants.buffer + pushConstants.offset[static_cast(location)]); - *constant = value; - } - } -} - -void KRPipeline::setPushConstant(ShaderValue location, const Vector4& value) -{ - for (StageInfo& stageInfo : m_stages) { - PushConstantInfo& pushConstants = stageInfo.pushConstants; - if (pushConstants.size[static_cast(location)] == sizeof(value)) { - Vector4* constant = (Vector4*)(pushConstants.buffer + pushConstants.offset[static_cast(location)]); - *constant = value; - } - } -} - -void KRPipeline::setPushConstant(ShaderValue location, const Matrix4& value) -{ - for (StageInfo& stageInfo : m_stages) { - PushConstantInfo& pushConstants = stageInfo.pushConstants; - if (pushConstants.size[static_cast(location)] == sizeof(value)) { - Matrix4* constant = (Matrix4*)(pushConstants.buffer + pushConstants.offset[static_cast(location)]); - *constant = value; - } - } -} - -void KRPipeline::setPushConstant(ShaderValue location, const Matrix4* value, const size_t count) -{ - for (StageInfo& stageInfo : m_stages) { - PushConstantInfo& pushConstants = stageInfo.pushConstants; - // TODO - Vulkan refactoring - // GLDEBUG(glUniformMatrix4fv(pushConstants.offset[KRPipeline::PushConstant::bone_transforms], (int)bones.size(), GL_FALSE, bone_mats)); - } -} - void KRPipeline::updateDescriptorBinding() { // TODO - Implement diff --git a/kraken/KRPipeline.h b/kraken/KRPipeline.h index addfca8..307e3e4 100644 --- a/kraken/KRPipeline.h +++ b/kraken/KRPipeline.h @@ -224,13 +224,6 @@ public: bool setImageBindings(const std::vector objects); bool setPushConstants(const KRCamera* camera, const std::vector objects); bool hasPushConstant(ShaderValue location) const; - void setPushConstant(ShaderValue location, float value); - void setPushConstant(ShaderValue location, int value); - void setPushConstant(ShaderValue location, const hydra::Vector2& value); - void setPushConstant(ShaderValue location, const hydra::Vector3& value); - void setPushConstant(ShaderValue location, const hydra::Vector4& value); - void setPushConstant(ShaderValue location, const hydra::Matrix4& value); - void setPushConstant(ShaderValue location, const hydra::Matrix4* value, const size_t count); VkPipeline& getPipeline(); void bindDescriptorSets(VkCommandBuffer& commandBuffer); diff --git a/kraken/resources/material/KRMaterial.cpp b/kraken/resources/material/KRMaterial.cpp index caeb00b..55f07da 100755 --- a/kraken/resources/material/KRMaterial.cpp +++ b/kraken/resources/material/KRMaterial.cpp @@ -820,9 +820,12 @@ bool KRMaterial::bind(KRNode::RenderInfo& ri, ModelFormat modelFormat, __uint32_ *bone_mat_component++ = t[i]; } } + /* + * TODO: Implement Skinned Mesh bone transform buffer upload if (pShader->hasPushConstant(ShaderValue::bone_transforms)) { pShader->setPushConstant(ShaderValue::bone_transforms, (Matrix4*)bone_mats, bones.size()); } + */ } bool success = true;