Hash :
d6ceac91
Author :
Date :
2024-02-12T20:37:58
Metal: Add support for binding slices to images Add support for binding Metal MTLTextureType2DArray texture slices to EGL images. Bug: angleproject:8531 Change-Id: I938e75c81bf36d3885f3bdcb0d1007e1f87e20c2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5290374 Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Alexey Knyazev <lexa.knyazev@gmail.com> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Kenneth Russell <kbr@chromium.org>
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 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
Name
ANGLE_metal_texture_client_buffer
Name Strings
EGL_ANGLE_metal_texture_client_buffer
Contributors
Le Hoang Quyen
Contacts
Jamie Madill, Google (jmadill 'at' google 'dot' com)
Le Hoang Quyen (lehoangq 'at' gmail.com)
Status
Draft
Version
Version 1, Jul 19, 2020
Number
EGL Extension #??
Dependencies
This extension is written against the wording of the EGL 1.4
Specification.
Overview
This extension allows creating EGL images from external metal texture objects.
New Types
None
New Procedures and Functions
None
New Tokens
Accepted in the <target> parameter of eglCreateImageKHR:
EGL_METAL_TEXTURE_ANGLE 0x34A7
Accepted as an attribute in the <attrib_list> parameter of
eglCreateImageKHR:
EGL_METAL_TEXTURE_ARRAY_SLICE_ANGLE 0x34DD
Additions to Chapter 2 of the EGL 1.2 Specification (EGL Operation)
Add to section 2.5.1 "EGLImage Specification" (as defined by the
EGL_KHR_image_base specification), in the description of
eglCreateImageKHR:
"Values accepted for <target> are listed in Table aaa, below.
+--------------------------------------+-----------------------------------------+
| <target> | Notes |
+--------------------------------------+-----------------------------------------+
| EGL_METAL_TEXTURE_ANGLE | Used for Metal texture objects |
+--------------------------------------+-----------------------------------------+
Table aaa. Legal values for eglCreateImageKHR <target> parameter
...
Attribute names accepted in <attrib_list> are shown in Table bbb,
together with the <target> for which each attribute name is valid, and
the default value used for each attribute if it is not included in
<attrib_list>.
+-------------------------------------+-------------------------+-------------------------+---------------+
| Attribute | Description | Valid | Default Value |
| | | <target>s | |
+-------------------------------------+-------------------------+-------------------------+---------------+
| EGL_METAL_TEXTURE_ARRAY_SLICE_ANGLE | Select which 2d texture | EGL_METAL_TEXTURE_ANGLE | 0 |
| | array slice to use | | |
+-------------------------------------+-------------------------+-------------------------+---------------+
Table bbb. Legal attributes for eglCreateImageKHR <attrib_list> parameter
If <target> is EGL_METAL_TEXTURE_ANGLE, <dpy> must be a valid display, <ctx>
must be EGL_NO_CONTEXT, <buffer> must be a pointer to a valid MTLTexture
object (cast into the type EGLClientBuffer), and attributes are ignored.
The width and height of the pbuffer are determined by the width and height
of <buffer>."
If EGL_METAL_TEXTURE_ARRAY_SLICE_ANGLE is specified, it is used to access
the specified array slice of the texture array <buffer>. In case the <target>
MTLTexture textureType property is MTLTextureType2DArray and arrayLength
property is smaller or equal to the value, EGL_BAD_ATTRIBUTE error
is generated. In case the target MTLTexture textureType property is not
MTLTextureType2DArray, value other than 0 generates EGL_BAD_ATTRIBUTE.
If the EGL_ANGLE_device_metal extension is present, the provided Metal texture
object must have been created by the same Metal device queried from the
display. If these requirements are not met, an EGL_BAD_PARAMETER error is
generated."
Revision History
Version 1, 2020-07-19 - First draft
Version 2, 2024-02-12 - Add EGL_METAL_TEXTURE_ARRAY_SLICE_ANGLE