cocos2d-objc icon indicating copy to clipboard operation
cocos2d-objc copied to clipboard

Metal Prep Step 9 - Immutable render passes

Open thayerandrews opened this issue 10 years ago • 0 comments

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.

thayerandrews avatar Apr 23 '15 18:04 thayerandrews