Class EXTRobustness
Several recent trends in how OpenGL integrates into modern computer systems have created new requirements for robustness and security for OpenGL rendering contexts.
Additionally GPU architectures now support hardware fault detection; for example, video memory supporting ECC (error correcting codes) and error detection. OpenGL contexts should be capable of recovering from hardware faults such as uncorrectable memory errors. Along with recovery from such hardware faults, the recovery mechanism can also allow recovery from video memory access exceptions and system software failures. System software failures can be due to device changes or driver failures.
OpenGL queries that that return (write) some number of bytes to a buffer indicated by a pointer parameter introduce risk of buffer overflows that might be exploitable by malware. To address this, queries with return value sizes that are not expressed directly by the parameters to the query itself are given additional API functions with an additional parameter that specifies the number of bytes in the buffer and never writing bytes beyond that limit. This is particularly useful for multi-threaded usage of OpenGL contexts in a "share group" where one context can change objects in ways that can cause buffer overflows for another context's OpenGL queries.
The original ARB_vertex_buffer_object extension includes an issue that explicitly states program termination is allowed when out-of-bounds vertex buffer object fetches occur. Modern graphics hardware is capable well-defined behavior in the case of out-of- bounds vertex buffer object fetches. Older hardware may require extra checks to enforce well-defined (and termination free) behavior, but this expense is warranted when processing potentially untrusted content.
The intent of this extension is to address some specific robustness goals:
- For all existing OpenGL queries, provide additional "safe" APIs that limit data written to user pointers to a buffer size in bytes that is an explicit additional parameter of the query.
- Provide a mechanism for an OpenGL application to learn about graphics resets that affect the context. When a graphics reset occurs, the OpenGL context becomes unusable and the application must create a new context to continue operation. Detecting a graphics reset happens through an inexpensive query.
- Provide an enable to guarantee that out-of-bounds buffer object accesses by the GPU will have deterministic behavior and preclude application instability or termination due to an incorrect buffer access. Such accesses include vertex buffer fetches of attributes and indices, and indexed reads of uniforms or parameters from buffers.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Accepted by thevalue
parameter of GetBooleanv, GetIntegerv, and GetFloatv.static final int
Returned by GetGraphicsResetStatusEXT.static final int
Returned by GetGraphicsResetStatusEXT.static final int
Returned by GetIntegerv and related simple queries whenvalue
is RESET_NOTIFICATION_STRATEGY_EXT .static final int
Returned by GetIntegerv and related simple queries whenvalue
is RESET_NOTIFICATION_STRATEGY_EXT .static final int
Accepted by thevalue
parameter of GetBooleanv, GetIntegerv, and GetFloatv.static final int
Returned by GetGraphicsResetStatusEXT. -
Method Summary
Modifier and TypeMethodDescriptionstatic int
static float
glGetnUniformfEXT
(int program, int location) static void
glGetnUniformfvEXT
(int program, int location, float[] params) Array version of:GetnUniformfvEXT
static void
glGetnUniformfvEXT
(int program, int location, FloatBuffer params) static int
glGetnUniformiEXT
(int program, int location) static void
glGetnUniformivEXT
(int program, int location, int[] params) Array version of:GetnUniformivEXT
static void
glGetnUniformivEXT
(int program, int location, IntBuffer params) static void
glReadnPixelsEXT
(int x, int y, int width, int height, int format, int type, float[] data) Array version of:ReadnPixelsEXT
static void
glReadnPixelsEXT
(int x, int y, int width, int height, int format, int type, int[] data) Array version of:ReadnPixelsEXT
static void
glReadnPixelsEXT
(int x, int y, int width, int height, int format, int type, int bufSize, long data) static void
glReadnPixelsEXT
(int x, int y, int width, int height, int format, int type, short[] data) Array version of:ReadnPixelsEXT
static void
glReadnPixelsEXT
(int x, int y, int width, int height, int format, int type, ByteBuffer data) static void
glReadnPixelsEXT
(int x, int y, int width, int height, int format, int type, FloatBuffer data) static void
glReadnPixelsEXT
(int x, int y, int width, int height, int format, int type, IntBuffer data) static void
glReadnPixelsEXT
(int x, int y, int width, int height, int format, int type, ShortBuffer data) static void
nglGetnUniformfvEXT
(int program, int location, int bufSize, long params) static void
nglGetnUniformivEXT
(int program, int location, int bufSize, long params) static void
nglReadnPixelsEXT
(int x, int y, int width, int height, int format, int type, int bufSize, long data)
-
Field Details
-
GL_GUILTY_CONTEXT_RESET_EXT
public static final int GL_GUILTY_CONTEXT_RESET_EXTReturned by GetGraphicsResetStatusEXT.- See Also:
-
GL_INNOCENT_CONTEXT_RESET_EXT
public static final int GL_INNOCENT_CONTEXT_RESET_EXTReturned by GetGraphicsResetStatusEXT.- See Also:
-
GL_UNKNOWN_CONTEXT_RESET_EXT
public static final int GL_UNKNOWN_CONTEXT_RESET_EXTReturned by GetGraphicsResetStatusEXT.- See Also:
-
GL_CONTEXT_ROBUST_ACCESS_EXT
public static final int GL_CONTEXT_ROBUST_ACCESS_EXTAccepted by thevalue
parameter of GetBooleanv, GetIntegerv, and GetFloatv.- See Also:
-
GL_RESET_NOTIFICATION_STRATEGY_EXT
public static final int GL_RESET_NOTIFICATION_STRATEGY_EXTAccepted by thevalue
parameter of GetBooleanv, GetIntegerv, and GetFloatv.- See Also:
-
GL_LOSE_CONTEXT_ON_RESET_EXT
public static final int GL_LOSE_CONTEXT_ON_RESET_EXTReturned by GetIntegerv and related simple queries whenvalue
is RESET_NOTIFICATION_STRATEGY_EXT .- See Also:
-
GL_NO_RESET_NOTIFICATION_EXT
public static final int GL_NO_RESET_NOTIFICATION_EXTReturned by GetIntegerv and related simple queries whenvalue
is RESET_NOTIFICATION_STRATEGY_EXT .- See Also:
-
-
Method Details
-
glGetGraphicsResetStatusEXT
public static int glGetGraphicsResetStatusEXT() -
nglReadnPixelsEXT
public static void nglReadnPixelsEXT(int x, int y, int width, int height, int format, int type, int bufSize, long data) -
glReadnPixelsEXT
public static void glReadnPixelsEXT(int x, int y, int width, int height, int format, int type, int bufSize, long data) -
glReadnPixelsEXT
public static void glReadnPixelsEXT(int x, int y, int width, int height, int format, int type, ByteBuffer data) -
glReadnPixelsEXT
public static void glReadnPixelsEXT(int x, int y, int width, int height, int format, int type, ShortBuffer data) -
glReadnPixelsEXT
public static void glReadnPixelsEXT(int x, int y, int width, int height, int format, int type, IntBuffer data) -
glReadnPixelsEXT
public static void glReadnPixelsEXT(int x, int y, int width, int height, int format, int type, FloatBuffer data) -
nglGetnUniformfvEXT
public static void nglGetnUniformfvEXT(int program, int location, int bufSize, long params) -
glGetnUniformfvEXT
-
glGetnUniformfEXT
public static float glGetnUniformfEXT(int program, int location) -
nglGetnUniformivEXT
public static void nglGetnUniformivEXT(int program, int location, int bufSize, long params) -
glGetnUniformivEXT
-
glGetnUniformiEXT
public static int glGetnUniformiEXT(int program, int location) -
glReadnPixelsEXT
public static void glReadnPixelsEXT(int x, int y, int width, int height, int format, int type, short[] data) Array version of:ReadnPixelsEXT
-
glReadnPixelsEXT
public static void glReadnPixelsEXT(int x, int y, int width, int height, int format, int type, int[] data) Array version of:ReadnPixelsEXT
-
glReadnPixelsEXT
public static void glReadnPixelsEXT(int x, int y, int width, int height, int format, int type, float[] data) Array version of:ReadnPixelsEXT
-
glGetnUniformfvEXT
public static void glGetnUniformfvEXT(int program, int location, float[] params) Array version of:GetnUniformfvEXT
-
glGetnUniformivEXT
public static void glGetnUniformivEXT(int program, int location, int[] params) Array version of:GetnUniformivEXT
-