102f4aeb0Sopenharmony_ciName
202f4aeb0Sopenharmony_ci
302f4aeb0Sopenharmony_ci    EXT_device_query
402f4aeb0Sopenharmony_ci
502f4aeb0Sopenharmony_ciName Strings
602f4aeb0Sopenharmony_ci
702f4aeb0Sopenharmony_ci    EGL_EXT_device_query
802f4aeb0Sopenharmony_ci
902f4aeb0Sopenharmony_ciContributors
1002f4aeb0Sopenharmony_ci
1102f4aeb0Sopenharmony_ci    James Jones, NVIDIA  (jajones 'at' nvidia.com)
1202f4aeb0Sopenharmony_ci    Jamie Madill, Google  (jmadill 'at' google.com)
1302f4aeb0Sopenharmony_ci
1402f4aeb0Sopenharmony_ciContacts
1502f4aeb0Sopenharmony_ci
1602f4aeb0Sopenharmony_ci    Jamie Madill, Google  (jmadill 'at' google.com)
1702f4aeb0Sopenharmony_ci
1802f4aeb0Sopenharmony_ciStatus
1902f4aeb0Sopenharmony_ci
2002f4aeb0Sopenharmony_ci    Complete.
2102f4aeb0Sopenharmony_ci
2202f4aeb0Sopenharmony_ciVersion
2302f4aeb0Sopenharmony_ci
2402f4aeb0Sopenharmony_ci    Version 1 - Mar 25rd, 2015
2502f4aeb0Sopenharmony_ci
2602f4aeb0Sopenharmony_ciNumber
2702f4aeb0Sopenharmony_ci
2802f4aeb0Sopenharmony_ci    EGL Extension #89
2902f4aeb0Sopenharmony_ci
3002f4aeb0Sopenharmony_ciExtension Type
3102f4aeb0Sopenharmony_ci
3202f4aeb0Sopenharmony_ci    EGL client extension
3302f4aeb0Sopenharmony_ci
3402f4aeb0Sopenharmony_ciDependencies
3502f4aeb0Sopenharmony_ci
3602f4aeb0Sopenharmony_ci    Written against the wording of EGL 1.5.
3702f4aeb0Sopenharmony_ci
3802f4aeb0Sopenharmony_ci    Requires EGL 1.5 or an earlier verison of EGL with the
3902f4aeb0Sopenharmony_ci    EGL_EXT_client_extensions extension.
4002f4aeb0Sopenharmony_ci
4102f4aeb0Sopenharmony_ciOverview
4202f4aeb0Sopenharmony_ci
4302f4aeb0Sopenharmony_ci    Increasingly, EGL and its client APIs are being used in place of
4402f4aeb0Sopenharmony_ci    "native" rendering APIs to implement the basic graphics
4502f4aeb0Sopenharmony_ci    functionality of native windowing systems.  This creates demand
4602f4aeb0Sopenharmony_ci    for a method to access native GPU or device objects directly
4702f4aeb0Sopenharmony_ci    rather than calling EGL or GL entry points.
4802f4aeb0Sopenharmony_ci
4902f4aeb0Sopenharmony_ci    This extension defines the method for an application to query
5002f4aeb0Sopenharmony_ci    native device objects from an EGL Display.
5102f4aeb0Sopenharmony_ci
5202f4aeb0Sopenharmony_ciNew Types
5302f4aeb0Sopenharmony_ci
5402f4aeb0Sopenharmony_ci    This is the type of a handle that represents an EGLDeviceEXT
5502f4aeb0Sopenharmony_ci    object.
5602f4aeb0Sopenharmony_ci
5702f4aeb0Sopenharmony_ci        typedef void* EGLDeviceEXT;
5802f4aeb0Sopenharmony_ci
5902f4aeb0Sopenharmony_ci    If EGL 1.5 is not supported, the following type is added, as
6002f4aeb0Sopenharmony_ci    defined in the EGL 1.5 specification:
6102f4aeb0Sopenharmony_ci
6202f4aeb0Sopenharmony_ci        typedef intptr_t EGLAttrib;
6302f4aeb0Sopenharmony_ci
6402f4aeb0Sopenharmony_ciNew Functions
6502f4aeb0Sopenharmony_ci
6602f4aeb0Sopenharmony_ci    EGLBoolean eglQueryDeviceAttribEXT(EGLDeviceEXT device,
6702f4aeb0Sopenharmony_ci                                       EGLint attribute,
6802f4aeb0Sopenharmony_ci                                       EGLAttrib *value);
6902f4aeb0Sopenharmony_ci
7002f4aeb0Sopenharmony_ci    const char *eglQueryDeviceStringEXT(EGLDeviceEXT device,
7102f4aeb0Sopenharmony_ci                                        EGLint name);
7202f4aeb0Sopenharmony_ci
7302f4aeb0Sopenharmony_ci    EGLBoolean eglQueryDisplayAttribEXT(EGLDisplay dpy,
7402f4aeb0Sopenharmony_ci                                        EGLint attribute,
7502f4aeb0Sopenharmony_ci                                        EGLAttrib *value);
7602f4aeb0Sopenharmony_ci
7702f4aeb0Sopenharmony_ciNew Tokens
7802f4aeb0Sopenharmony_ci
7902f4aeb0Sopenharmony_ci    Functions with a return type of EGLDeviceEXT will return this
8002f4aeb0Sopenharmony_ci    value on failure:
8102f4aeb0Sopenharmony_ci
8202f4aeb0Sopenharmony_ci        EGL_NO_DEVICE_EXT                      ((EGLDeviceEXT)0)
8302f4aeb0Sopenharmony_ci
8402f4aeb0Sopenharmony_ci    This error value will be generated by functions that take an
8502f4aeb0Sopenharmony_ci    EGLDeviceEXT object as a parameter:
8602f4aeb0Sopenharmony_ci
8702f4aeb0Sopenharmony_ci        EGL_BAD_DEVICE_EXT                     0x322B
8802f4aeb0Sopenharmony_ci
8902f4aeb0Sopenharmony_ci    Accepted by the <attribute> parameter of
9002f4aeb0Sopenharmony_ci    eglQueryDisplayAttribEXT:
9102f4aeb0Sopenharmony_ci
9202f4aeb0Sopenharmony_ci        EGL_DEVICE_EXT                         0x322C
9302f4aeb0Sopenharmony_ci
9402f4aeb0Sopenharmony_ciAdd a new section "2.1.2 Devices" after "2.1.1 Scalar Types"
9502f4aeb0Sopenharmony_ci
9602f4aeb0Sopenharmony_ci    All EGL operations occur on an EGLDeviceEXT.  However, devices
9702f4aeb0Sopenharmony_ci    themselves expose no functionality.  They are simple abstract
9802f4aeb0Sopenharmony_ci    objects that exist only for the sake of enumeration and
9902f4aeb0Sopenharmony_ci    defining a namespace.
10002f4aeb0Sopenharmony_ci
10102f4aeb0Sopenharmony_ciModify the last sentence of section "2.1.3" Displays" to read:
10202f4aeb0Sopenharmony_ci
10302f4aeb0Sopenharmony_ci    Besides devices, objects are always specified by the combination
10402f4aeb0Sopenharmony_ci    of an EGLDisplay parameter with a parameter representing the
10502f4aeb0Sopenharmony_ci    handle of the object.
10602f4aeb0Sopenharmony_ci
10702f4aeb0Sopenharmony_ciAdd a new extension type to the list in section "2.8 Extensions"
10802f4aeb0Sopenharmony_ci
10902f4aeb0Sopenharmony_ci    Device Extensions
11002f4aeb0Sopenharmony_ci        A *device extension* adds functionality to an individual
11102f4aeb0Sopenharmony_ci        EGLDeviceEXT.  Different instances of EGLDeviceEXT may support
11202f4aeb0Sopenharmony_ci        different sets of device extensions
11302f4aeb0Sopenharmony_ci
11402f4aeb0Sopenharmony_ciAdd a new error to section "3.1 Errors"
11502f4aeb0Sopenharmony_ci
11602f4aeb0Sopenharmony_ci    EGL_BAD_DEVICE_EXT
11702f4aeb0Sopenharmony_ci        An EGLDeviceEXT argument does not refer to a valid
11802f4aeb0Sopenharmony_ci        EGLDeviceEXT.  Any command taking an EGLDeviceEXT parameter
11902f4aeb0Sopenharmony_ci        may generate this error.
12002f4aeb0Sopenharmony_ci
12102f4aeb0Sopenharmony_ciAdd a section "3.2 Devices" after "3.1 Errors"
12202f4aeb0Sopenharmony_ci
12302f4aeb0Sopenharmony_ci    To query the properties of a device, use:
12402f4aeb0Sopenharmony_ci
12502f4aeb0Sopenharmony_ci        EGLBoolean eglQueryDeviceAttribEXT(EGLDeviceEXT device,
12602f4aeb0Sopenharmony_ci                                           EGLint attribute,
12702f4aeb0Sopenharmony_ci                                           EGLAttrib *value);
12802f4aeb0Sopenharmony_ci
12902f4aeb0Sopenharmony_ci    On success, EGL_TRUE is returned and the requested attribute value
13002f4aeb0Sopenharmony_ci    is returned in <value>.  Currently there are no valid values of
13102f4aeb0Sopenharmony_ci    <attribute> defined.
13202f4aeb0Sopenharmony_ci
13302f4aeb0Sopenharmony_ci    On failure, EGL_FALSE is returned.  An EGL_BAD_ATTRIBUTE error is
13402f4aeb0Sopenharmony_ci    generated if <attribute> is not a valid attribute.  An
13502f4aeb0Sopenharmony_ci    EGL_BAD_DEVICE_EXT error is generated if <device> is not a valid
13602f4aeb0Sopenharmony_ci    EGLDeviceEXT.
13702f4aeb0Sopenharmony_ci
13802f4aeb0Sopenharmony_ci        const char *eglQueryDeviceStringEXT(EGLDeviceEXT device,
13902f4aeb0Sopenharmony_ci                                            EGLint name);
14002f4aeb0Sopenharmony_ci
14102f4aeb0Sopenharmony_ci    returns a pointer to a static, zero-terminated string describing
14202f4aeb0Sopenharmony_ci    some aspect of the specified EGLDeviceEXT.  <name> must be
14302f4aeb0Sopenharmony_ci    EGL_EXTENSIONS.
14402f4aeb0Sopenharmony_ci
14502f4aeb0Sopenharmony_ci    The EGL_EXTENSIONS string describes which device extensions are
14602f4aeb0Sopenharmony_ci    supported by <device>.  The string is of the same format specified
14702f4aeb0Sopenharmony_ci    for display and client extension strings in section 3.4. Note that
14802f4aeb0Sopenharmony_ci    device extensions are properties of the device, and are distinct
14902f4aeb0Sopenharmony_ci    from other extension strings.
15002f4aeb0Sopenharmony_ci
15102f4aeb0Sopenharmony_ci    On failure, NULL is returned.  An EGL_BAD_DEVICE_EXT error is
15202f4aeb0Sopenharmony_ci    generated if <device> is not a valid EGLDeviceEXT.  An
15302f4aeb0Sopenharmony_ci    EGL_BAD_PARAMETER error is generated if <name> is not one of the
15402f4aeb0Sopenharmony_ci    values described above.
15502f4aeb0Sopenharmony_ci
15602f4aeb0Sopenharmony_ciAdd a section "3.4 Display Attributes" after "3.3 EGL Versioning"
15702f4aeb0Sopenharmony_ci
15802f4aeb0Sopenharmony_ci    To query attributes of an initialized display, use:
15902f4aeb0Sopenharmony_ci
16002f4aeb0Sopenharmony_ci        EGLBoolean eglQueryDisplayAttribEXT(EGLDisplay dpy,
16102f4aeb0Sopenharmony_ci                                            EGLint name,
16202f4aeb0Sopenharmony_ci                                            EGLAttrib *value);
16302f4aeb0Sopenharmony_ci
16402f4aeb0Sopenharmony_ci    On success, EGL_TRUE is returned.  If <name> is EGL_DEVICE_EXT,
16502f4aeb0Sopenharmony_ci    the EGLDeviceEXT associated with <dpy> is returned in <value>.
16602f4aeb0Sopenharmony_ci    All displays have an associated EGLDeviceEXT, regardless of how
16702f4aeb0Sopenharmony_ci    they were created.  A successful query of EGL_DEVICE_EXT will
16802f4aeb0Sopenharmony_ci    never return EGL_NO_DEVICE_EXT.
16902f4aeb0Sopenharmony_ci
17002f4aeb0Sopenharmony_ci    On failure, EGL_FALSE is returned.  An EGL_NOT_INITIALIZED error
17102f4aeb0Sopenharmony_ci    is generated if EGL is not initialized for <dpy>.  An
17202f4aeb0Sopenharmony_ci    EGL_BAD_ATTRIBUTE error is generated if <name> is not a valid
17302f4aeb0Sopenharmony_ci    value.
17402f4aeb0Sopenharmony_ci
17502f4aeb0Sopenharmony_ci    Because the EGLDeviceEXT is a property of <dpy>, any use of an
17602f4aeb0Sopenharmony_ci    associated EGLDeviceEXT after <dpy> has been terminated gives
17702f4aeb0Sopenharmony_ci    undefined results. Querying an EGL_DEVICE_EXT from <dpy> after a
17802f4aeb0Sopenharmony_ci    call to eglTerminate() (and subsequent re-initialization) may
17902f4aeb0Sopenharmony_ci    return a different value.
18002f4aeb0Sopenharmony_ci
18102f4aeb0Sopenharmony_ciIssues
18202f4aeb0Sopenharmony_ci
18302f4aeb0Sopenharmony_ci    None.
18402f4aeb0Sopenharmony_ci
18502f4aeb0Sopenharmony_ciRevision History:
18602f4aeb0Sopenharmony_ci
18702f4aeb0Sopenharmony_ci    #1  (Mar 25rd, 2015) Jamie Madill
18802f4aeb0Sopenharmony_ci        - Initial Draft based on EGL_EXT_device_base
189