-
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cherry-pick from gles3-dev: WIP: Support importing external metal tex…
…tures (2D, Cube) via KHR_image_base. Change-Id: I525eb0a0160c67bbbc6baf8107429e08b2d67f6d # Conflicts: # extensions/EGL_MGL_texture_client_buffer.txt # src/libANGLE/Caps.cpp # src/libANGLE/renderer/metal/DisplayMtl.h # src/libANGLE/renderer/metal/DisplayMtl.mm # src/tests/angle_end2end_tests.gni
- Loading branch information
1 parent
f2ae5d3
commit 596db81
Showing
27 changed files
with
1,252 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
Name | ||
|
||
MGL_texture_client_buffer | ||
|
||
Name Strings | ||
|
||
EGL_MGL_mtl_texture_client_buffer | ||
|
||
Contributors | ||
|
||
Le Hoang Quyen | ||
|
||
Contacts | ||
|
||
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_MTL_TEXTURE_MGL 0x3456 | ||
|
||
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_MTL_TEXTURE_MGL | Used for Metal texture objects | | ||
+----------------------------+-----------------------------------------+ | ||
Table aaa. Legal values for eglCreateImageKHR <target> parameter | ||
|
||
... | ||
|
||
If <target> is EGL_MTL_TEXTURE_MGL, <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 the EGL_ANGLE_device_mtl 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/19/07 - First draft |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
Name | ||
|
||
MGL_EGL_image_cube | ||
|
||
Name Strings | ||
|
||
GL_MGL_EGL_image_cube | ||
|
||
Contact | ||
|
||
Le Hoang Quyen ([email protected]) | ||
|
||
Contributors | ||
|
||
Le Hoang Quyen | ||
|
||
Status | ||
|
||
Draft | ||
|
||
Version | ||
|
||
Revision: 0.1 | ||
|
||
Number | ||
|
||
OpenGL ES Extension #XXX | ||
|
||
Dependencies | ||
|
||
OpenGL ES 2.0 is required. | ||
|
||
Requires EGL 1.2 and either the EGL_KHR_image or EGL_KHR_image_base | ||
extensions as well as OES_EGL_image. | ||
|
||
This extension is written against the OpenGL ES 2.0 specification and | ||
the OES_EGL_image extension. | ||
|
||
Overview | ||
|
||
This extension adds functionality to that provided by OES_EGL_image in | ||
order to support cube map EGLImage. It extends the existing | ||
EGLImageTargetTexture2DOES entry point from OES_EGL_image. Render buffers | ||
are not extended to include cube map support. | ||
|
||
EGLImage cube map can be created using extended versions of eglCreateImageKHR. | ||
For example, EGL_MGL_mtl_texture_client_buffer can import cube map image native metal textures | ||
on devices where such native textures can be created. | ||
|
||
New Procedures and Functions | ||
|
||
None. | ||
|
||
New Tokens | ||
|
||
None. | ||
|
||
Additions to Chapter 3 of the OpenGL ES 2.0 Specification | ||
|
||
In section 3.8.2 within the specification added by OES_EGL_Image: | ||
|
||
"Currently, <target> must be TEXTURE_2D or TEXTURE_CUBE_MAP." | ||
|
||
Errors | ||
|
||
GL_INVALID_ENUM is generated by EGLImageTargetTexture2DOES if | ||
<target> is not TEXTURE_2D or TEXTURE_CUBE_MAP | ||
|
||
GL_INVALID_OPERATION is generated by EGLImageTargetTexture2DOES if: | ||
- <target> is TEXTURE_CUBE_MAP and <image> is not cube map image. | ||
- <target> is TEXTURE_2D and <image> is not 2d image. | ||
|
||
Issues | ||
|
||
None. | ||
|
||
Revision History | ||
|
||
Rev. Date Author Changes | ||
---- ---------- -------- ----------------------------------------- | ||
0.1 07/30/2020 Quyen Initial draft |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.