forked from veldrid/veldrid
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from frenzibyte/fix-metal-ios
Work around mono-level crash on iOS with interpreter
- Loading branch information
Showing
10 changed files
with
640 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Metal Mono Workaround | ||
|
||
On iOS, simply defining a P/Invoke method for `MTLBlitCommandEncoder.copyFromBuffer` and invoking it blows up the application. To work around that, we're defining a method that has a different signature that's friendly with Mono, which redirects back to the original method. | ||
|
||
This library should be referenced by any project that uses Veldrid. | ||
|
||
To generate the library, build the Xcode project on both iPhone and iPhone Simulator architectures, and execute the following to generate the XCFramework: | ||
```bash | ||
xcodebuild -create-xcframework -framework ./Release-iphoneos/metal_mono_workaround.framework -framework ./Release-iphonesimulator/metal_mono_workaround.framework -output metal-mono-workaround.xcframework | ||
``` | ||
|
||
Afterwards, reference the XCFramework in your project and it should work correctly. |
Oops, something went wrong.