mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-22 02:06:03 +08:00
Fix to address issue introduced in PR #1787 where the same ProgramState was being used for each attachment, but would cause problems if the attachments did not use the same texture. (#1801)
This commit is contained in:
parent
5a1d53bb16
commit
f06fd410e8
@ -163,11 +163,10 @@ cocos2d::TrianglesCommand* SkeletonBatch::addCommand(cocos2d::Renderer* renderer
|
|||||||
CCASSERT(programState, "programState should not be null");
|
CCASSERT(programState, "programState should not be null");
|
||||||
|
|
||||||
auto& pipelinePS = command->getPipelineDescriptor().programState;
|
auto& pipelinePS = command->getPipelineDescriptor().programState;
|
||||||
if (pipelinePS != programState)
|
if (pipelinePS == nullptr || pipelinePS->getProgram() != programState->getProgram())
|
||||||
{
|
{
|
||||||
CC_SAFE_RELEASE(pipelinePS);
|
CC_SAFE_RELEASE(pipelinePS);
|
||||||
pipelinePS = programState;
|
pipelinePS = programState->clone();
|
||||||
CC_SAFE_RETAIN(pipelinePS);
|
|
||||||
|
|
||||||
updateProgramStateLayout(pipelinePS);
|
updateProgramStateLayout(pipelinePS);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user