Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/angle
Path: blob/main_old/extensions/EGL_ANGLE_d3d_texture_client_buffer.txt
1693 views
1
Name
2
3
ANGLE_d3d_texture_client_buffer
4
5
Name Strings
6
7
EGL_ANGLE_d3d_texture_client_buffer
8
9
Contributors
10
11
Geoff Lang
12
Olli Etuaho
13
Sunny Sachanandani
14
15
Contacts
16
17
Geoff Lang, Google Inc. (geofflang 'at' google.com)
18
19
Status
20
21
Draft
22
23
Version
24
25
Version 6, May 12, 2020
26
27
Number
28
29
EGL Extension #??
30
31
Dependencies
32
33
This extension is written against the wording of the EGL 1.2
34
Specification.
35
36
References the EGL_ANGLE_device_d3d and EGL_KHR_image_base extensions.
37
38
Overview
39
40
This extension allows creating EGL surfaces and EGL images from D3D texture
41
objects.
42
43
New Types
44
45
None
46
47
New Procedures and Functions
48
49
None
50
51
New Tokens
52
53
Accepted by the <target> parameter of eglCreateImageKHR and <buftype>
54
parameter of eglCreatePbufferFromClientBuffer:
55
56
EGL_D3D_TEXTURE_ANGLE 0x33A3
57
58
Additions to Chapter 2 of the EGL 1.2 Specification (EGL Operation)
59
60
Add to section 2.5.1 "EGLImage Specification" (as defined by the
61
EGL_KHR_image_base specification), in the description of
62
eglCreateImageKHR:
63
64
"Values accepted for <target> are listed in Table aaa, below.
65
66
+----------------------------+-----------------------------------------+
67
| <target> | Notes |
68
+----------------------------+-----------------------------------------+
69
| EGL_D3D_TEXTURE_ANGLE | Used for Direct3D11 texture objects |
70
+----------------------------+-----------------------------------------+
71
Table aaa. Legal values for eglCreateImageKHR <target> parameter
72
73
...
74
75
If <target> is EGL_D3D_TEXTURE_ANGLE, <dpy> must be a valid display, <ctx>
76
must be EGL_NO_CONTEXT, <buffer> must be a pointer to a valid D3D11 texture
77
object (cast into the type EGLClientBuffer), and attributes other than
78
EGL_TEXTURE_INTERNAL_FORMAT_ANGLE, EGL_TEXTURE_OFFSET_X_ANGLE, or
79
EGL_TEXTURE_OFFSET_Y_ANGLE are ignored. The width and height of the pbuffer
80
are determined by the width and height of <buffer>.
81
82
If EGL_TEXTURE_INTERNAL_FORMAT_ANGLE is specified, it is used to interpret
83
<buffer> according to the provided internal format. See table
84
egl.restrictions for acceptable texture object types and formats.
85
86
If EGL_D3D11_TEXTURE_PLANE_ANGLE is specified, it is used to access the
87
specified plane of <buffer>. See table egl.restrictions for acceptable
88
values.
89
90
If EGL_D3D11_TEXTURE_ARRAY_SLICE_ANGLE is specified, it is used to access
91
the specified array slice of the texture array <buffer>.
92
93
If EGL_TEXTURE_OFFSET_X_ANGLE or EGL_TEXTURE_OFFSET_Y_ANGLE are specified,
94
they must be non-negative and are used to offset all rendering into the
95
surface including blits, clears and draws.
96
97
If the EGL_ANGLE_device_d3d extension is present, the provided D3D11 texture
98
object must have been created by the same D3D11 device queried from the
99
display. If these requirements are not met, an EGL_BAD_PARAMETER error is
100
generated."
101
102
Additions to Chapter 3 of the EGL 1.2 Specification (EGL Functions and Errors)
103
104
Replace the last sentence of paragraph 1 of Section 3.5.3 with the
105
following text.
106
"Currently, the only client API resources which may be bound in this
107
fashion are OpenVG VGImage objects and Direct3D texture objects."
108
109
Replace the last sentence of paragraph 2 ("To bind a client API...") of
110
Section 3.5.3 with the following text.
111
"When <buftype> is EGL_OPENVG_IMAGE or EGL_D3D_TEXTURE_ANGLE, the width and
112
height of the pbuffer are determined by the width and height of <buffer>."
113
114
Replace the third paragraph of Section 3.5.3 with the following text.
115
"<buftype> specifies the type of buffer to be bound. The only allowed values
116
of <buftype> are EGL_OPENVG_IMAGE and EGL_D3D_TEXTURE_ANGLE".
117
118
Append the following text to the fourth paragraph of Section 3.5.3.
119
"When <buftype> is EGL_D3D_TEXTURE_ANGLE, <buffer> must be
120
a valid D3D texture object, cast into the type EGLClientBuffer. See table
121
egl.restrictions for acceptable texture object types and formats. If the
122
EGL_ANGLE_device_d3d extension is present, the provided D3D texture object
123
must have been created by the same D3D device queried from the display.
124
If these requirements are not met, an EGL_BAD_PARAMETER error is
125
generated."
126
127
---------------------------------------------------------------------------
128
Resource Type Resource Restrictions
129
---------------------------------------------------------------------------
130
IDirect3DTexture9 Memory pool must be D3DPOOL_DEFAULT.
131
132
Format must be D3DFMT_R8G8B8, D3DFMT_A8R8G8B8,
133
D3DFMT_A16B16G16R16F or D3DFMT_A32B32G32R32F.
134
135
EGL_TEXTURE_INTERNAL_FORMAT_ANGLE is not supported.
136
137
EGL_TEXTURE_OFFSET_X_ANGLE and EGL_TEXTURE_OFFSET_Y_ANGLE
138
are not supported.
139
140
ID3D11Texture2D Usage flags must be D3D11_USAGE_DEFAULT.
141
142
Format must be
143
DXGI_FORMAT_R8G8B8A8_UNORM,
144
DXGI_FORMAT_R8G8B8A8_UNORM_SRGB,
145
DXGI_FORMAT_B8G8R8A8_UNORM,
146
DXGI_FORMAT_B8G8R8A8_UNORM_SRGB (support is optional),
147
DXGI_FORMAT_R8G8B8A8_TYPELESS (support is optional),
148
DXGI_FORMAT_B8G8R8A8_TYPELESS (support is optional),
149
DXGI_FORMAT_R16G16B16A16_FLOAT,
150
DXGI_FORMAT_R32G32B32A32_FLOAT,
151
DXGI_FORMAT_R10G10B10A2_UNORM,
152
DXGI_FORMAT_NV12,
153
DXGI_FORMAT_P010, or
154
DXGI_FORMAT_P016.
155
156
EGL_D3D11_TEXTURE_PLANE_ANGLE must be specified for YUV
157
formats DXGI_FORMAT_NV12, DXGI_FORMAT_P010, or
158
DXGI_FORMAT_P016, and must be 0 or 1. It is ignored for
159
all non-YUV formats.
160
161
EGL_TEXTURE_INTERNAL_FORMAT_ANGLE (if supported) must be
162
GL_RGBA (supported for all non-YUV formats),
163
GL_RGB (supported for all non-YUV formats except
164
DXGI_FORMAT_R10G10B10A2_UNORM),
165
GL_BGRA_EXT (supported only for
166
DXGI_FORMAT_B8G8R8A8_UNORM,
167
DXGI_FORMAT_B8G8R8A8_UNORM_SRGB, or
168
DXGI_FORMAT_B8G8R8A8_TYPELESS).
169
It is ignored for all YUV formats.
170
--------------------------------------------------------------------------
171
Table egl.restrictions - Restrictions on D3D resources that can be used
172
as a <buffer>.
173
--------------------------------------------------------------------------
174
175
Append to the fifth paragraph of Section 3.5.3.
176
"In addition, in case buftype is EGL_D3D_TEXTURE_ANGLE and the D3D resource
177
has a typeless DXGI format, attrib_list may contain the attribute
178
EGL_GL_COLORSPACE."
179
180
Append to the end of Section 3.5.3.
181
"When a pbuffer is created with type EGL_D3D_TEXTURE_ANGLE, the contents
182
of the associcated D3D texture object are undefined while the pbuffer is
183
the current read surface, draw surface or bound to a client texture."
184
185
Append to the end of Section 3.5.3.
186
"When a pbuffer is created with type EGL_D3D_TEXTURE_ANGLE, and the
187
EGL_GL_COLORSPACE attribute is not specified in attrib_list, the
188
EGL_GL_COLORSPACE attribute of the surface is determined by the DXGI format
189
of the Direct3D texture. For *_SRGB DXGI formats, the value of
190
EGL_GL_COLORSPACE is EGL_GL_COLORSPACE_SRGB. For other formats including
191
*_TYPELESS DXGI formats, the value of EGL_GL_COLORSPACE defaults to
192
EGL_GL_COLORSPACE_LINEAR."
193
194
Issues
195
196
1. What renderers allow the use of a multi-sampled texture?
197
198
PROPOSED: Multi-sampled texture support is currently limited to D3D11.
199
Additionally, the client is responsible for resolving the texture.
200
201
2. How does this extension interact with EXT_sRGB_write_control?
202
203
If GL_FRAMEBUFFER_SRGB_EXT is disabled and a pbuffer created from a D3D
204
texture with an *_SRGB format is being rendered to, it is undefined whether
205
SRGB conversion will be performed.
206
207
3. What renderers allow the use of typeless textures?
208
209
PROPOSED: Support for typeless textures is currently limited to D3D11.
210
211
4. Can RGB formats be supported?
212
213
RESOLVED: RGB internal formats are supported for creating images from D3D11
214
textures in version 5 by setting EGL_TEXTURE_INTERNAL_FORMAT_ANGLE attribute
215
to GL_RGB. Images with an RGB format will ensure that the alpha channel of
216
the texture is reset to 1.0 when it is used.
217
218
5. What operations do the texture offsets affect?
219
220
RESOLVED: The texture offsets specified by EGL_TEXTURE_OFFSET_X_ANGLE and
221
EGL_TEXTURE_OFFSET_Y_ANGLE affect only rendering into the surface.
222
Specifically these affect the internal D3D viewport and scissor rect states
223
for draws, clears, and blits. This is needed to apply the update offset
224
returned by calling BeginDraw() on IDCompositionSurface, and is needed for
225
correct rendering in that case.
226
227
Revision History
228
229
Version 8, 2021/01/13 - added support for texture array.
230
231
Version 7, 2021/01/12 - added support for NV12/P010/P016 planar formats.
232
233
Version 6, 2020/05/12 - added support for specifying texture offsets.
234
235
Version 5, 2019/09/06 - added support for creating EGLImage.
236
237
Version 4, 2019/04/15 - added support for DXGI_FORMAT_R10G10B10A2_UNORM.
238
239
Version 3, 2018/01/23 - added support for typeless textures.
240
241
Version 2, 2018/01/15 - clarified SRGB conversion handling.
242
243
Version 1, 2016/10/05 - first draft.
244
245