Removed KRPipeline::setPushConstant methods, as we have switched entirely to reflected objects.
Some checks failed
CMake on multiple platforms / build (Release, cl, cl, windows-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, macos-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, ubuntu-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, gcc, g++, ubuntu-latest) (push) Has been cancelled

This commit is contained in:
2026-06-01 23:54:55 -07:00
parent dcebdde968
commit 9bf6966266
3 changed files with 4 additions and 84 deletions

View File

@@ -585,7 +585,7 @@ bool KRPipeline::setPushConstants(const KRCamera* camera, const std::vector<cons
break; break;
} }
} }
if(!found) { if (!found) {
success = false; success = false;
KRContext::Log(KRContext::LOG_LEVEL_ERROR, "Push constant not found: %s", getShaderValueName(i)); KRContext::Log(KRContext::LOG_LEVEL_ERROR, "Push constant not found: %s", getShaderValueName(i));
} }
@@ -595,82 +595,6 @@ bool KRPipeline::setPushConstants(const KRCamera* camera, const std::vector<cons
return success; return success;
} }
void KRPipeline::setPushConstant(ShaderValue location, float value)
{
for (StageInfo& stageInfo : m_stages) {
PushConstantInfo& pushConstants = stageInfo.pushConstants;
if (pushConstants.size[static_cast<size_t>(location)] == sizeof(value)) {
float* constant = (float*)(pushConstants.buffer + pushConstants.offset[static_cast<size_t>(location)]);
*constant = value;
}
}
}
void KRPipeline::setPushConstant(ShaderValue location, int value)
{
for (StageInfo& stageInfo : m_stages) {
PushConstantInfo& pushConstants = stageInfo.pushConstants;
if (pushConstants.size[static_cast<size_t>(location)] == sizeof(value)) {
int* constant = (int*)(pushConstants.buffer + pushConstants.offset[static_cast<size_t>(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<size_t>(location)] == sizeof(value)) {
Vector2* constant = (Vector2*)(pushConstants.buffer + pushConstants.offset[static_cast<size_t>(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<size_t>(location)] == sizeof(value)) {
Vector3* constant = (Vector3*)(pushConstants.buffer + pushConstants.offset[static_cast<size_t>(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<size_t>(location)] == sizeof(value)) {
Vector4* constant = (Vector4*)(pushConstants.buffer + pushConstants.offset[static_cast<size_t>(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<size_t>(location)] == sizeof(value)) {
Matrix4* constant = (Matrix4*)(pushConstants.buffer + pushConstants.offset[static_cast<size_t>(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() void KRPipeline::updateDescriptorBinding()
{ {
// TODO - Implement // TODO - Implement

View File

@@ -224,13 +224,6 @@ public:
bool setImageBindings(const std::vector<const KRReflectedObject*> objects); bool setImageBindings(const std::vector<const KRReflectedObject*> objects);
bool setPushConstants(const KRCamera* camera, const std::vector<const KRReflectedObject*> objects); bool setPushConstants(const KRCamera* camera, const std::vector<const KRReflectedObject*> objects);
bool hasPushConstant(ShaderValue location) const; 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(); VkPipeline& getPipeline();
void bindDescriptorSets(VkCommandBuffer& commandBuffer); void bindDescriptorSets(VkCommandBuffer& commandBuffer);

View File

@@ -820,9 +820,12 @@ bool KRMaterial::bind(KRNode::RenderInfo& ri, ModelFormat modelFormat, __uint32_
*bone_mat_component++ = t[i]; *bone_mat_component++ = t[i];
} }
} }
/*
* TODO: Implement Skinned Mesh bone transform buffer upload
if (pShader->hasPushConstant(ShaderValue::bone_transforms)) { if (pShader->hasPushConstant(ShaderValue::bone_transforms)) {
pShader->setPushConstant(ShaderValue::bone_transforms, (Matrix4*)bone_mats, bones.size()); pShader->setPushConstant(ShaderValue::bone_transforms, (Matrix4*)bone_mats, bones.size());
} }
*/
} }
bool success = true; bool success = true;