After a month and a half passed I finally made a pull request with my MSAA solutions.
My first goal was to implement OpenGL-like multisampling over metal. And now it works fine for most cases.
But not in my game. Where I found that Renderer has to create the new MTL-encoder on each 2d/3d sprite change during scene draw.
It takes a lot of time to create encoder with multisample attachments. To achieve acceptable rendering speed I made a unified MTL-encoder for drawing to texture with MSAA and depth enabled.
You may check the performance advantage of this encoder by running the new test “RenderTextureWithMsaaSprite3D”.
I understand that this solution is pretty dirty and situational to be merged to cocos-2d master. But its a good start point for future development. Here is the capture of this test running on a 6 scale.
Hello @zhangxm@coulsonwang. Sorry for auto-tests failed by my previous commit. I’m not a very experienced GitHub user and didn’t notice the test’s status.