Hash :
d33a2222
Author :
Date :
2021-04-26T16:56:15
Upstream Apple's direct-to-Metal backend: compile libANGLE. This change is meant to merge the metal backend changes from Apple's direct-to-Metal backend. Taken from Kyle Piddington's CL: https://chromium-review.googlesource.com/c/angle/angle/+/2857366/ The goal of this CL is to merge the metal backend code in a state that compiles, but not to switch the Metal backend over to using the direct-to-metal backend yet. Bug: angleproject:5505 Bug: angleproject:6127 Change-Id: If6783e06e0086b3a1dd25c6f53caca5cfc96cb86 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2950067 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
//
// Copyright 2020 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// FunctionsCGL.h: Exposing the soft-linked CGL interface.
#ifndef CGL_FUNCTIONS_H_
#define CGL_FUNCTIONS_H_
#include "common/platform.h"
#if defined(ANGLE_PLATFORM_MACOS) || defined(ANGLE_PLATFORM_MACCATALYST)
# include <OpenGL/OpenGL.h>
# include "common/apple/SoftLinking.h"
SOFT_LINK_FRAMEWORK_HEADER(OpenGL)
SOFT_LINK_FUNCTION_HEADER(OpenGL,
CGLChoosePixelFormat,
CGLError,
(const CGLPixelFormatAttribute *attribs,
CGLPixelFormatObj *pix,
GLint *npix),
(attribs, pix, npix))
SOFT_LINK_FUNCTION_HEADER(OpenGL,
CGLCreateContext,
CGLError,
(CGLPixelFormatObj pix, CGLContextObj share, CGLContextObj *ctx),
(pix, share, ctx))
SOFT_LINK_FUNCTION_HEADER(
OpenGL,
CGLDescribePixelFormat,
CGLError,
(CGLPixelFormatObj pix, GLint pix_num, CGLPixelFormatAttribute attrib, GLint *value),
(pix, pix_num, attrib, value))
SOFT_LINK_FUNCTION_HEADER(
OpenGL,
CGLDescribeRenderer,
CGLError,
(CGLRendererInfoObj rend, GLint rend_num, CGLRendererProperty prop, GLint *value),
(rend, rend_num, prop, value))
SOFT_LINK_FUNCTION_HEADER(OpenGL, CGLDestroyContext, CGLError, (CGLContextObj ctx), (ctx))
SOFT_LINK_FUNCTION_HEADER(OpenGL, CGLDestroyPixelFormat, CGLError, (CGLPixelFormatObj pix), (pix))
SOFT_LINK_FUNCTION_HEADER(OpenGL,
CGLDestroyRendererInfo,
CGLError,
(CGLRendererInfoObj rend),
(rend))
SOFT_LINK_FUNCTION_HEADER(OpenGL, CGLErrorString, const char *, (CGLError error), (error))
SOFT_LINK_FUNCTION_HEADER(OpenGL,
CGLQueryRendererInfo,
CGLError,
(GLuint display_mask, CGLRendererInfoObj *rend, GLint *nrend),
(display_mask, rend, nrend))
SOFT_LINK_FUNCTION_HEADER(OpenGL, CGLReleaseContext, void, (CGLContextObj ctx), (ctx))
SOFT_LINK_FUNCTION_HEADER(OpenGL, CGLGetCurrentContext, CGLContextObj, (void), ())
SOFT_LINK_FUNCTION_HEADER(OpenGL, CGLSetCurrentContext, CGLError, (CGLContextObj ctx), (ctx))
SOFT_LINK_FUNCTION_HEADER(OpenGL,
CGLSetVirtualScreen,
CGLError,
(CGLContextObj ctx, GLint screen),
(ctx, screen))
SOFT_LINK_FUNCTION_HEADER(
OpenGL,
CGLTexImageIOSurface2D,
CGLError,
(CGLContextObj ctx,
GLenum target,
GLenum internal_format,
GLsizei width,
GLsizei height,
GLenum format,
GLenum type,
IOSurfaceRef ioSurface,
GLuint plane),
(ctx, target, internal_format, width, height, format, type, ioSurface, plane))
SOFT_LINK_FUNCTION_HEADER(OpenGL, CGLUpdateContext, CGLError, (CGLContextObj ctx), (ctx))
#endif // defined(ANGLE_PLATFORM_MACOS) || defined(ANGLE_PLATFORM_MACCATALYST)
#endif // CGL_FUNCTIONS_H_