Name

    ANGLE_d3d_texture_client_buffer

Name Strings

    EGL_ANGLE_d3d_texture_client_buffer

Contributors

    Geoff Lang
    Olli Etuaho

Contacts

    Geoff Lang, Google Inc. (geofflang 'at' google.com)

Status

    Draft

Version

    Version 3, Jan 23, 2018

Number

    EGL Extension #??

Dependencies

    This extension is written against the wording of the EGL 1.5
    Specification.

    References the EGL_ANGLE_device_d3d extension.

Overview

    This extension allows creating EGL surfaces from D3D texture objects.

New Types

    None

New Procedures and Functions

    None

New Tokens

    Accepted in the <buftype> parameter of eglCreatePbufferFromClientBuffer:

        EGL_D3D_TEXTURE_ANGLE            0x33A3

Additions to Chapter 3 of the EGL 1.5 Specification (EGL Functions and Errors)

    Replace the last sentence of paragraph 1 of Section 3.5.3 with the
    following text.
    "Currently, the only client API resources which may be bound in this
    fashion are OpenVG VGImage objects and Direct3D texture objects."

    Replace the last sentence of paragraph 2 ("To bind a client API...") of
    Section 3.5.3 with the following text.
    "When <buftype> is EGL_OPENVG_IMAGE or EGL_D3D_TEXTURE_ANGLE, the width and
    height of the pbuffer are determined by the width and height of <buffer>."

    Replace the third paragraph of Section 3.5.3 with the following text.
    "<buftype> specifies the type of buffer to be bound. The only allowed values
    of <buftype> are EGL_OPENVG_IMAGE and EGL_D3D_TEXTURE_ANGLE".

    Append the following text to the fourth paragraph of Section 3.5.3.
    "When <buftype> is EGL_D3D_TEXTURE_ANGLE, <buffer> must be
    a valid D3D texture object, cast into the type EGLClientBuffer. See table
    egl.restrictions for acceptable texture object types and formats. If the
    EGL_ANGLE_device_d3d extension is present, the provided D3D texture object
    must have been created by the same D3D device queried from the display.
    If these requirements are not met, an EGL_BAD_PARAMETER error is
    generated."

    ---------------------------------------------------------------------------
    Resource Type      Resource Restrictions
    ---------------------------------------------------------------------------
    IDirect3DTexture9  Memory pool must be D3DPOOL_DEFAULT. Format must be
                       D3DFMT_R8G8B8, D3DFMT_A8R8G8B8, D3DFMT_A16B16G16R16F or
                       D3DFMT_A32B32G32R32F.
    ID3D11Texture2D    Usage flags must be D3D11_USAGE_DEFAULT. Format must be
                       DXGI_FORMAT_R8G8B8A8_UNORM,
                       DXGI_FORMAT_R8G8B8A8_UNORM_SRGB,
                       DXGI_FORMAT_B8G8R8A8_UNORM,
                       DXGI_FORMAT_B8G8R8A8_UNORM_SRGB (support is optional),
                       DXGI_FORMAT_R8G8B8A8_TYPELESS (support is optional),
                       DXGI_FORMAT_B8G8R8A8_TYPELESS (support is optional),
                       DXGI_FORMAT_R16G16B16A16_FLOAT or
                       DXGI_FORMAT_R32G32B32A32_FLOAT.
    --------------------------------------------------------------------------
    Table egl.restrictions - Restrictions on D3D resources that can be used
    as a <buffer>.
    --------------------------------------------------------------------------

    Append to the fifth paragraph of Section 3.5.3.
    "In addition, in case buftype is EGL_D3D_TEXTURE_ANGLE and the D3D resource
    has a typeless DXGI format, attrib_list may contain the attribute
    EGL_GL_COLORSPACE."

    Append to the end of Section 3.5.3.
    "When a pbuffer is created with type EGL_D3D_TEXTURE_ANGLE, the contents
    of the associcated D3D texture object are undefined while the pbuffer is
    the current read surface, draw surface or bound to a client texture."

    Append to the end of Section 3.5.3.
    "When a pbuffer is created with type EGL_D3D_TEXTURE_ANGLE, and the
    EGL_GL_COLORSPACE attribute is not specified in attrib_list, the
    EGL_GL_COLORSPACE attribute of the surface is determined by the DXGI format
    of the Direct3D texture. For *_SRGB DXGI formats, the value of
    EGL_GL_COLORSPACE is EGL_GL_COLORSPACE_SRGB. For other formats including
    *_TYPELESS DXGI formats, the value of EGL_GL_COLORSPACE defaults to
    EGL_GL_COLORSPACE_LINEAR."

Issues

    1. What renderers allow the use of a multi-sampled texture?

    PROPOSED: Mutli-sampled texture support is currently limited to D3D11. Additionally,
    the client is responsible for resolving the texture.

    2. How does this extension interact with EXT_sRGB_write_control?

    If GL_FRAMEBUFFER_SRGB_EXT is disabled and a pbuffer created from a D3D
    texture with an *_SRGB format is being rendered to, it is undefined whether
    SRGB conversion will be performed.

    3. What renderers allow the use of typeless textures?

    PROPOSED: Support for typeless textures is currently limited to D3D11.

Revision History

    Version 3, 2018/01/23 - added support for typeless textures.

    Version 2, 2018/01/15 - clarified SRGB conversion handling.

    Version 1, 2016/10/05 - first draft.