Refactoring to reduce parameter count for KRPipeline::bind, passing by RenderInfo

This commit is contained in:
2024-09-21 17:16:13 -07:00
parent d7672d31f4
commit 8bee10c768
18 changed files with 105 additions and 94 deletions

View File

@@ -167,7 +167,7 @@ void KRSprite::render(RenderInfo& ri)
KRPipeline* pShader = getContext().getPipelineManager()->getPipeline(*ri.surface, info);
pShader->setPushConstant(KRPipeline::PushConstant::material_alpha, m_spriteAlpha);
pShader->setImageBinding("diffuseTexture", m_pSpriteTexture, m_pContext->getSamplerManager()->DEFAULT_CLAMPED_SAMPLER);
pShader->bind(ri.commandBuffer, *ri.camera, *ri.viewport, getModelMatrix(), &ri.point_lights, &ri.directional_lights, &ri.spot_lights, ri.renderPass);
pShader->bind(ri, getModelMatrix());
m_pContext->getMeshManager()->bindVBO(ri.commandBuffer, &vertices, 1.0f);
vkCmdDraw(ri.commandBuffer, 4, 1, 0, 0);