Metal support alpha0 version released

After months’ hard work, we are excited to announce that, cocos2d-x metal-support alpha0 version is released. Because we don’t determine the version name, so i just call it metal-support. You can join the ticket to discuss the new version name.

How to run

You can get the source code by clicking the url or use git to clone the codes from the github. If you choose to clone from github, then you should be care about these things:

  • the repo is https://github.com/cocos2d/cocos2d-x
  • the branch name is metal-support
  • the corresponding commit hash is 8d9bd925c94ad47268c8790369c750d3598978cc

Since Visual Studio projects are removed, so you should use Cmake to generate Visual Studio projects first. Can refer to the doc for detail usage.

Currently, only cpp-empty-test and cpp-tests work, and we don’t test linux platform too.

What’s changed

The modification are:

  • support metal on mac/iOS
  • remove deprecated codes
  • remove cocosbuilder support
  • remove NDK build on Android
  • remove visual studio project files on windows

Known issues

Known issues are listed here.

You are appreciated to test and report bugs.

12 Likes

on Linux, I am seeing:

/home/jason/Cocos/metal-support-alpha0/cocos/audio/linux/AudioEngine-linux.cpp: In member function ‘bool cocos2d::experimental::AudioEngineImpl::init()’:
/home/jason/Cocos/metal-support-alpha0/cocos/audio/linux/AudioEngine-linux.cpp:100:25: error: ‘schedule_selector’ was not declared in this scope
     scheduler->schedule(schedule_selector(AudioEngineImpl::update), this, 0.05f, false);
                         ^~~~~~~~~~~~~~~~~
/home/jason/Cocos/metal-support-alpha0/cocos/audio/linux/AudioEngine-linux.cpp:100:25: note: suggested alternative: ‘scheduler’
     scheduler->schedule(schedule_selector(AudioEngineImpl::update), this, 0.05f, false);
                         ^~~~~~~~~~~~~~~~~
                         scheduler
[ 37%] Building CXX object engine/cocos/core/CMakeFiles/cocos2d.dir/ui/CocosGUI.cpp.o

do you have an estimated release date for the final version ?

@slackmoehrle linux is not tested currently, it is mentioned in known issues.
@lzzyJM i hope it .is available in 3 months.

1 Like

Yup I saw. Just letting you know.

Hey @zhangxm , I tested metal backed alpha version in one of our game “Block Kitty”.

Tested on iOS & Mac

iOS device: IPhone 6 Latest iOS
Mac: MacBook Pro Late 13 Latest OS

Issues:
#1 Game is overall slow, especially when there are many nodes.
#2 Particle animations & node actions are laggy. May be same #1 issue.
#3 ProgressBar blinking forever after adding ProgressTo animation. Tested on Bar & Radial type.

API Changes:
Scene::initWithPhysics(); missing
Texture2D::setTexParameters(params); not working

@kiranb47 thanks for you feedback.

Did you test in release mode? We tested renderer in cpp-tests which has many nodes, the performance is about 10% improved.

It is strange, the ProgressTimer test in cpp-tests works. Did you modify the codes?

I will check it, may be it is deprecated, so i deleted it.

Could you please paste more codes about it? What’s the value of params?

static Scene * createWithPhysics ()

https://docs.cocos2d-x.org/api-ref/cplusplus/v3x/d4/d5f/classcocos2d_1_1_scene.html

Yep, i see. It is because CC_USE_PHYSICS is set to 0 in ccConfig.h. We haven’t tested physics very much, this macro will be turn on when releasing stable version.

And i created an issue for it.

@zhangxm I created a new project using “cocos new” command, then replaced Resource & Classes. I didn’t modify any codes. The following is the code that not working.

auto pTexture = Director::getInstance()->getTextureCache()->addImage("bg_tile.png");
Texture2D::TexParams params;
params.magFilter = GL_LINEAR;
params.minFilter = GL_LINEAR;
params.wrapS = GL_REPEAT;
params.wrapT = GL_REPEAT;
pTexture->setTexParameters(params);

No issue with cpp-tests here too

It is strange, this function is renamed to Texture2D::setSamplerDescriptor(), and i created an issue for it to revert it.

So i think you don’t use metal alpha0 version. How did you get the codes?

I cloned from https://github.com/minggo/cocos2d-x metal-support. Then downloaded console & libs. setTexParameters is not available. Compile error for me

As i mentioned, you should checkout corresponding commit id: 8d9bd925c94ad47268c8790369c750d3598978cc. Could you please should me your repo history by git log?

Sorry, Actually i choosed to download.

And you should use the repo https://github.com/cocos2d/cocos2d-x, instead of my personal one. From now on, should use official repo.

I didn’t know it was merged to official repo. From now i will use official repo.

It’s my fault, i didn’t describe it clearly. Sorry about it, and waiting for your feedback.

Hey @zhangxm Just remove RepeatForever from ProgressTo action, you can re-produce the issue. Please try this in cpp ProgressBar tests

Ok, i will take a look tomorrow. Did you still have performance issue?