• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Name
2
3    EXT_external_objects_fd
4
5Name Strings
6
7    GL_EXT_memory_object_fd
8    GL_EXT_semaphore_fd
9
10Contributors
11
12    Carsten Rohde, NVIDIA
13    James Jones, NVIDIA
14    Jan-Harald Fredriksen, ARM
15    Jeff Juliano, NVIDIA
16
17Contact
18
19    James Jones, NVIDIA (jajones 'at' nvidia.com)
20
21Status
22
23    Complete
24
25Version
26
27    Last Modified Date: June 2, 2017
28    Revision: 7
29
30Number
31
32    504
33    OpenGL ES Extension #281
34
35Dependencies
36
37    Written against the OpenGL 4.5 and OpenGL ES 3.2 specifications
38
39    GL_EXT_memory_object_fd requires GL_EXT_memory_object
40
41    GL_EXT_semaphore_fd requires GL_EXT_semaphore
42
43    Requires ARB_texture_storage or a version of OpenGL or OpenGL ES that
44    incorporates it.
45
46Overview
47
48    Building upon the OpenGL memory object and semaphore framework
49    defined in EXT_external_objects, this extension enables an OpenGL
50    application to import a memory object or semaphore from POSIX file
51    descriptor external handles.
52
53New Procedures and Functions
54
55    If the GL_EXT_memory_object_fd string is reported, the following
56    commands are added:
57
58    void ImportMemoryFdEXT(uint memory,
59                           uint64 size,
60                           enum handleType,
61                           int fd);
62
63    If the GL_EXT_semaphore_fd string is reported, the following commands
64    are added:
65
66    void ImportSemaphoreFdEXT(uint semaphore,
67                              enum handleType,
68                              int fd);
69
70
71New Tokens
72
73    The following tokens are added if either of the GL_EXT_memory_object_fd
74    or GL_EXT_semaphore_fd strings are reported:
75
76    Accepted by the <handleType> parameter of ImportMemoryFdEXT() or
77    ImportSemaphoreFdEXT().
78
79        HANDLE_TYPE_OPAQUE_FD_EXT                  0x9586
80
81Additions to Chapter 4 of the OpenGL 4.5 Specification (Event Model)
82
83    Add the following entry to table 4.2 "Commands for importing
84    external semaphore handles."
85
86        | Handle Type               | Import command       |
87        +---------------------------+----------------------+
88        | HANDLE_TYPE_OPAQUE_FD_EXT | ImportSemaphoreFdEXT |
89        +---------------------------+----------------------+
90
91    Replace the paragraph in section 4.2.1 beginning "External handles
92    are often defined..." with the following
93
94        The command
95
96            ImportSemaphoreFdEXT(uint semaphore,
97                                 enum handleType,
98                                 int fd);
99
100        imports a semaphore from the file descriptor <fd>.  What type of
101        object <fd> refers to is determined by <handleType>.  A successful
102        import operation transfers ownership of <fd> to the GL
103        implementation, and performing any operation on <fd> in the
104        application after an import results in undefined behavior.
105
106Additions to Chapter 6 of the OpenGL 4.5 Specification (Memory Objects)
107
108    Add the following entry to table 6.2 "Commands for importing
109    external memory handles."
110
111        | Handle Type               | Import command    |
112        +---------------------------+-------------------+
113        | HANDLE_TYPE_OPAQUE_FD_EXT | ImportMemoryFdEXT |
114        +---------------------------+-------------------+
115
116    Replace the paragraph in section 6.1 beginning "External handles are
117    often defined..." with the following
118
119        The command
120
121            void ImportMemoryFdEXT(uint memory,
122                                   uint64 size,
123                                   enum handleType,
124                                   int fd);
125
126        imports a memory object of length <size> from the file descriptor
127        <fd>.  What type of object <fd> refers to is determined by
128        <handleType>.  A successful import operation transfers ownership
129        of <fd> to the GL implementation, and performing any operation on
130        <fd> in the application after an import results in undefined
131        behavior.
132
133Additions to Chapter 21 of the OpenGL 4.5 Specification (Special Functions)
134
135    Add the following to section 21.4.1, Commands Not Usable in Display
136    Lists.
137
138    Under the "Memory Objects" section:
139
140        ImportMemoryFdEXT
141
142    Under the "GL command stream management" section:
143
144        ImportSemaphoreFdEXT
145
146Issues
147
148    1)  Does this extension need to support importing Android/Linux
149        sync FD handles?
150
151        RESOLVED: No.  These are already usable in GL via extensions to the
152        EGLSync mechanism.  Adding them here in order to support them in GLX
153        contexts is not compelling enough to justify the additional effort.
154
155Revision History
156
157    Revision 8, 2022-07-15 (James Jones)
158        - Added commands to the list of commands not permitted in display
159          lists.
160
161    Revision 7, 2017-06-02 (James Jones)
162        - Added extension numbers.
163        - Clarified which extensions each command and token belongs to.
164        - Marked complete.
165
166    Revision 6, 2017-05-24 (James Jones)
167        - Filled in real token values
168
169    Revision 5, 2017-04-04 (James Jones)
170        - Clarified the effects of import operations on file descriptors.
171
172    Revision 4, 2017-03-17 (James Jones)
173        - Renamed from KHR to EXT.
174
175    Revision 3, 2016-09-28 (James Jones)
176        - Merged GL_EXT_memory_object_fd and GL_EXT_semaphore_fd.
177        - Added spec body describing the new commands and tokens.
178        - Added issue 1.
179
180    Revision 2, 2016-08-15 (Jeff Juliano)
181        - Clarified overview text.
182
183    Revision 1, 2016-08-05 (James Jones)
184        - Initial draft.
185