Validate shared VertexLayout from Shader Program

This commit is contained in:
halx99 2022-10-20 20:22:28 +08:00
parent cebba41a1e
commit d2da0d6078
2 changed files with 9 additions and 0 deletions

View File

@ -170,10 +170,17 @@ void DrawNode::updateShaderInternal(CustomCommand& cmd,
auto program = backend::Program::getBuiltinProgram(programType);
pipelinePS = new backend::ProgramState(program);
setVertexLayout(cmd);
cmd.setPrimitiveType(primitiveType);
cmd.setDrawType(drawType);
}
void DrawNode::setVertexLayout(CustomCommand& cmd)
{
auto* programState = cmd.getPipelineDescriptor().programState;
programState->validateSharedVertexLayout(VertexLayoutHelper::setupDrawNode);
}
void DrawNode::freeShaderInternal(CustomCommand& cmd)
{
auto& pipelinePS = cmd.getPipelineDescriptor().programState;

View File

@ -378,6 +378,8 @@ protected:
CustomCommand::PrimitiveType primitiveType);
void freeShaderInternal(CustomCommand& cmd);
void setVertexLayout(CustomCommand& cmd);
void updateBlendState(CustomCommand& cmd);
void updateUniforms(const Mat4& transform, CustomCommand& cmd);