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

Add tvOS support #5578

Open
darkwater opened this issue Apr 22, 2024 · 4 comments
Open

Add tvOS support #5578

darkwater opened this issue Apr 22, 2024 · 4 comments
Labels
api: metal Issues with Metal type: enhancement New feature or request

Comments

@darkwater
Copy link

Is your feature request related to a problem? Please describe.
I was trying to get Bevy to build for tvOS, and wgpu was the main source of errors.

Describe the solution you'd like
Add support for tvOS. Because it's so similar to iOS, this is mostly just changing cfg(target_os = "ios") into cfg(any(target_os = "ios", target_os = "tvos")). I already made some progress in this commit. I got a Bevy example to build and install, but it would immediately crash upon launch. See bevy#13058

Describe alternatives you've considered
Don't support tvOS.

Additional context
None

@teoxoy teoxoy added type: enhancement New feature or request api: metal Issues with Metal labels Apr 22, 2024
@jinleili
Copy link
Contributor

The tvOS target is currently supported as part of the tier3 support level, and only supports no_std development

@darkwater
Copy link
Author

It is indeed tier 3, but doesn't only support no_std. It seems this PR added libstd support. Either way, I was able to compile and install a Bevy example. It would crash at some iOS-specific functionality like trying to hide the status bar.

@VladasZ
Copy link
Contributor

VladasZ commented Jul 22, 2024

Hi @darkwater. I want to use wgpu with tvOS too.
I tried to add target = "tvos" like you did in my wgpu fork but now I get this link error:

Undefined symbols for architecture arm64:
  "_MTLCopyAllDevices", referenced from:
      metal::device::Device::all::h8012909a44210ef8 in libtest_game.a[3065](metal-d800b64461c8f587.metal.73d4cb208f4c1603-cgu.01.rcgu.o)
  "_objc_msg_lookup", referenced from:

Have you seen something like that?

Also I think that you should create a PR with your progress to the main wgpu repo. Yes it is not a full support for tvOS yet but it is a start and it will help other developers to progress from that and eventually add full tvOS support.

@madsmtm
Copy link
Contributor

madsmtm commented Aug 16, 2024

I'd recommend:

  • macOS: cfg(target_os = "macos")
  • iOS/tvOS/watchOS/visionOS/Mac Catalyst: cfg(all(target_vendor = "apple", not(target_os = "macos")))
  • Metal: cfg(target_vendor = "apple")

At least until we get target_family = "darwin" or similar (see rust-lang/rust#100343).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: metal Issues with Metal type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants