[spine] Use currentState to setup shader stubs

This commit is contained in:
halx99 2022-07-05 14:40:18 +08:00
parent db7681bb8b
commit 5edbfa5448
1 changed files with 5 additions and 5 deletions

View File

@ -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;
}