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

Support iOS Simulator and tvOS Simulator, plus further tvOS integration #935

Merged
merged 15 commits into from
Jun 24, 2020

Conversation

billhollings
Copy link
Contributor

@billhollings billhollings commented Jun 24, 2020

  • Fixes the initial problems identified in issue MoltenVK iOS dynamic lib for x86_64 (simulators) #726.
  • Adds support for iOS Simulator and tvOS Simulator.
  • Adds support for building fat iOS and tvOS binaries.
  • Adds some additional tvOS behaviour.
  • Cube demo now runs on tvOS, tvOS Simulator, and iOS Simulator.
  • Other demos will require additional development to address Metal differences on the simulators.

This PR represents initial Simulator support.

The iOS and tvOS Simulators provide a subset of Metal functionality available on the native platforms. This results in a reduced set of Vulkan functionality, relative to that available on the actual iOS and tvOS platforms.

Making up these differences will require a combination of ongoing MoltenVK development on the simulator platforms, and app development (in apps that intend to use the simulator) to work around any outstanding differences.

For example, known issues include:

  • Simulators only allow Linear images on device local, non-host-visible memory. This is no-doubt a result of the combination of macOS Metal's lack of shared memory support for textures, and iOS/tvOS's lack of support for managed memory. To work around this, the Cube demo is configured to use staging buffers to load image content.

…ibraries.

Create fat builds of external libraries if both iOS and simulator versions
have been created from separate manual Xcode builds.
Add Scripts/create_fat_libs.sh.
Remove Scripts/package_ext_libs_ios.sh and Scripts/package_ext_libs_macos.sh.
fetchDependencies supports options for specifying which platform options to build for.
Fix SPIRV-Tools builds to avoid code stripping warnings.
Create fat builds of static, dynamic & framework libraries if both iOS
and simulator versions have been created from separate manual Xcode builds.

Refactor scripts for creating fat libraries to reuse across projects.
Add MVK_BUILT_PROD_DIR to replace use of BUILT_PRODUCTS_DIR in most scripts
to allow flexibility across per-platform compilation.
Log ext lib build steps to provide user feedback.
Add package_ext_libs_finish.sh script to separate packaging
libraries from building them, to avoid build database conflicts.
Travis only build macOS ext libs.
Use platform macros to conditionally build outstanding tvOS code.
Log validation error message when tvOS code doesn't support expected functionality.
Add MVK_IOS_SIMULATOR and MVK_TVOS_SIMULATOR macros.
MVKPixelFormats add disableMTLPixelFormatCapabilities().
MVKPixelFormats add disableAllMTLPixelFormatCapabilities().
Fix crash during creation of fat dSYMs.
Travis only build macOS version of everything.
@billhollings billhollings mentioned this pull request Jun 24, 2020
@tmm1
Copy link
Contributor

tmm1 commented Jun 24, 2020

Perused the diff and it's looking really great. I appreciate you including tvOS in this effort, and all the documentation updates!

I will give this a try tomorrow with my app.

@billhollings
Copy link
Contributor Author

I appreciate you including tvOS in this effort

Happy to do so! tvOS is an valuable addition to MoltenVK. Thanks for taking the initiative to drive that forward and make it happen!

@billhollings billhollings requested a review from cdavis5e June 24, 2020 13:02
@billhollings
Copy link
Contributor Author

@cdavis5e This is a mostly structural, rather than behavioural update, but since it affects a lot of files, I thought I'd give you a chance to review before I pull it in.

Copy link
Collaborator

@cdavis5e cdavis5e left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few minor things.

Common/MVKCommonEnvironment.h Outdated Show resolved Hide resolved
Docs/MoltenVK_Runtime_UserGuide.md Outdated Show resolved Hide resolved
MoltenVK/MoltenVK/Commands/MVKCmdDraw.mm Show resolved Hide resolved
MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm Show resolved Hide resolved
README.md Show resolved Hide resolved
@billhollings
Copy link
Contributor Author

@cdavis5e Thanks for the review and feedback. Should be good to go now. Please accept changes and I'll pull it in.

@billhollings billhollings merged commit 21630b5 into KhronosGroup:master Jun 24, 2020
@tmm1
Copy link
Contributor

tmm1 commented Jun 24, 2020

BTW, I tested this earlier with my app and it worked great on both iOS and tvOS simulators!

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

Successfully merging this pull request may close these issues.

3 participants