Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metal C++ Backend/Examples #4746

Closed
timmg opened this issue Nov 20, 2021 · 4 comments
Closed

Metal C++ Backend/Examples #4746

timmg opened this issue Nov 20, 2021 · 4 comments

Comments

@timmg
Copy link

timmg commented Nov 20, 2021

Feature request:

Develop backend/examples for Metal over C++.

https://developer.apple.com/metal/cpp/

@ocornut
Copy link
Owner

ocornut commented Nov 20, 2021

What would be the added value and why not using the existing backend that is already provided, since Apple toolchains supports both languages?

@thedmd
Copy link
Contributor

thedmd commented Nov 21, 2021

@timmg
FYI: Wrapper is available here https://github.com/bkaradzic/metal-cpp.

@metarutaiga
Copy link

Metal use C++ is bad idea, it lost ARC feature and make codes dirty.
If you want write C++ files only (ex: cc or cpp), you can add compiler flag to enable Objective-C.

COMPILER_FLAGS = "-x objective-c++ -fobjc-arc -fobjc-weak -fmodules"

Unreal is using mtlpp, but it's difficult to add new features without Objective-C.
Finally, it can't pass Objective-C because Metal is Objective-C.

@ocornut
Copy link
Owner

ocornut commented Nov 24, 2021

I'm closing this until there's an argument for why we would need that additional back-end.
I understand it is good move for Apple to provide that as many apps/engines are purely C++ based and the interop can require extra work, but AFAIK once we do have an Objective-C version we don't need a second one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants