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.
Demands for increased software robustness and concerns about malware exploiting buffer overflows have lead API designers to provide additional "safe" APIs that bound the amount of data returned by an API query. For example, the safer "snprintf" or "_snprintf" routines are prefered over "sprintf".
The OpenGL API has many such robustness perils. OpenGL queries return (write) some number of bytes to a buffer indicated by a pointer parameter. The exact number of bytes written by existing OpenGL queries is not expressed directly by any specific parameter; instead the number of bytes returned is a complex function of one or more query arguments, sometimes context state such as pixel store modes or the active texture selector, and the current state of an object (such as a texture level's number of total texels). By the standards of modern API design, such queries are not "safe". Making these queries safer involves introducing a new query API with an additional parameter that specifies the number of bytes in the buffer and never writing bytes beyond that limit.
Multi-threaded use of OpenGL contexts in a "share group" allow sharing of objects such as textures and programs. Such sharing in conjunction with concurrent OpenGL commands stream execution by two or more contexts introduces hazards whereby 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 GPUs capable of DirectX 10 enforce the well-defined behavior of always returning zero values for indices or
non-fixed components in this case. Older GPUs 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:
In one anticipated usage model, WebGL contexts may make use of these robust features to grant greater stability when using untrusted code. WebGL contexts cannot call OpenGL commands directly but rather must route all OpenGL API calls through the web browser. It is then the web browser that configures the context, using the commands in this extension, to enforce safe behavior. In this scenario, the WebGL content cannot specify or change the use of this extension's features itself; the web browser enforces this policy.
There are other well-known robustness issues with the OpenGL API which this extension does not address. For example, selector-based OpenGL commands are
a well-known source of programming errors. Code to manipulate texture state may assume the active texture selector is set appropriately when an
intervening function call obscures a change to the active texture state resulting in incorrectly updated or queried state. The
EXT_direct_state_access extension introduces selector-free OpenGL commands and queries to address that particular issue so this extension does
not.
The intent of this extension is NOT to deprecate any existing API and thereby introduce compatibility issues and coding burdens on existing code, but rather to provide new APIs to ensure a level of robustness commensurate with the expectations of modern applications of OpenGL.
| Modifier and Type | Field and Description |
|---|---|
| public static final int | GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB
Returned by GetIntegerv when |
| public static final int | GL_GUILTY_CONTEXT_RESET_ARB
Returned by GetGraphicsResetStatusARB. |
| public static final int | GL_INNOCENT_CONTEXT_RESET_ARB
Returned by GetGraphicsResetStatusARB. |
| public static final int | GL_LOSE_CONTEXT_ON_RESET_ARB
Returned by GetIntegerv and related simple queries when |
| public static final int | GL_NO_RESET_NOTIFICATION_ARB
Returned by GetIntegerv and related simple queries when |
| public static final int | GL_RESET_NOTIFICATION_STRATEGY_ARB
Accepted by the |
| public static final int | GL_UNKNOWN_CONTEXT_RESET_ARB
Returned by GetGraphicsResetStatusARB. |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| public static native int | glGetGraphicsResetStatusARB()
The symbolic constant returned indicates if the GL context has been in a reset state at any point since the last call to | ||||||||||
| public static void | glGetnColorTableARB(int
the color table target. One of: target, int format, int
the color data type. One of: type, int the maximum number of bytes to write into bufSize, long tablea buffer in which to place the returned data table)Robust version of | ||||||||||
| public static void | glGetnColorTableARB(int
the color table target. One of: target, int format, int
the color data type. One of: type, ByteBuffer a buffer in which to place the returned data table)Robust version of | ||||||||||
| public static void | glGetnColorTableARB(int
the color table target. One of: target, int format, int
the color data type. One of: type, ShortBuffer a buffer in which to place the returned data table)Robust version of | ||||||||||
| public static void | glGetnColorTableARB(int
the color table target. One of: target, int format, int
the color data type. One of: type, IntBuffer a buffer in which to place the returned data table)Robust version of | ||||||||||
| public static void | glGetnColorTableARB(int
the color table target. One of: target, int format, int
the color data type. One of: type, FloatBuffer a buffer in which to place the returned data table)Robust version of | ||||||||||
| public static void | glGetnColorTableARB(int target, int format, int type, short[] table)
Array version of: | ||||||||||
| public static void | glGetnColorTableARB(int target, int format, int type, int[] table)
Array version of: | ||||||||||
| public static void | glGetnColorTableARB(int target, int format, int type, float[] table)
Array version of: | ||||||||||
| public static void | glGetnCompressedTexImageARB(int target, int
the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. level, int the maximum number of bytes to write into bufSize, long imga buffer in which to place the returned data img)Robust version of | ||||||||||
| public static void | glGetnCompressedTexImageARB(int target, int
the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. level, ByteBuffer a buffer in which to place the returned data img)Robust version of | ||||||||||
| public static void | glGetnConvolutionFilterARB(int
the convolution target. One of: target, int format, int
the filter data type. One of: type, int the maximum number of bytes to write into bufSize, long imagea buffer in which to place the returned data image)Robust version of | ||||||||||
| public static void | glGetnConvolutionFilterARB(int
the convolution target. One of: target, int format, int
the filter data type. One of: type, ByteBuffer a buffer in which to place the returned data image)Robust version of | ||||||||||
| public static void | glGetnHistogramARB(int
the histogram target. Must be: target, boolean
if reset, int format, int TRUE, then all counters of all elements of the histogram are reset to zero. Counters are reset whether returned or not.the pixel data types. One of: type, int the maximum number of bytes to write into bufSize, long valuesa buffer in which to place the returned data values)Robust version of | ||||||||||
| public static void | glGetnHistogramARB(int
the histogram target. Must be: target, boolean
if reset, int format, int TRUE, then all counters of all elements of the histogram are reset to zero. Counters are reset whether returned or not.the pixel data types. One of: type, ByteBuffer a buffer in which to place the returned data values)Robust version of | ||||||||||
| public static double | glGetnMapdARB(int
the evaluator map target, int the information to query query)Robust version of | ||||||||||
| public static void | glGetnMapdvARB(int
the evaluator map target, int the information to query query, DoubleBuffer a buffer in which to place the returned data data)Robust version of | ||||||||||
| public static void | |||||||||||
| public static float | glGetnMapfARB(int
the evaluator map target, int the information to query query)Robust version of | ||||||||||
| public static void | glGetnMapfvARB(int
the evaluator map target, int the information to query query, FloatBuffer a buffer in which to place the returned data data)Robust version of | ||||||||||
| public static void | |||||||||||
| public static int | |||||||||||
| public static void | glGetnMapivARB(int target, int query, IntBuffer
a buffer in which to place the returned data data)Robust version of | ||||||||||
| public static void | |||||||||||
| public static void | glGetnMinmaxARB(int
the minmax target. Must be: target, boolean
If reset, int format, int TRUE, then each minimum value is reset to the maximum representable value, and each maximum value is reset to the minimum
representable value. All values are reset, whether returned or not.the pixel data type. One of: type, int the maximum number of bytes to write into bufSize, long valuesa buffer in which to place the returned data values)Robust version of | ||||||||||
| public static void | glGetnMinmaxARB(int
the minmax target. Must be: target, boolean
If reset, int format, int TRUE, then each minimum value is reset to the maximum representable value, and each maximum value is reset to the minimum
representable value. All values are reset, whether returned or not.the pixel data type. One of: type, ByteBuffer a buffer in which to place the returned data values)Robust version of | ||||||||||
| public static void | glGetnPixelMapfvARB(int
the pixel map parameter to query. One of: map, FloatBuffer
a buffer in which to place the returned data data)Robust version of | ||||||||||
| public static void | |||||||||||
| public static void | glGetnPixelMapuivARB(int
the pixel map parameter to query map, IntBuffer a buffer in which to place the returned data data)Robust version of | ||||||||||
| public static void | |||||||||||
| public static void | glGetnPixelMapusvARB(int
the pixel map parameter to query map, ShortBuffer a buffer in which to place the returned data data)Robust version of | ||||||||||
| public static void | |||||||||||
| public static void | glGetnPolygonStippleARB(int
the maximum number of bytes to write into bufSize, long patterna buffer in which to place the returned pattern pattern)Robust version of | ||||||||||
| public static void | glGetnPolygonStippleARB(ByteBuffer
a buffer in which to place the returned pattern pattern)Robust version of | ||||||||||
| public static void | glGetnSeparableFilterARB(int
the filter target. Must be: target, int format, int
the filter data type. One of: type, int the maximum number of bytes to write into rowBufSize, long rowa buffer in which to return the filter row row, int the maximum number of bytes to write into columnBufSize, long columna buffer in which to return the filter column column, ByteBuffer span)Robust version of | ||||||||||
| public static void | glGetnSeparableFilterARB(int
the filter target. Must be: target, int format, int
the filter data type. One of: type, ByteBuffer a buffer in which to return the filter row row, ByteBuffer a buffer in which to return the filter column column, ByteBuffer span)Robust version of | ||||||||||
| public static void | glGetnTexImageARB(int tex, int
the level-of-detail number level, int format, int the pixel type. One of: type, int the maximum number of bytes to write into bufSize, long imga buffer in which to place the returned data img)Robust version of | ||||||||||
| public static void | glGetnTexImageARB(int tex, int
the level-of-detail number level, int format, int the pixel type. One of: type, ByteBuffer a buffer in which to place the returned data img)Robust version of | ||||||||||
| public static void | glGetnTexImageARB(int tex, int
the level-of-detail number level, int format, int the pixel type. One of: type, ShortBuffer a buffer in which to place the returned data img)Robust version of | ||||||||||
| public static void | glGetnTexImageARB(int tex, int
the level-of-detail number level, int format, int the pixel type. One of: type, IntBuffer a buffer in which to place the returned data img)Robust version of | ||||||||||
| public static void | glGetnTexImageARB(int tex, int
the level-of-detail number level, int format, int the pixel type. One of: type, FloatBuffer a buffer in which to place the returned data img)Robust version of | ||||||||||
| public static void | glGetnTexImageARB(int tex, int
the level-of-detail number level, int format, int the pixel type. One of: type, DoubleBuffer a buffer in which to place the returned data img)Robust version of | ||||||||||
| public static void | glGetnTexImageARB(int tex, int level, int format, int type, short[] img)
Array version of: | ||||||||||
| public static void | glGetnTexImageARB(int tex, int level, int format, int type, int[] img)
Array version of: | ||||||||||
| public static void | glGetnTexImageARB(int tex, int level, int format, int type, float[] img)
Array version of: | ||||||||||
| public static void | glGetnTexImageARB(int tex, int level, int format, int type, double[] img)
Array version of: | ||||||||||
| public static double | glGetnUniformdARB(int
the program object to be queried program, int the location of the uniform variable to be queried location)Robust version of | ||||||||||
| public static void | glGetnUniformdvARB(int
the program object to be queried program, int the location of the uniform variable to be queried location, DoubleBuffer a buffer in which to place the returned data params)Robust version of | ||||||||||
| public static void | |||||||||||
| public static float | glGetnUniformfARB(int
the program object to be queried program, int the location of the uniform variable to be queried location)Robust version of | ||||||||||
| public static void | glGetnUniformfvARB(int
the program object to be queried program, int the location of the uniform variable to be queried location, FloatBuffer a buffer in which to place the returned data params)Robust version of | ||||||||||
| public static void | |||||||||||
| public static int | glGetnUniformiARB(int
the program object to be queried program, int the location of the uniform variable to be queried location)Robust version of | ||||||||||
| public static void | glGetnUniformivARB(int
the program object to be queried program, int the location of the uniform variable to be queried location, IntBuffer a buffer in which to place the returned data params)Robust version of | ||||||||||
| public static void | |||||||||||
| public static int | glGetnUniformuiARB(int
the program object to be queried program, int the location of the uniform variable to be queried location)Robust version of | ||||||||||
| public static void | glGetnUniformuivARB(int
the program object to be queried program, int the location of the uniform variable to be queried location, IntBuffer a buffer in which to place the returned data params)Robust version of | ||||||||||
| public static void | |||||||||||
| public static void | glReadnPixelsARB(int
the left pixel coordinate x, int the lower pixel coordinate y, int the number of pixels to read in the x-dimension width, int the number of pixels to read in the y-dimension height, int format, int the pixel type. One of: type, int the maximum number of bytes to write into bufSize, long dataa buffer in which to place the returned data data)Robust version of | ||||||||||
| public static void | glReadnPixelsARB(int
the left pixel coordinate x, int the lower pixel coordinate y, int the number of pixels to read in the x-dimension width, int the number of pixels to read in the y-dimension height, int format, int the pixel type. One of: type, ByteBuffer a buffer in which to place the returned data data)Robust version of | ||||||||||
| public static void | glReadnPixelsARB(int
the left pixel coordinate x, int the lower pixel coordinate y, int the number of pixels to read in the x-dimension width, int the number of pixels to read in the y-dimension height, int format, int the pixel type. One of: type, ShortBuffer a buffer in which to place the returned data data)Robust version of | ||||||||||
| public static void | glReadnPixelsARB(int
the left pixel coordinate x, int the lower pixel coordinate y, int the number of pixels to read in the x-dimension width, int the number of pixels to read in the y-dimension height, int format, int the pixel type. One of: type, IntBuffer a buffer in which to place the returned data data)Robust version of | ||||||||||
| public static void | glReadnPixelsARB(int
the left pixel coordinate x, int the lower pixel coordinate y, int the number of pixels to read in the x-dimension width, int the number of pixels to read in the y-dimension height, int format, int the pixel type. One of: type, FloatBuffer a buffer in which to place the returned data data)Robust version of | ||||||||||
| public static void | glReadnPixelsARB(int x, int y, int width, int height, int format, int type, short[] data)
Array version of: | ||||||||||
| public static void | glReadnPixelsARB(int x, int y, int width, int height, int format, int type, int[] data)
Array version of: | ||||||||||
| public static void | glReadnPixelsARB(int x, int y, int width, int height, int format, int type, float[] data)
Array version of: | ||||||||||
| public static native void | nglGetnColorTableARB(int target, int format, int type, int
the maximum number of bytes to write into bufSize, long table)tableUnsafe version of: | ||||||||||
| public static native void | nglGetnCompressedTexImageARB(int target, int level, int
the maximum number of bytes to write into bufSize, long img)imgUnsafe version of: | ||||||||||
| public static native void | nglGetnConvolutionFilterARB(int target, int format, int type, int
the maximum number of bytes to write into bufSize, long image)imageUnsafe version of: | ||||||||||
| public static native void | nglGetnHistogramARB(int target, boolean reset, int format, int type, int
the maximum number of bytes to write into bufSize, long values)valuesUnsafe version of: | ||||||||||
| public static native void | nglGetnMapdvARB(int target, int query, int
the maximum number of bytes to write into bufSize, long data)dataUnsafe version of: | ||||||||||
| public static native void | nglGetnMapfvARB(int target, int query, int
the maximum number of bytes to write into bufSize, long data)dataUnsafe version of: | ||||||||||
| public static native void | nglGetnMapivARB(int target, int query, int
the maximum number of bytes to write into bufSize, long data)dataUnsafe version of: | ||||||||||
| public static native void | nglGetnMinmaxARB(int target, boolean reset, int format, int type, int
the maximum number of bytes to write into bufSize, long values)valuesUnsafe version of: | ||||||||||
| public static native void | nglGetnPixelMapfvARB(int map, int
the maximum number of bytes to write into bufSize, long data)dataUnsafe version of: | ||||||||||
| public static native void | nglGetnPixelMapuivARB(int map, int
the maximum number of bytes to write into bufSize, long data)dataUnsafe version of: | ||||||||||
| public static native void | nglGetnPixelMapusvARB(int map, int
the maximum number of bytes to write into bufSize, long data)dataUnsafe version of: | ||||||||||
| public static native void | nglGetnPolygonStippleARB(int
the maximum number of bytes to write into bufSize, long pattern)patternUnsafe version of: | ||||||||||
| public static native void | nglGetnSeparableFilterARB(int target, int format, int type, int
the maximum number of bytes to write into rowBufSize, long row, int rowthe maximum number of bytes to write into columnBufSize, long column, long span)columnUnsafe version of: | ||||||||||
| public static native void | nglGetnTexImageARB(int tex, int level, int format, int type, int
the maximum number of bytes to write into bufSize, long img)imgUnsafe version of: | ||||||||||
| public static native void | nglGetnUniformdvARB(int program, int location, int
the maximum number of bytes to write into bufSize, long params)paramsUnsafe version of: | ||||||||||
| public static native void | nglGetnUniformfvARB(int program, int location, int
the maximum number of bytes to write into bufSize, long params)paramsUnsafe version of: | ||||||||||
| public static native void | nglGetnUniformivARB(int program, int location, int
the maximum number of bytes to write into bufSize, long params)paramsUnsafe version of: | ||||||||||
| public static native void | nglGetnUniformuivARB(int program, int location, int
the maximum number of bytes to write into bufSize, long params)paramsUnsafe version of: | ||||||||||
| public static native void | nglReadnPixelsARB(int x, int y, int width, int height, int format, int type, int
the maximum number of bytes to write into bufSize, long data)dataUnsafe version of: |