File tree Expand file tree Collapse file tree 3 files changed +23
-3
lines changed
Expand file tree Collapse file tree 3 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -864,6 +864,11 @@ if (DAWN_ENABLE_SWIFTSHADER)
864864 target_compile_definitions (dawn_native_objects PRIVATE "DAWN_ENABLE_SWIFTSHADER" )
865865endif ()
866866
867+ if (IOS)
868+ target_compile_options (dawn_native_objects PRIVATE -fno-objc-arc)
869+ target_compile_options (dawn_native PRIVATE -fno-objc-arc)
870+ endif ()
871+
867872if (DAWN_BUILD_MONOLITHIC_LIBRARY)
868873 ###############################################################################
869874 # Do the 'complete_lib' build.
Original file line number Diff line number Diff line change 3333
3434#import < QuartzCore/CAMetalLayer.h>
3535
36+ #include " dawn/common/Platform.h"
37+
3638namespace dawn ::native {
3739
3840bool InheritsFromCAMetalLayer (void * obj) {
39- id <NSObject > object = static_cast <id >(obj);
41+ id <NSObject > object =
42+ #if DAWN_PLATFORM_IS(IOS)
43+ (__bridge id )obj;
44+ #else // DAWN_PLATFORM_IS(IOS)
45+ static_cast <id >(obj);
46+ #endif // DAWN_PLATFORM_IS(IOS)
47+
4048 return [object isKindOfClass: [CAMetalLayer class ]];
4149}
4250
Original file line number Diff line number Diff line change 2525// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2626// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2727
28+ #include " dawn/common/Platform.h"
29+
2830#include " dawn/native/metal/SharedFenceMTL.h"
2931
3032#include " dawn/native/ChainUtils.h"
3941 const SharedFenceMTLSharedEventDescriptor* descriptor) {
4042 DAWN_INVALID_IF (descriptor->sharedEvent == nullptr , " MTLSharedEvent is missing." );
4143 if (@available (macOS 10.14 , iOS 12.0 , *)) {
42- return AcquireRef (new SharedFence (
43- device, label, static_cast <id <MTLSharedEvent >>(descriptor->sharedEvent )));
44+ return AcquireRef (new SharedFence (device, label,
45+ #if DAWN_PLATFORM_IS(IOS)
46+ (__bridge id <MTLSharedEvent >)(descriptor->sharedEvent )
47+ #else // DAWN_PLATFORM_IS(IOS)
48+ static_cast <id <MTLSharedEvent >>(descriptor->sharedEvent )
49+ #endif // DAWN_PLATFORM_IS(IOS)
50+ ));
4451 } else {
4552 return DAWN_INTERNAL_ERROR (" MTLSharedEvent not supported." );
4653 }
You can’t perform that action at this time.
0 commit comments