This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
Enabled metal on ios simulator #17881
Merged
Merged
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
a4fff2f
Enabled metal on ios simulator
Kavantix 839185c
Added os version constant for metal availablitity
Kavantix 5c92d7d
Updated outdated comment in the gn file
Kavantix ea495b7
Renamed macro to METAL_IOS_VERSION_BASELINE
Kavantix eed65a5
Merge branch 'master' into metal-on-simulator
Kavantix 63d1a38
Update gpu_surface_metal.h
Kavantix 13bd8e5
Update ios_surface_metal.h
Kavantix 5b8e616
Merge remote-tracking branch 'upstream/master' into metal-on-simulator
dnfield 5bce7ab
Merge remote-tracking branch 'upstream/master' into metal-on-simulator
dnfield 40fb32b
Enable software rendering, make golden tests use it
dnfield db5db70
review
dnfield a2b792b
Apply suggestions from code review
dnfield eaf87d0
unnecessary ,
dnfield f323636
better comment
dnfield c0a9f73
more chinmay review
dnfield File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -39,14 +39,20 @@ bool IsIosEmbeddedViewsPreviewEnabled() { | |
| } | ||
|
|
||
| #if FLUTTER_SHELL_ENABLE_METAL | ||
| if ([layer.get() isKindOfClass:[CAMetalLayer class]]) { | ||
| return std::make_unique<IOSSurfaceMetal>( | ||
| fml::scoped_nsobject<CAMetalLayer>( | ||
| reinterpret_cast<CAMetalLayer*>([layer.get() retain])), // Metal layer | ||
| std::move(context), // context | ||
| platform_views_controller // platform views controller | ||
| ); | ||
| #if TARGET_IPHONE_SIMULATOR | ||
Kavantix marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| if (@available(iOS 13.0, *)) { | ||
| #endif // TARGET_IPHONE_SIMULATOR | ||
| if ([layer.get() isKindOfClass:[CAMetalLayer class]]) { | ||
| return std::make_unique<IOSSurfaceMetal>( | ||
| fml::scoped_nsobject<CAMetalLayer>( | ||
| reinterpret_cast<CAMetalLayer*>([layer.get() retain])), // Metal layer | ||
| std::move(context), // context | ||
| platform_views_controller // platform views controller | ||
| ); | ||
| } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That doesnt make sense to me, it not being available is valid since it will use the software renderer in that case |
||
| #if TARGET_IPHONE_SIMULATOR | ||
| } | ||
| #endif // TARGET_IPHONE_SIMULATOR | ||
| #endif // FLUTTER_SHELL_ENABLE_METAL | ||
|
|
||
| return std::make_unique<IOSSurfaceSoftware>( | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.