1Name
2
3    ANGLE_stream_producer_d3d_texture
4
5Name Strings
6
7    EGL_ANGLE_stream_producer_d3d_texture
8
9Contributors
10
11    Ian Ewell
12    Geoff Lang
13    John Bauman
14    Jeff Gilbert
15
16Contacts
17
18    Geoff Lang, Google (geofflang ‘at’ google.com)
19
20Status
21
22    Draft
23
24Version
25
26    Version 2, November 15, 2017
27
28Number
29
30    EGL Extension #XXX
31
32Dependencies
33
34    Requires EGL 1.4.
35    Requires OpenGL ES 2.0.
36
37    Requires the EGL_KHR_stream extension.
38    Requires the EGL_NV_stream_consumer_gltexture_yuv extension.
39    Requires the EGL_KHR_stream_consumer_gltexture extension.
40    Requires the EGL_ANGLE_device_d3d extension.
41
42Overview
43
44    This extension allows D3D11 textures to be inserted into an EGL stream
45    with the expectation that the stream consumer will be either an RGB GL
46    texture consumer, or a YUV GL texture consumer using a two plane
47    configuration (i.e. a Y plane and a UV plane).
48    This will act as the producer of the stream.
49
50New procedures and functions
51
52    EGLBoolean eglCreateStreamProducerD3DTextureANGLE(
53                EGLDisplay dpy,
54                EGLStreamKHR stream,
55                const EGLAttrib *attrib_list)
56    EGLBoolean eglStreamPostD3DTextureANGLE(EGLDisplay dpy,
57                EGLStreamKHR stream,
58                void *texture,
59                const EGLAttrib *attrib_list)
60
61New Tokens
62
63    Accepted as an <attribute> in eglStreamPostD3DTextureANGLE:
64
65        EGL_D3D_TEXTURE_SUBRESOURCE_ID_ANGLE 0x33AB
66
67Replace section "3.10.3.1 No way to connect producer to EGLStream" in the
68EGL_KHR_stream extension with this:
69
70    3.10.3.1 Stream Surface Producer
71
72    Call
73
74        EGLBoolean eglCreateStreamProducerD3DTextureANGLE(
75                    EGLDisplay dpy,
76                    EGLStreamKHR stream,
77                    const EGLAttrib *attrib_list)
78
79    to create a producer that accepts D3D11 textures and connect it as the
80    producer of <stream>. <attrib_list> is used to specify attributes for the
81    stream producer. Currently there are no attributes to specify, and the
82    attribute list is used as a placeholder for future additions.
83
84    On failure, eglCreateStreamProducerD3DTextureANGLE returns EGL_FALSE and
85    generates an error.
86
87        - EGL_BAD_STATE_KHR is generated if <stream> is not in the state
88          EGL_STREAM_STATE_CONNECTING_KHR.
89
90        - EGL_BAD_MATCH is generated if <stream> does not have a connected GL
91          texture consumer.
92
93        - EGL_BAD_STREAM_KHR is generated if <stream> is not a valid EGLStream
94          generated for <dpy>.
95
96        - EGL_BAD_DISPLAY is generated if <dpy> is not a valid, initialized
97          display.
98
99Add a section preceding "3.9.3 Posting Semantics" in the EGL specification:
100
101    3.9.x Posting to a Stream
102
103    To post a D3D11 texture to a stream, call
104
105        EGLBoolean eglStreamPostD3DTextureANGLE(
106                    EGLDisplay dpy,
107                    EGLStreamKHR stream,
108                    void *texture,
109                    const EGLAttrib *attrib_list);
110
111    If <stream> is an appropriately configured stream and <texture> points to a
112    valid ID3D11Texture2D object of a supported format that is owned
113    by the same ID3D11Device that is queried with the EGL_ANGLE_device_d3d
114    extension, the texture will be posted to the stream and can be bound as one
115    or more OpenGL texture objects.
116
117    The parameter <attrib_list> allows for per-frame attributes to be specified
118    along with the texture. The only parameter currently available is
119    EGL_D3D_TEXTURE_SUBRESOURCE_ID_ANGLE, which allows the subresource id of
120    the texture that will be used to be specified. If this attribute is not
121    explicitly specified, it will default to the value of 0.
122
123    It is the responsibility of the application to perform any synchronization
124    between the insertion of the frame into the stream and the use of the
125    consumer textures output by the stream. The EGL_CONSUMER_LATENCY_USEC_KHR
126    attribute will have no effect on the function of the implementation of this
127    extension, but can still be used for communication between components of
128    the application.
129
130    The implementation will hold a reference to the D3D11 texture object if the
131    insertion is successful and will release the texture object when a new frame
132    is inserted or when the stream is destroyed.
133
134    On failure, eglStreamInsertD3DTexture returns EGL_FALSE and generates an
135    error.
136
137        - EGL_BAD_STATE is generated if <stream> is not in the state
138          EGL_STREAM_STATE_EMPTY_KHR, EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR,
139          or EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR.
140
141        - EGL_BAD_MATCH is generated if the stream is not associated with a
142          D3D11 texture producer.
143
144        - EGL_BAD_PARAMETER is generated if <texture> is not owned by the
145          queried device, is not a supported format, is not compatible with the
146          implementation, or if the specified value for
147          EGL_D3D_TEXTURE_SUBRESOURCE_ID_ANGLE is not a valid subresource id for
148          the texture.
149
150        - EGL_BAD_STREAM_KHR is generated if <stream> is not a valid EGLStream.
151
152        - EGL_BAD_ATTRIBUTE is generated if an attribute other than
153          EGL_D3D_TEXTURE_SUBRESOURCE_ID_ANGLE is specified in <attrib_list>.
154
155Revision History
156
157    #1 (April 6, 2016) Ian Ewell
158        - initial draft
159
160    #2 (November 15, 2017) Jeff Gilbert
161        - Rename from EGL_ANGLE_stream_producer_d3d_texture_nv12 to
162          EGL_ANGLE_stream_producer_d3d_texture
163        - Remove NV12 suffix from function names
164        - add RGB GL texture consumer support
165        - reduce required EGL version to 1.4 (from 1.5)
166