Replaced setPushConstant call in KRCamera with reflection

This commit is contained in:
2025-11-11 13:05:23 -08:00
parent 53f2a85136
commit 7cb09d8f89
2 changed files with 14 additions and 1 deletions

View File

@@ -448,7 +448,6 @@ void KRCamera::renderPost(RenderInfo& ri)
KRPipeline *postShader = m_pContext->getPipelineManager()->getPipeline(surface, info);
postShader->setPushConstant(KRPipeline::PushConstant::fade_color, m_fade_color);
postShader->bind(commandBuffer, *this, m_viewport, Matrix4(), nullptr, nullptr, nullptr, compositeSurface.getRenderPass(RenderPassType::RENDER_PASS_FORWARD_TRANSPARENT));
m_pContext->getTextureManager()->selectTexture(GL_TEXTURE_2D, 0, compositeDepthTexture);
@@ -861,3 +860,14 @@ Vector4 KRCamera::getFadeColor()
{
return m_fade_color;
}
bool KRCamera::getShaderValue(ShaderValue value, hydra::Vector4* output) const
{
switch (value) {
case ShaderValue::fade_color:
*output = m_fade_color;
return true;
}
return KRNode::getShaderValue(value, output);
}

View File

@@ -81,6 +81,9 @@ public:
void setSkyBox(const std::string& skyBox);
const std::string getSkyBox() const;
protected:
bool getShaderValue(ShaderValue value, hydra::Vector4* output) const override;
private:
void createBuffers(int renderBufferWidth, int renderBufferHeight);