EGL_IMG_context_priority#

Supported Hardware#

Series5, Series5XT, Series6, Series6XE, Series6XT

Valid APIs#

EGL 1.0, 1.1, 1.2, 1.3, 1.4, 1.5

Description#

This extension allows a developer to set the execution priority of an EGL context, by setting a new attribute when creating the context: EGL_CONTEXT_PRIORITY_LEVEL_IMG. This can be useful in a multi-process environment, where an API-utilising task can be considered lower or higher priority.

Three priority levels are described in this extension, EGL_CONTEXT_PRIORITY_HIGH_IMG, EGL_CONTEXT_PRIORITY_MEDIUM_IMG and EGL_CONTEXT_PRIORITY_LOW_IMG, meaning high, medium and low priority, respectively. By default, all contexts are created with medium priority, and so are on equal execution footing. The specification of the priority is only a hint though, and so can be ignored by the implementation - this is typical when, for example, high priority contexts are reserved for system processes.

A query is provided to obtain the real priority of the client after it has been created.

Note#

For Series5 and Series5XT implementations of this extension, developer can only set a priority per process, no matter how many contexts are in that process. To set multiple priorities, multiple processes must be used, and EGLImages typically used for sharing. For Series6, Series6XE and Series6XT implementations of this extension, developer can set priority at a context granularity rather than process granularity.

Example#

// Set up the context attributes, specifying OpenGL ES 3.0 support and a low priority context.
EGLint contextAttribs[] =
{
    EGL_CONTEXT_CLIENT_VERSION, 3,
    EGL_CONTEXT_PRIORITY_LEVEL_IMG, EGL_CONTEXT_PRIORITY_LOW_IMG,
    EGL_NONE
};
// Create the context with the context attributes supplied
eglContext = eglCreateContext(eglDisplay, eglConfig, NULL, contextAttribs);