mirror of https://github.com/axmolengine/axmol.git
[spine] Use currentState to setup shader stubs
This commit is contained in:
parent
db7681bb8b
commit
5edbfa5448
|
@ -96,17 +96,17 @@ backend::ProgramState* SkeletonBatch::updateCommandPipelinePS(SkeletonCommand* c
|
|||
currentState = programState->clone();
|
||||
|
||||
auto vertexLayout = currentState->getVertexLayout();
|
||||
auto locPosition = programState->getAttributeLocation(backend::ATTRIBUTE_NAME_POSITION);
|
||||
auto locTexcoord = programState->getAttributeLocation(backend::ATTRIBUTE_NAME_TEXCOORD);
|
||||
auto locColor = programState->getAttributeLocation(backend::ATTRIBUTE_NAME_COLOR);
|
||||
auto locPosition = currentState->getAttributeLocation(backend::ATTRIBUTE_NAME_POSITION);
|
||||
auto locTexcoord = currentState->getAttributeLocation(backend::ATTRIBUTE_NAME_TEXCOORD);
|
||||
auto locColor = currentState->getAttributeLocation(backend::ATTRIBUTE_NAME_COLOR);
|
||||
vertexLayout->setAttribute(backend::ATTRIBUTE_NAME_POSITION, locPosition, backend::VertexFormat::FLOAT3, offsetof(V3F_C4B_T2F, vertices), false);
|
||||
vertexLayout->setAttribute(backend::ATTRIBUTE_NAME_COLOR, locColor, backend::VertexFormat::UBYTE4, offsetof(V3F_C4B_T2F, colors), true);
|
||||
vertexLayout->setAttribute(backend::ATTRIBUTE_NAME_TEXCOORD, locTexcoord, backend::VertexFormat::FLOAT2, offsetof(V3F_C4B_T2F, texCoords), false);
|
||||
vertexLayout->setLayout(sizeof(_vertices[0]));
|
||||
|
||||
|
||||
command->_locMVP = programState->getUniformLocation(backend::UNIFORM_NAME_MVP_MATRIX);
|
||||
command->_locTexture = programState->getUniformLocation(backend::UNIFORM_NAME_TEXTURE);
|
||||
command->_locMVP = currentState->getUniformLocation(backend::UNIFORM_NAME_MVP_MATRIX);
|
||||
command->_locTexture = currentState->getUniformLocation(backend::UNIFORM_NAME_TEXTURE);
|
||||
}
|
||||
return currentState;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue