-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
feat: add visionOS support #3289
Conversation
Follow existing file name convention when adding new files... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please split this into two PRs. One where you just add BX_PLATFORM_VISIONOS defines, and after that PR one where you add new files, change scripts, etc.
You should investigate how to avoid using 4 files for visionOS entry. Ideally only one file would be there. |
Hey @bkaradzic, I've removed "example" needed changes from this PR. I will open a separate one. |
Hey @bkaradzic, is there anything more I should change in this PR? |
Co-authored-by: mani3xis <mariusz.pas+dev@protonmail.com> fix: properly set storageMode cleanup: remove unused variables fix crash while releasing m_drawable on visionOS fix: remove unused timing variable fix: file name cases, cleanup feat: integrate visionOS into bgfx examples
Hey @bkaradzic! I did an initial testing integration to BabylonNative and it seems to work properly 👍🏻 Is there anything else you want to see in this PR fixed? Here is a screenshot of Babylon Native examples running on visionOS (it's rendering a cube): |
LGTM! Only question about this code: #if BX_PLATFORM_VISIONOS
cp_layer_renderer_t m_layerRenderer;
cp_frame_t m_frame;
cp_drawable_t m_drawable;
#else
CAMetalLayer* m_metalLayer;
CAMetalLayer* m_metalLayer;
id <CAMetalDrawable> m_drawable;
id <CAMetalDrawable> m_drawable;
#endif Is this |
It's specific to visionOS, it's unavailable on other platforms. |
Co-authored-by: mani3xis <mariusz.pas+dev@protonmail.com> fix: properly set storageMode cleanup: remove unused variables fix crash while releasing m_drawable on visionOS fix: remove unused timing variable fix: file name cases, cleanup feat: integrate visionOS into bgfx examples
Co-authored-by: mani3xis <mariusz.pas+dev@protonmail.com> fix: properly set storageMode cleanup: remove unused variables fix crash while releasing m_drawable on visionOS fix: remove unused timing variable fix: file name cases, cleanup feat: integrate visionOS into bgfx examples
Hello,
This PR adds visionOS support to bgfx. It's the continuation of this PR which added support to
bx
library. I've worked on this together with @mani3xis.Apple Vision uses bgfx in single threaded mode (
BGFX_CONFIG_MULTITHREADED = 0
), but the example framework isn't really working nice with single threaded mode, so there might be some crashes in the examples but it works great when integrated separately.