Edit

kc3-lang/angle/extensions/EGL_ANGLE_d3d_texture_client_buffer.txt

Branch :

  • Show log

    Commit

  • Author : Olli Etuaho
    Date : 2018-01-17 11:36:24
    Hash : d66e1939
    Message : Allow creating EGL pbuffers from typeless D3D textures A new extension EGL_ANGLE_d3d_typeless_texture_client_buffer is added that allows creating EGL pbuffers from typeless D3D textures. The extension increases the flexibility of the API compared to plain EGL_ANGLE_D3D_texture_client_buffer. The colorspace for the created EGL pbuffer can be set by using the EGL_GL_COLORSPACE attribute. Internally this sets the ANGLE format of the buffer. There are new ANGLE formats that are used specifically for typeless textures, separate ones for SRGB and linear views into the D3D textures. The extension is only supported on the D3D11 backend of ANGLE. BUG=angleproject:2300 TEST=angle_white_box_tests Change-Id: I6a6cb873d2cc0dca0b7f18a0f2cd35e7bafcb7d8 Reviewed-on: https://chromium-review.googlesource.com/873917 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>

  • extensions/EGL_ANGLE_d3d_texture_client_buffer.txt
  • 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.