Path: blob/main_old/extensions/EGL_ANGLE_d3d_texture_client_buffer.txt
1693 views
Name12ANGLE_d3d_texture_client_buffer34Name Strings56EGL_ANGLE_d3d_texture_client_buffer78Contributors910Geoff Lang11Olli Etuaho12Sunny Sachanandani1314Contacts1516Geoff Lang, Google Inc. (geofflang 'at' google.com)1718Status1920Draft2122Version2324Version 6, May 12, 20202526Number2728EGL Extension #??2930Dependencies3132This extension is written against the wording of the EGL 1.233Specification.3435References the EGL_ANGLE_device_d3d and EGL_KHR_image_base extensions.3637Overview3839This extension allows creating EGL surfaces and EGL images from D3D texture40objects.4142New Types4344None4546New Procedures and Functions4748None4950New Tokens5152Accepted by the <target> parameter of eglCreateImageKHR and <buftype>53parameter of eglCreatePbufferFromClientBuffer:5455EGL_D3D_TEXTURE_ANGLE 0x33A35657Additions to Chapter 2 of the EGL 1.2 Specification (EGL Operation)5859Add to section 2.5.1 "EGLImage Specification" (as defined by the60EGL_KHR_image_base specification), in the description of61eglCreateImageKHR:6263"Values accepted for <target> are listed in Table aaa, below.6465+----------------------------+-----------------------------------------+66| <target> | Notes |67+----------------------------+-----------------------------------------+68| EGL_D3D_TEXTURE_ANGLE | Used for Direct3D11 texture objects |69+----------------------------+-----------------------------------------+70Table aaa. Legal values for eglCreateImageKHR <target> parameter7172...7374If <target> is EGL_D3D_TEXTURE_ANGLE, <dpy> must be a valid display, <ctx>75must be EGL_NO_CONTEXT, <buffer> must be a pointer to a valid D3D11 texture76object (cast into the type EGLClientBuffer), and attributes other than77EGL_TEXTURE_INTERNAL_FORMAT_ANGLE, EGL_TEXTURE_OFFSET_X_ANGLE, or78EGL_TEXTURE_OFFSET_Y_ANGLE are ignored. The width and height of the pbuffer79are determined by the width and height of <buffer>.8081If EGL_TEXTURE_INTERNAL_FORMAT_ANGLE is specified, it is used to interpret82<buffer> according to the provided internal format. See table83egl.restrictions for acceptable texture object types and formats.8485If EGL_D3D11_TEXTURE_PLANE_ANGLE is specified, it is used to access the86specified plane of <buffer>. See table egl.restrictions for acceptable87values.8889If EGL_D3D11_TEXTURE_ARRAY_SLICE_ANGLE is specified, it is used to access90the specified array slice of the texture array <buffer>.9192If EGL_TEXTURE_OFFSET_X_ANGLE or EGL_TEXTURE_OFFSET_Y_ANGLE are specified,93they must be non-negative and are used to offset all rendering into the94surface including blits, clears and draws.9596If the EGL_ANGLE_device_d3d extension is present, the provided D3D11 texture97object must have been created by the same D3D11 device queried from the98display. If these requirements are not met, an EGL_BAD_PARAMETER error is99generated."100101Additions to Chapter 3 of the EGL 1.2 Specification (EGL Functions and Errors)102103Replace the last sentence of paragraph 1 of Section 3.5.3 with the104following text.105"Currently, the only client API resources which may be bound in this106fashion are OpenVG VGImage objects and Direct3D texture objects."107108Replace the last sentence of paragraph 2 ("To bind a client API...") of109Section 3.5.3 with the following text.110"When <buftype> is EGL_OPENVG_IMAGE or EGL_D3D_TEXTURE_ANGLE, the width and111height of the pbuffer are determined by the width and height of <buffer>."112113Replace the third paragraph of Section 3.5.3 with the following text.114"<buftype> specifies the type of buffer to be bound. The only allowed values115of <buftype> are EGL_OPENVG_IMAGE and EGL_D3D_TEXTURE_ANGLE".116117Append the following text to the fourth paragraph of Section 3.5.3.118"When <buftype> is EGL_D3D_TEXTURE_ANGLE, <buffer> must be119a valid D3D texture object, cast into the type EGLClientBuffer. See table120egl.restrictions for acceptable texture object types and formats. If the121EGL_ANGLE_device_d3d extension is present, the provided D3D texture object122must have been created by the same D3D device queried from the display.123If these requirements are not met, an EGL_BAD_PARAMETER error is124generated."125126---------------------------------------------------------------------------127Resource Type Resource Restrictions128---------------------------------------------------------------------------129IDirect3DTexture9 Memory pool must be D3DPOOL_DEFAULT.130131Format must be D3DFMT_R8G8B8, D3DFMT_A8R8G8B8,132D3DFMT_A16B16G16R16F or D3DFMT_A32B32G32R32F.133134EGL_TEXTURE_INTERNAL_FORMAT_ANGLE is not supported.135136EGL_TEXTURE_OFFSET_X_ANGLE and EGL_TEXTURE_OFFSET_Y_ANGLE137are not supported.138139ID3D11Texture2D Usage flags must be D3D11_USAGE_DEFAULT.140141Format must be142DXGI_FORMAT_R8G8B8A8_UNORM,143DXGI_FORMAT_R8G8B8A8_UNORM_SRGB,144DXGI_FORMAT_B8G8R8A8_UNORM,145DXGI_FORMAT_B8G8R8A8_UNORM_SRGB (support is optional),146DXGI_FORMAT_R8G8B8A8_TYPELESS (support is optional),147DXGI_FORMAT_B8G8R8A8_TYPELESS (support is optional),148DXGI_FORMAT_R16G16B16A16_FLOAT,149DXGI_FORMAT_R32G32B32A32_FLOAT,150DXGI_FORMAT_R10G10B10A2_UNORM,151DXGI_FORMAT_NV12,152DXGI_FORMAT_P010, or153DXGI_FORMAT_P016.154155EGL_D3D11_TEXTURE_PLANE_ANGLE must be specified for YUV156formats DXGI_FORMAT_NV12, DXGI_FORMAT_P010, or157DXGI_FORMAT_P016, and must be 0 or 1. It is ignored for158all non-YUV formats.159160EGL_TEXTURE_INTERNAL_FORMAT_ANGLE (if supported) must be161GL_RGBA (supported for all non-YUV formats),162GL_RGB (supported for all non-YUV formats except163DXGI_FORMAT_R10G10B10A2_UNORM),164GL_BGRA_EXT (supported only for165DXGI_FORMAT_B8G8R8A8_UNORM,166DXGI_FORMAT_B8G8R8A8_UNORM_SRGB, or167DXGI_FORMAT_B8G8R8A8_TYPELESS).168It is ignored for all YUV formats.169--------------------------------------------------------------------------170Table egl.restrictions - Restrictions on D3D resources that can be used171as a <buffer>.172--------------------------------------------------------------------------173174Append to the fifth paragraph of Section 3.5.3.175"In addition, in case buftype is EGL_D3D_TEXTURE_ANGLE and the D3D resource176has a typeless DXGI format, attrib_list may contain the attribute177EGL_GL_COLORSPACE."178179Append to the end of Section 3.5.3.180"When a pbuffer is created with type EGL_D3D_TEXTURE_ANGLE, the contents181of the associcated D3D texture object are undefined while the pbuffer is182the current read surface, draw surface or bound to a client texture."183184Append to the end of Section 3.5.3.185"When a pbuffer is created with type EGL_D3D_TEXTURE_ANGLE, and the186EGL_GL_COLORSPACE attribute is not specified in attrib_list, the187EGL_GL_COLORSPACE attribute of the surface is determined by the DXGI format188of the Direct3D texture. For *_SRGB DXGI formats, the value of189EGL_GL_COLORSPACE is EGL_GL_COLORSPACE_SRGB. For other formats including190*_TYPELESS DXGI formats, the value of EGL_GL_COLORSPACE defaults to191EGL_GL_COLORSPACE_LINEAR."192193Issues1941951. What renderers allow the use of a multi-sampled texture?196197PROPOSED: Multi-sampled texture support is currently limited to D3D11.198Additionally, the client is responsible for resolving the texture.1992002. How does this extension interact with EXT_sRGB_write_control?201202If GL_FRAMEBUFFER_SRGB_EXT is disabled and a pbuffer created from a D3D203texture with an *_SRGB format is being rendered to, it is undefined whether204SRGB conversion will be performed.2052063. What renderers allow the use of typeless textures?207208PROPOSED: Support for typeless textures is currently limited to D3D11.2092104. Can RGB formats be supported?211212RESOLVED: RGB internal formats are supported for creating images from D3D11213textures in version 5 by setting EGL_TEXTURE_INTERNAL_FORMAT_ANGLE attribute214to GL_RGB. Images with an RGB format will ensure that the alpha channel of215the texture is reset to 1.0 when it is used.2162175. What operations do the texture offsets affect?218219RESOLVED: The texture offsets specified by EGL_TEXTURE_OFFSET_X_ANGLE and220EGL_TEXTURE_OFFSET_Y_ANGLE affect only rendering into the surface.221Specifically these affect the internal D3D viewport and scissor rect states222for draws, clears, and blits. This is needed to apply the update offset223returned by calling BeginDraw() on IDCompositionSurface, and is needed for224correct rendering in that case.225226Revision History227228Version 8, 2021/01/13 - added support for texture array.229230Version 7, 2021/01/12 - added support for NV12/P010/P016 planar formats.231232Version 6, 2020/05/12 - added support for specifying texture offsets.233234Version 5, 2019/09/06 - added support for creating EGLImage.235236Version 4, 2019/04/15 - added support for DXGI_FORMAT_R10G10B10A2_UNORM.237238Version 3, 2018/01/23 - added support for typeless textures.239240Version 2, 2018/01/15 - clarified SRGB conversion handling.241242Version 1, 2016/10/05 - first draft.243244245