Hash :
706f8a31
        
        Author :
  
        
        Date :
2022-02-04T04:22:10
        
      
Support gl internal format for creating EGLImage from VkImage Bug: chromium:1290638 Change-Id: I5c9815b727497f63b9f04ecbd8c27deef4b929c8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3438666 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Peng Huang <penghuang@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
Name
    ANGLE_vulkan_image
Name Strings
    EGL_ANGLE_vulkan_image
Contributors
    Peng Huang
Contacts
    Peng Huang, Google Inc. (penghuang 'at' chromium.org)
Status
    Draft
Version
    Version 3, Feb 4, 2022
Number
    EGL Extension #??
Dependencies
    This extension is written against the wording of the EGL 1.4
    Specification.
    References the EGL_ANGLE_device_vulkan and EGL_KHR_image_base extensions.
Overview
    This extension allows exporting VkImage from EGL images.
New Types
    None
New Procedures and Functions
    EGLBoolean eglExportVkImageANGLE(
        EGLDisplay dpy,
        EGLImageKHR image,
        void* vk_image,
        void* vk_image_create_info);
New Tokens
    EGL_VULKAN_IMAGE_ANGLE 0x34D3
    EGL_VULKAN_IMAGE_CREATE_INFO_HI_ANGLE 0x34D4
    EGL_VULKAN_IMAGE_CREATE_INFO_LO_ANGLE 0x34D5
Additions to Chapter 2 of the EGL 1.4 Specification (EGL Operation)
    Add to section 2.5.1 "EGLImage Specification" (as defined by the
    EGL_KHR_image_base specification), in the description of
    eglCreateImageKHR:
   "Values accepted for <target> are listed in Table aaa, below.
      +----------------------------+-----------------------------------------+
      |  <target>                  |  Notes                                  |
      +----------------------------+-----------------------------------------+
      |  EGL_VULKAN_IMAGE_ANGLE    |  Used for VkImage objects               |
      +----------------------------+-----------------------------------------+
       Table aaa.  Legal values for eglCreateImageKHR <target> parameter
    ...
    If <target> is EGL_VULKAN_IMAGE_ANGLE, <dpy> must be a valid display, <ctx>
    must be EGL_NO_CONTEXT, <buffer> must be a pointer to a valid VkImage
    (cast into the type EGLClientBuffer), the VkImage must be created with the
    same VkDevice used by GL implementation and attributes other than
    EGL_TEXTURE_INTERNAL_FORMAT_ANGLE, EGL_VULKAN_IMAGE_CREATE_INFO_HI_ANGLE or
    EGL_VULKAN_IMAGE_CREATE_INFO_LO_ANGLE are ignored.
    EGL_VULKAN_IMAGE_CREATE_INFO_HI_ANGLE and
    EGL_VULKAN_IMAGE_CREATE_INFO_LO_ANGLE must be specified. They contain
    hi 32bits and lo 32bits of a pointer to the memory stores a valid
    VkImageCreateInfo structure. The GL implementation will get all necessary
    info of the VkImage from it. All supported structures in the pNext structure
    chain will be parsed, not supported structures will be ignored.
    If EGL_TEXTURE_INTERNAL_FORMAT_ANGLE is specified, it is used to interpret
    <buffer> according to the provided internal format. If it is specified, it
    must be GL_RGBA (supported for all RGBA and BGRA formats),
    GL_RGB (supported for all RGBA and BGRA formats except
    VK_FORMAT_R10G10B10A2_UNORM), GL_BGRA_EXT (supported only for
    VK_FORMAT_B8G8R8A8_UNORM and VK_FORMAT_B8G8R8A8_SRGB),
    GL_RGB10_A2_EXT (supported for VK_FORMAT_A2R10G10B10_UNORM_PACK32),
    GL_RED_EXT (supported for VK_FORMAT_R8_UNORM and VK_FORMAT_R16_UNORM),
    GL_RG_EXT (supported for VK_FORMAT_R8G8_UNORM and VK_FORMAT_R16G16_UNORM),
    GL_R16_EXT (supported for VK_FORMAT_R16_UNORM),
    GL_RG16_EXT (supported for VK_FORMAT_R16G16_UNORM), or GL_NONE.
Additions to the EGL 1.4 Specification:
    To export VkImage from an EGLImage, a new API is required.
    The new entrypoint
        EGLBoolean eglExportVkImageANGLE(
            EGLDisplay dpy,
            EGLImageKHR image,
            void* vk_image,
            void* vk_image_create_info);
    is used to retrieve the VkImage and VkImageCreateInfo of the EGLImage.
    The VkImage is stored into <vk_image> pointed memory, and VkImageCreateInfo
    is filled into <vk_image_create_info> pointed memory.
Issues
    None
Revision History
    Version 1, 2021/11/17 - first draft.
    Version 2, 2021/12/10 - add support for creating EGLImageKHR from VkImage.
    Version 3, 2022/02/04 - add support for EGL_TEXTURE_INTERNAL_FORMAT_ANGLE.