Hash :
33d12cb9
        
        Author :
  
        
        Date :
2015-03-25T13:31:32
        
      
Add drafts for device query extensions. These extensions give power apps the ability to query raw device pointers from the EGL layer. EGL_EXT_device_query is based on EGL_EXT_device_base, which is being split into device_query and device_enumerate. We remove the device enumeration logic, and only allow the app to query the current device from a display, which matches how ANGLE works internally. EGL_ANGLE_device_d3d gives the app the ability to query D3D devices associated with a display. BUG=angleproject:935 Change-Id: I8079661f00d11717ed0e792c9fe8dc5c26f67dcc Reviewed-on: https://chromium-review.googlesource.com/252110 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@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 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188
Name
    EXT_device_query
Name Strings
    EGL_EXT_device_query
Contributors
    James Jones, NVIDIA  (jajones 'at' nvidia.com)
    Jamie Madill, Google  (jmadill 'at' google.com)
Contacts
    Jamie Madill, Google  (jmadill 'at' google.com)
Status
    Draft
Version
    Version 1 - Mar 25rd, 2015
Number
    EGL Extension #XXX
Extension Type
    EGL client extension
Dependencies
    Written against the wording of EGL 1.5.
    Requires EGL 1.5 or an earlier verison of EGL with the
    EGL_EXT_client_extensions extension.
Overview
    Increasingly, EGL and its client APIs are being used in place of
    "native" rendering APIs to implement the basic graphics
    functionality of native windowing systems.  This creates demand
    for a method to access native GPU or device objects directly
    rather than calling EGL or GL entry points.
    This extension defines the method for an application to query
    native device objects from an EGL Display.
New Types
    This is the type of a handle that represents an EGLDeviceEXT
    object.
        typedef void* EGLDeviceEXT;
    If EGL 1.5 is not supported, the following type is added, as
    defined in the EGL 1.5 specification:
        typedef intptr_t EGLAttrib;
New Functions
    EGLBoolean eglQueryDeviceAttribEXT(EGLDeviceEXT device,
                                       EGLint attribute,
                                       EGLAttrib *value);
    const char *eglQueryDeviceStringEXT(EGLDeviceEXT device,
                                        EGLint name);
    EGLBoolean eglQueryDisplayAttribEXT(EGLDisplay dpy,
                                        EGLint attribute,
                                        EGLAttrib *value);
New Tokens
    Functions with a return type of EGLDeviceEXT will return this
    value on failure:
        EGL_NO_DEVICE_EXT                      ((EGLDeviceEXT)0)
    This error value will be generated by functions that take an
    EGLDeviceEXT object as a parameter:
        EGL_BAD_DEVICE_EXT                     0x322B
    Accepted by the <attribute> parameter of
    eglQueryDisplayAttribEXT:
        EGL_DEVICE_EXT                         0x322C
Add a new section "2.1.2 Devices" after "2.1.1 Scalar Types"
    All EGL operations occur on an EGLDeviceEXT.  However, devices
    themselves expose no functionality.  They are simple abstract
    objects that exist only for the sake of enumeration and
    defining a namespace.
Modify the last sentence of section "2.1.3" Displays" to read:
    Besides devices, objects are always specified by the combination
    of an EGLDisplay parameter with a parameter representing the
    handle of the object.
Add a new extension type to the list in section "2.8 Extensions"
    Device Extensions
        A *device extension* adds functionality to an individual
        EGLDeviceEXT.  Different instances of EGLDeviceEXT may support
        different sets of device extensions
Add a new error to section "3.1 Errors"
    EGL_BAD_DEVICE_EXT
        An EGLDeviceEXT argument does not refer to a valid
        EGLDeviceEXT.  Any command taking an EGLDeviceEXT parameter
        may generate this error.
Add a section "3.2 Devices" after "3.1 Errors"
    To query the properties of a device, use:
        EGLBoolean eglQueryDeviceAttribEXT(EGLDeviceEXT device,
                                           EGLint attribute,
                                           EGLAttrib *value);
    On success, EGL_TRUE is returned and the requested attribute value
    is returned in <value>.  Currently there are no valid values of
    <attribute> defined.
    On failure, EGL_FALSE is returned.  An EGL_BAD_ATTRIBUTE error is
    generated if <attribute> is not a valid attribute.  An
    EGL_BAD_DEVICE_EXT error is generated if <device> is not a valid
    EGLDeviceEXT.
        const char *eglQueryDeviceStringEXT(EGLDeviceEXT device,
                                            EGLint name);
    returns a pointer to a static, zero-terminated string describing
    some aspect of the specified EGLDeviceEXT.  <name> must be
    EGL_EXTENSIONS.
    The EGL_EXTENSIONS string describes which device extensions are
    supported by <device>.  The string is of the same format specified
    for display and client extension strings in section 3.4. Note that
    device extensions are properties of the device, and are distinct
    from other extension strings.
    On failure, NULL is returned.  An EGL_BAD_DEVICE_EXT error is
    generated if <device> is not a valid EGLDeviceEXT.  An
    EGL_BAD_PARAMETER error is generated if <name> is not one of the
    values described above.
Add a section "3.4 Display Attributes" after "3.3 EGL Versioning"
    To query attributes of an initialized display, use:
        EGLBoolean eglQueryDisplayAttribEXT(EGLDisplay dpy,
                                            EGLint name,
                                            EGLAttrib *value);
    On success, EGL_TRUE is returned.  If <name> is EGL_DEVICE_EXT,
    the EGLDeviceEXT associated with <dpy> is returned in <value>.
    All displays have an associated EGLDeviceEXT, regardless of how
    they were created.  A successful query of EGL_DEVICE_EXT will
    never return EGL_NO_DEVICE_EXT.
    On failure, EGL_FALSE is returned.  An EGL_NOT_INITIALIZED error
    is generated if EGL is not initialized for <dpy>.  An
    EGL_BAD_ATTRIBUTE error is generated if <name> is not a valid
    value.
    Because the EGLDeviceEXT is a property of <dpy>, any use of an
    associated EGLDeviceEXT after <dpy> has been terminated gives
    undefined results. Querying an EGL_DEVICE_EXT from <dpy> after a
    call to eglTerminate() (and subsequent re-initialization) may
    return a different value.
Issues
    None.
Revision History:
    #1  (Mar 25rd, 2015) Jamie Madill
        - Initial Draft based on EGL_EXT_device_base