xref: /aosp_15_r20/external/angle/extensions/EGL_ANGLE_metal_texture_client_buffer.txt (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1Name
2
3    ANGLE_metal_texture_client_buffer
4
5Name Strings
6
7    EGL_ANGLE_metal_texture_client_buffer
8
9Contributors
10
11    Le Hoang Quyen
12    Dan Glastonbury
13
14Contacts
15
16    Jamie Madill, Google (jmadill 'at' google 'dot' com)
17    Le Hoang Quyen (lehoangq 'at' gmail.com)
18    Dan Glastonbury, Apple (djg 'at' apple 'dot' com)
19
20Status
21
22    Draft
23
24Version
25    Version 3, Feb 20, 2024
26
27Number
28
29    EGL Extension #??
30
31Dependencies
32
33    This extension is written against the wording of the EGL 1.4
34    Specification.
35
36    References the EGL_ANGLE_iosurface_client_buffer extension.
37
38Overview
39
40    This extension allows creating EGL images from external metal texture objects.
41
42New Types
43
44    None
45
46New Procedures and Functions
47
48    None
49
50New Tokens
51
52    Accepted in the <target> parameter of eglCreateImageKHR:
53
54        EGL_METAL_TEXTURE_ANGLE               0x34A7
55
56    Accepted as an attribute in the <attrib_list> parameter of
57    eglCreateImageKHR:
58
59        EGL_METAL_TEXTURE_ARRAY_SLICE_ANGLE   0x34DD
60
61Additions to Chapter 2 of the EGL 1.2 Specification (EGL Operation)
62
63    Add to section 2.5.1 "EGLImage Specification" (as defined by the
64    EGL_KHR_image_base specification), in the description of
65    eglCreateImageKHR:
66
67   "Values accepted for <target> are listed in Table aaa, below.
68
69      +--------------------------------------+-----------------------------------------+
70      |  <target>                            |  Notes                                  |
71      +--------------------------------------+-----------------------------------------+
72      |  EGL_METAL_TEXTURE_ANGLE             |  Used for Metal texture objects         |
73      +--------------------------------------+-----------------------------------------+
74       Table aaa.  Legal values for eglCreateImageKHR <target> parameter
75
76    ...
77
78    Attribute names accepted in <attrib_list> are shown in Table bbb,
79    together with the <target> for which each attribute name is valid, and
80    the default value used for each attribute if it is not included in
81    <attrib_list>.
82
83      +-------------------------------------+-------------------------+-------------------------+---------------+
84      | Attribute                           | Description             | Valid                   | Default Value |
85      |                                     |                         | <target>s               |               |
86      +-------------------------------------+-------------------------+-------------------------+---------------+
87      | EGL_METAL_TEXTURE_ARRAY_SLICE_ANGLE | Select which 2d texture | EGL_METAL_TEXTURE_ANGLE | 0             |
88      |                                     | array slice to use      |                         |               |
89      +-------------------------------------+-------------------------+-------------------------+---------------+
90      | EGL_TEXTURE_INTERNAL_FORMAT_ANGLE   | Override the intended   | EGL_METAL_TEXTURE_ANGLE | GL_NONE       |
91      |                                     | internal format         |                         |               |
92      +-------------------------------------+-------------------------+-------------------------+---------------+
93       Table bbb.  Legal attributes for eglCreateImageKHR <attrib_list> parameter
94
95    If <target> is EGL_METAL_TEXTURE_ANGLE, <dpy> must be a valid display, <ctx>
96    must be EGL_NO_CONTEXT, <buffer> must be a pointer to a valid MTLTexture
97    object (cast into the type EGLClientBuffer), and attributes are ignored.
98    The width and height of the pbuffer are determined by the width and height
99    of <buffer>."
100
101    If EGL_METAL_TEXTURE_ARRAY_SLICE_ANGLE is specified, it is used to access
102    the specified array slice of the texture array <buffer>. In case the <target>
103    MTLTexture textureType property is MTLTextureType2DArray and arrayLength
104    property is smaller or equal to the value, EGL_BAD_ATTRIBUTE error
105    is generated. In case the target MTLTexture textureType property is not
106    MTLTextureType2DArray, value other than 0 generates EGL_BAD_ATTRIBUTE.
107
108    If EGL_TEXTURE_INTERNAL_FORMAT_ANGLE is specified, it is used to interpret
109    <buffer> according to the provided internal format. If the MTLPixelFormat for
110    the internal format is incompatible with that of the texture <buffer>, an
111    EGL_BAD_PARAMETER error is generated.
112
113    If the EGL_ANGLE_device_metal extension is present, the provided Metal texture
114    object must have been created by the same Metal device queried from the
115    display. If these requirements are not met, an EGL_BAD_PARAMETER error is
116    generated."
117
118Revision History
119
120    Version 1, 2020-07-19 - First draft
121    Version 2, 2024-02-12 - Add EGL_METAL_TEXTURE_ARRAY_SLICE_ANGLE
122    Version 3, 2024-02-20 - Add EGL_TEXTURE_INTERNAL_FORMAT_ANGLE
123
124