From Farshid Lashkari, "I'm working on a custom ShaderComposer and I need access to the full StateSetStack of the State object within the getOrCreateProgram() method. The problem is that "State::apply(const StateSet* dstate)" does not add the specified stateset to the stack. I'm not sure if this was intentional, but I've updated the function to push/pop the stateset.

I hope the change seems reasonable. I searched the entire code base for code that accesses the StateSetStack, and noticed RenderBin and RenderStage use it. However, I don't think that code would ever be called from within the State::apply() function, so I'm fairly confident the change should be safe."
This commit is contained in:
Robert Osfield
2013-05-21 17:41:07 +00:00
parent 2daff56860
commit 94fe9b5fd5

View File

@@ -500,6 +500,9 @@ void State::apply(const StateSet* dstate)
if (dstate)
{
// push the stateset on the stack so it can be querried from within StateAttribute
_stateStateStack.push_back(dstate);
_currentShaderCompositionUniformList.clear();
applyModeList(_modeMap,dstate->getModeList());
@@ -546,7 +549,9 @@ void State::apply(const StateSet* dstate)
{
applyUniformList(_uniformMap,dstate->getUniformList());
}
// pop the stateset from the stack
_stateStateStack.pop_back();
}
else
{