Class ARBInvalidateSubdata
- java.lang.Object
-
- org.lwjgl.opengl.ARBInvalidateSubdata
-
public class ARBInvalidateSubdata extends java.lang.Object
Native bindings to the ARB_invalidate_subdata extension.This extension adds a mechanism for an application to tell the GL that the previous contents of a subregion of an image or a range of a buffer may be invalidated.
GL implementations often include several memory spaces, each with distinct performance characteristics, and the implementations transparently move allocations between memory spaces. With this extension, an application can tell the GL that the contents of a texture or buffer are no longer needed, and the implementation can avoid transferring the data unnecessarily.
Examples of when this may be useful include:
- invalidating a multisample texture after resolving it into a non-multisample texture.
- invalidating depth/stencil buffers after using them to generate a color buffer.
- invalidating a subregion of a framebuffer rather than clearing it before rendering to it, when the whole subregion will be overwritten.
- invalidating dynamically generated data (e.g. textures written by FBO rendering or CopyTexSubImage, buffers written by transform feedback, etc.) after it is no longer needed but before the end of the frame.
It is expected that the situations in which the GL will take advantage of this knowledge and achieve increased performance as a result of its use will be implementation-dependent. The first three examples may show benefit on tiled renderers where some data won't need to be copied into or out of on-chip memory. The fourth example may show a benefit in multi-GPU systems where some data won't need to be copied between GPUs.
This extension is a superset of the EXT_discard_framebuffer extension with the following additions:
- The parameters to InvalidateFramebufferEXT are extended for MRT support and Desktop-GL-only buffer enums.
- New functions to invalidate a region of a texture image or buffer object data store.
Requires
OpenGL 2.0
. Promoted to core inOpenGL 4.3
.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static void
glInvalidateBufferData(int buffer)
Invalidates the content of a buffer object's data store.static void
glInvalidateBufferSubData(int buffer, long offset, long length)
Invalidates a region of a buffer object's data store.static void
glInvalidateFramebuffer(int target, int attachment)
Invalidate the content some or all of a framebuffer object's attachments.static void
glInvalidateFramebuffer(int target, int[] attachments)
Array version of:InvalidateFramebuffer
static void
glInvalidateFramebuffer(int target, java.nio.IntBuffer attachments)
Invalidate the content some or all of a framebuffer object's attachments.static void
glInvalidateSubFramebuffer(int target, int[] attachments, int x, int y, int width, int height)
Array version of:InvalidateSubFramebuffer
static void
glInvalidateSubFramebuffer(int target, java.nio.IntBuffer attachments, int x, int y, int width, int height)
Invalidates the content of a region of some or all of a framebuffer object's attachments.static void
glInvalidateSubFramebuffer(int target, int attachment, int x, int y, int width, int height)
Invalidates the content of a region of some or all of a framebuffer object's attachments.static void
glInvalidateTexImage(int texture, int level)
Invalidates the entirety of a texture image.static void
glInvalidateTexSubImage(int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth)
Invalidates a region of a texture image.
-
-
-
Method Detail
-
glInvalidateTexSubImage
public static void glInvalidateTexSubImage(int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth)
Invalidates a region of a texture image.- Parameters:
texture
- the name of a texture object a subregion of which to invalidatelevel
- the level of detail of the texture object within which the region residesxoffset
- the X offset of the region to be invalidatedyoffset
- the Y offset of the region to be invalidatedzoffset
- the Z offset of the region to be invalidatedwidth
- the width of the region to be invalidatedheight
- the height of the region to be invalidateddepth
- the depth of the region to be invalidated
-
glInvalidateTexImage
public static void glInvalidateTexImage(int texture, int level)
Invalidates the entirety of a texture image.- Parameters:
texture
- the name of a texture object to invalidatelevel
- the level of detail of the texture object to invalidate
-
glInvalidateBufferSubData
public static void glInvalidateBufferSubData(int buffer, long offset, long length)
Invalidates a region of a buffer object's data store.- Parameters:
buffer
- the name of a buffer object, a subrange of whose data store to invalidateoffset
- the offset within the buffer's data store of the start of the range to be invalidatedlength
- the length of the range within the buffer's data store to be invalidated
-
glInvalidateBufferData
public static void glInvalidateBufferData(int buffer)
Invalidates the content of a buffer object's data store.- Parameters:
buffer
- the name of a buffer object whose data store to invalidate
-
glInvalidateFramebuffer
public static void glInvalidateFramebuffer(int target, java.nio.IntBuffer attachments)
Invalidate the content some or all of a framebuffer object's attachments.- Parameters:
target
- the target to which the framebuffer is attached. One of:FRAMEBUFFER
DRAW_FRAMEBUFFER
READ_FRAMEBUFFER
attachments
- the address of an array identifying the attachments to be invalidated
-
glInvalidateFramebuffer
public static void glInvalidateFramebuffer(int target, int attachment)
Invalidate the content some or all of a framebuffer object's attachments.- Parameters:
target
- the target to which the framebuffer is attached. One of:FRAMEBUFFER
DRAW_FRAMEBUFFER
READ_FRAMEBUFFER
-
glInvalidateSubFramebuffer
public static void glInvalidateSubFramebuffer(int target, java.nio.IntBuffer attachments, int x, int y, int width, int height)
Invalidates the content of a region of some or all of a framebuffer object's attachments.- Parameters:
target
- the target to which the framebuffer is attached. One of:FRAMEBUFFER
DRAW_FRAMEBUFFER
READ_FRAMEBUFFER
attachments
- an array identifying the attachments to be invalidatedx
- the X offset of the region to be invalidatedy
- the Y offset of the region to be invalidatedwidth
- the width of the region to be invalidatedheight
- the height of the region to be invalidated
-
glInvalidateSubFramebuffer
public static void glInvalidateSubFramebuffer(int target, int attachment, int x, int y, int width, int height)
Invalidates the content of a region of some or all of a framebuffer object's attachments.- Parameters:
target
- the target to which the framebuffer is attached. One of:FRAMEBUFFER
DRAW_FRAMEBUFFER
READ_FRAMEBUFFER
x
- the X offset of the region to be invalidatedy
- the Y offset of the region to be invalidatedwidth
- the width of the region to be invalidatedheight
- the height of the region to be invalidated
-
glInvalidateFramebuffer
public static void glInvalidateFramebuffer(int target, int[] attachments)
Array version of:InvalidateFramebuffer
-
glInvalidateSubFramebuffer
public static void glInvalidateSubFramebuffer(int target, int[] attachments, int x, int y, int width, int height)
Array version of:InvalidateSubFramebuffer
-
-