MCPcopy Create free account
hub / github.com/axmolengine/axmol / bindPass

Method bindPass

core/renderer/RenderState.cpp:49–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49void RenderState::bindPass(Pass* pass, MeshCommand* command)
50{
51 AX_ASSERT(pass);
52 assert(pass->_technique && pass->_technique->_material);
53 auto* technique = pass->_technique;
54 auto* material = technique->_material;
55 auto& pipelineDescriptor = command->getPipelineDescriptor();
56
57 // need reset all state
58 // pipelineDescriptor.blendDescriptor.blendEnabled = true;
59
60 // Get the combined modified state bits for our RenderState hierarchy.
61 int32_t overrideBits = _state._modifiedBits;
62 overrideBits |= technique->getStateBlock()._modifiedBits;
63 overrideBits |= material->getStateBlock()._modifiedBits;
64
65 // Restore renderer state to its default, except for explicitly specified states
66 RenderState::StateBlock::restoreUnmodifiedStates(overrideBits, &pipelineDescriptor);
67
68 material->getStateBlock().apply(&pipelineDescriptor);
69 technique->getStateBlock().apply(&pipelineDescriptor);
70 _state.apply(&pipelineDescriptor);
71}
72
73RenderState::StateBlock& RenderState::getStateBlock() const
74{

Callers 1

onBeforeVisitCmdMethod · 0.80

Calls 1

applyMethod · 0.45

Tested by

no test coverage detected