2014 snapchat source code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
456 B

  1. //
  2. // SCMetalUtils.m
  3. // Snapchat
  4. //
  5. // Created by Michel Loenngren on 8/16/17.
  6. //
  7. //
  8. #import "SCMetalUtils.h"
  9. #import <SCFoundation/SCTrace.h>
  10. id<MTLDevice> SCGetManagedCaptureMetalDevice(void)
  11. {
  12. #if !TARGET_IPHONE_SIMULATOR
  13. SCTraceStart();
  14. static dispatch_once_t onceToken;
  15. static id<MTLDevice> device;
  16. dispatch_once(&onceToken, ^{
  17. device = MTLCreateSystemDefaultDevice();
  18. });
  19. return device;
  20. #endif
  21. return nil;
  22. }