mirror of https://github.com/axmolengine/axmol.git
Validate shared VertexLayout from Shader Program
This commit is contained in:
parent
cebba41a1e
commit
d2da0d6078
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue