types.h 816 B

1234567891011121314151617181920212223242526272829
  1. // Copyright 2019 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_METAL_UTIL_TYPES_H_
  5. #define COMPONENTS_METAL_UTIL_TYPES_H_
  6. #if __OBJC__
  7. @protocol MTLDevice;
  8. #endif
  9. namespace metal {
  10. // Metal's API uses Objective-C types, which cannot be included in C++ sources.
  11. // This file defines types that resolve to Metal types in Objective-C sources
  12. // and can be included in C++ sources.
  13. #if __OBJC__
  14. #pragma clang diagnostic push
  15. #pragma clang diagnostic ignored "-Wunguarded-availability"
  16. using MTLDevicePtr = id<MTLDevice>;
  17. #pragma clang diagnostic pop
  18. #else
  19. class MTLDeviceProtocol;
  20. using MTLDevicePtr = MTLDeviceProtocol*;
  21. #endif
  22. } // namespace metal
  23. #endif // COMPONENTS_METAL_UTIL_TYPES_H_