Commit 0941e653 by Michael Spang Committed by Commit Bot

Add external object extensions for Fuchsia to GL API

Add extensions layered on top of GL_EXT_memory_object and GL_EXT_semaphore to support GL & Vulkan interoperation on Fuchsia. They are analagous to the file descriptor versions, except not quite as opaque. This is a draft; the underlying vulkan extensions have not been submitted to Khronos. Bug: angleproject:3492 Change-Id: Ic4723ded9fff752c4186eaa6a7f07d9ac51a3364 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1642332 Commit-Queue: Michael Spang <spang@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 0aab41b7
Name
ANGLE_external_objects_fuchsia
Name Strings
GL_ANGLE_memory_object_fuchsia
GL_ANGLE_semaphore_fuchsia
Contributors
Michael Spang, Google
Contact
Michael Spang, Google (spang 'at' google.com)
Status
Draft
Version
Last Modified Date: Feb 19, 2020
Revision: 1
Number
TBD
Dependencies
Written against the OpenGL 4.5 and OpenGL ES 3.2 specifications
GL_ANGLE_memory_object_fuchsia requires GL_EXT_memory_object
GL_ANGLE_semaphore_fuchsia requires GL_EXT_semaphore
Overview
Building upon the OpenGL memory object and semaphore framework
defined in EXT_external_objects, this extension enables an OpenGL
application to import a memory object or semaphore from Zircon
external handles.
New Procedures and Functions
If the GL_ANGLE_memory_object_fuchsia string is reported, the following
commands are added:
void ImportMemoryZirconHandleANGLE(uint memory,
uint64 size,
enum handleType,
uint handle);
If the GL_ANGLE_semaphore_fuchsia string is reported, the following commands
are added:
void ImportSemaphoreZirconHandleANGLE(uint semaphore,
enum handleType,
uint handle);
New Tokens
If the GL_ANGLE_memory_object_fuchsia string is reported, the following
tokens are added:
Accepted by the <handleType> parameter of ImportMemoryZirconHandleANGLE().
HANDLE_TYPE_ZIRCON_VMO_ANGLE 0x93AE
If the GL_ANGLE_semaphore_fuchsia string is reported, the following
tokens are added:
Accepted by the <handleType> parameter of ImportSemaphoreZirconHandleANGLE().
HANDLE_TYPE_ZIRCON_EVENT_ANGLE 0x93AF
Additions to Chapter 4 of the OpenGL 4.5 Specification (Event Model)
Add the following entry to table 4.2 "Commands for importing
external semaphore handles."
| Handle Type | Import command |
+--------------------------------+----------------------------------+
| HANDLE_TYPE_ZIRCON_EVENT_ANGLE | ImportSemaphoreZirconHandleANGLE |
+--------------------------------+----------------------------------+
Replace the paragraph in section 4.2.1 beginning "External handles
are often defined..." with the following
The command
ImportSemaphoreZirconHandleANGLE(uint semaphore,
enum handleType,
uint handle);
imports a semaphore from the zircon handle <handle>. What type of
handle <handle> refers to is determined by <handleType>. A successful
import operation transfers ownership of <handle> to the GL
implementation, and performing any operation on <handle> in the
application after an import results in undefined behavior.
Additions to Chapter 6 of the OpenGL 4.5 Specification (Memory Objects)
Add the following entry to table 6.2 "Commands for importing
external memory handles."
| Handle Type | Import command |
+------------------------------+-------------------------------+
| HANDLE_TYPE_ZIRCON_VMO_ANGLE | ImportMemoryZirconHandleANGLE |
+------------------------------+-------------------------------+
Replace the paragraph in section 6.1 beginning "External handles are
often defined..." with the following
The command
void ImportMemoryZirconHandleANGLE(uint memory,
uint64 size,
enum handleType,
uint handle);
imports a memory object of length <size> from the handle
<handle>. What type of object <handle> refers to is determined by
<handleType>. A successful import operation transfers ownership
of <handle> to the GL implementation, and performing any operation on
<handle> in the application after an import results in undefined
behavior.
Revision History
Revision 1, 2019-02-19 (Michael Spang)
- Initial draft based closely on EXT_external_objects_fd.
...@@ -713,6 +713,34 @@ GL_APICALL void GL_APIENTRY glGetRenderbufferImageANGLE (GLenum target, GLenum f ...@@ -713,6 +713,34 @@ GL_APICALL void GL_APIENTRY glGetRenderbufferImageANGLE (GLenum target, GLenum f
#define GL_SAMPLER_VIDEO_IMAGE_WEBGL 0x9249 #define GL_SAMPLER_VIDEO_IMAGE_WEBGL 0x9249
#endif /* GL_WEBGL_video_texture */ #endif /* GL_WEBGL_video_texture */
#ifndef GL_ANGLE_memory_object_fuchsia
#define GL_ANGLE_memory_object_fuchsia 1
#define GL_HANDLE_TYPE_ZIRCON_VMO_ANGLE 0x93AE
typedef void(GL_APIENTRYP PFNGLIMPORTMEMORYZIRCONHANDLEANGLEPROC)(GLuint memory,
GLuint64 size,
GLenum handleType,
GLuint handle);
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glImportMemoryZirconHandleANGLE(GLuint memory,
GLuint64 size,
GLenum handleType,
GLuint handle);
#endif
#endif /* GL_ANGLE_memory_object_fuchsia */
#ifndef GL_ANGLE_semaphore_fuchsia
#define GL_ANGLE_semaphore_fuchsia 1
#define GL_HANDLE_TYPE_ZIRCON_EVENT_ANGLE 0x93AF
typedef void(GL_APIENTRYP PFNGLIMPORTSEMAPHOREZIRCONHANDLEANGLEPROC)(GLuint semaphore,
GLenum handleType,
GLuint handle);
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glImportSemaphoreZirconHandleANGLE(GLuint memory,
GLenum handleType,
GLuint handle);
#endif
#endif /* GL_ANGLE_semaphore_fuchsia */
// clang-format on // clang-format on
#endif // INCLUDE_GLES2_GL2EXT_ANGLE_H_ #endif // INCLUDE_GLES2_GL2EXT_ANGLE_H_
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
"scripts/gl.xml": "scripts/gl.xml":
"2af7b077ec347349b3a92683e8fb8b03", "2af7b077ec347349b3a92683e8fb8b03",
"scripts/gl_angle_ext.xml": "scripts/gl_angle_ext.xml":
"d6907cd84d95ac0b32a164194eadcf53", "872ecabf7ca7767c7801ba835ddbd1eb",
"scripts/registry_xml.py": "scripts/registry_xml.py":
"1cf8c2638c7a2ea439f79d3ba05592bd", "1cf8c2638c7a2ea439f79d3ba05592bd",
"scripts/wgl.xml": "scripts/wgl.xml":
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"scripts/gl.xml": "scripts/gl.xml":
"2af7b077ec347349b3a92683e8fb8b03", "2af7b077ec347349b3a92683e8fb8b03",
"scripts/gl_angle_ext.xml": "scripts/gl_angle_ext.xml":
"d6907cd84d95ac0b32a164194eadcf53", "872ecabf7ca7767c7801ba835ddbd1eb",
"scripts/registry_xml.py": "scripts/registry_xml.py":
"1cf8c2638c7a2ea439f79d3ba05592bd", "1cf8c2638c7a2ea439f79d3ba05592bd",
"src/libANGLE/gl_enum_utils_autogen.cpp": "src/libANGLE/gl_enum_utils_autogen.cpp":
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"scripts/gl.xml": "scripts/gl.xml":
"2af7b077ec347349b3a92683e8fb8b03", "2af7b077ec347349b3a92683e8fb8b03",
"scripts/gl_angle_ext.xml": "scripts/gl_angle_ext.xml":
"d6907cd84d95ac0b32a164194eadcf53", "872ecabf7ca7767c7801ba835ddbd1eb",
"scripts/registry_xml.py": "scripts/registry_xml.py":
"1cf8c2638c7a2ea439f79d3ba05592bd", "1cf8c2638c7a2ea439f79d3ba05592bd",
"scripts/wgl.xml": "scripts/wgl.xml":
......
...@@ -8,6 +8,15 @@ ...@@ -8,6 +8,15 @@
gl_angle_ext.xml gl_angle_ext.xml
Includes data used to auto-generate ANGLE classes. Includes data used to auto-generate ANGLE classes.
</comment> </comment>
<!-- SECTION: GL parameter class type definitions. -->
<groups>
<group name="ExternalHandleType">
<enum name="GL_HANDLE_TYPE_ZIRCON_VMO_ANGLE"/>
<enum name="GL_HANDLE_TYPE_ZIRCON_EVENT_ANGLE"/>
</group>
</groups>
<!-- SECTION: GL command definitions. --> <!-- SECTION: GL command definitions. -->
<commands namespace="GL"> <commands namespace="GL">
<command> <command>
...@@ -977,7 +986,21 @@ ...@@ -977,7 +986,21 @@
<param group="PixelType"><ptype>GLenum</ptype> <name>type</name></param> <param group="PixelType"><ptype>GLenum</ptype> <name>type</name></param>
<param len="COMPSIZE(target,level,format,type)">void *<name>pixels</name></param> <param len="COMPSIZE(target,level,format,type)">void *<name>pixels</name></param>
</command> </command>
<command>
<proto>void <name>glImportMemoryZirconHandleANGLE</name></proto>
<param><ptype>GLuint</ptype> <name>memory</name></param>
<param><ptype>GLuint64</ptype> <name>size</name></param>
<param group="ExternalHandleType"><ptype>GLenum</ptype> <name>handleType</name></param>
<param><ptype>GLuint</ptype> <name>handle</name></param>
</command>
<command>
<proto>void <name>glImportSemaphoreZirconHandleANGLE</name></proto>
<param><ptype>GLuint</ptype> <name>semaphore</name></param>
<param group="ExternalHandleType"><ptype>GLenum</ptype> <name>handleType</name></param>
<param><ptype>GLuint</ptype> <name>handle</name></param>
</command>
</commands> </commands>
<!-- SECTION: ANGLE extension interface definitions --> <!-- SECTION: ANGLE extension interface definitions -->
<extensions> <extensions>
<extension name="GL_CHROMIUM_bind_uniform_location" supported='gles2'> <extension name="GL_CHROMIUM_bind_uniform_location" supported='gles2'>
...@@ -1163,5 +1186,23 @@ ...@@ -1163,5 +1186,23 @@
<command name="glGetRenderbufferImageANGLE"/> <command name="glGetRenderbufferImageANGLE"/>
</require> </require>
</extension> </extension>
<extension name="GL_ANGLE_memory_object_fuchsia" supported="gl|gles2">
<require>
<enum name="GL_HANDLE_TYPE_ZIRCON_VMO_ANGLE"/>
<command name="glImportMemoryZirconHandleANGLE"/>
</require>
</extension>
<extension name="GL_ANGLE_semaphore_fuchsia" supported="gl|gles2">
<require>
<enum name="GL_HANDLE_TYPE_ZIRCON_EVENT_ANGLE"/>
<command name="glImportSemaphoreZirconHandleANGLE"/>
</require>
</extension>
</extensions> </extensions>
<!-- SECTION: GL enumerant (token) definitions. -->
<enums namespace="GL" start="0x93AE" end="0x93AF" vendor="ANGLE">
<enum value="0x93AE" name="GL_HANDLE_TYPE_ZIRCON_VMO_ANGLE"/>
<enum value="0x93AF" name="GL_HANDLE_TYPE_ZIRCON_EVENT_ANGLE"/>
</enums>
</registry> </registry>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment