cocos2d-objc
cocos2d-objc copied to clipboard
Metal Prep Step 9 - Immutable render passes
This isn't strictly necessary for Metal support but it's the last bit of cleanup that I wanted to work in with all of the refactoring that is necessary for Metal support. All classes that define an effect implementation are now immutable and, with this change, a whole host of potential "What would happen if X changed unexpectedly behind my back?" type situations are removed as are the bugs that go with them.
Here's a bit more detail:
- CCEffectRenderPass is immutable and effect implementations no longer directly create render pass objects.
- CCEffectRenderPassDescriptor is introduced. This is what effects now create and hand off to CCEffectImpl at initialization time. CCEffectImpl uses the descriptors to create render pass objects internally.
- CCEffectRenderPassBeginBlockContext becomes CCEffectBeginBlockContext because CCERPBBC was too long. It's immutable now too.
- CCEffectRenderPassBeginBlock and UpdateBlock become CCEffectBeginBlock and CCEffectUpdateBlock (for consistency with the previous item).
- All effects are updated to adapt to these changes.