Top Description Fields Constructors Methods
org.lwjgl.opengl

public Class INTELMapTexture

extends Object
Class Inheritance
Imports
javax.annotation.*, java.nio.*, org.lwjgl.system.*

Native bindings to the INTEL_map_texture extension.

Systems with integrated GPUs can share the same physical memory between CPU and GPU. This feature, if exposed by API, can bring significant performance benefits for graphics applications by reducing the complexity of uploading/accessing texture contents. This extension enables CPU direct access to the GPU memory holding textures.

The problem with texture memory directly exposed to clients is that textures are often 'tiled'. Texels are kept in specific layout to improve locality of reference and thus performance of texturing. This 'tiling' is specific to particular hardware and would be thus difficult to use.

This extension allows to create textures with 'linear' layout which allows for simplified access on user side (potentially sacrificing some performance during texture sampling).

Requires OpenGL 3.0.

Field Summary

Modifier and TypeField and Description
public static final int
GL_LAYOUT_DEFAULT_INTEL

Accepted by the params when pname is set to TEXTURE_MEMORY_LAYOUT_INTEL.

public static final int
GL_LAYOUT_LINEAR_CPU_CACHED_INTEL

Accepted by the params when pname is set to TEXTURE_MEMORY_LAYOUT_INTEL.

public static final int
GL_LAYOUT_LINEAR_INTEL

Accepted by the params when pname is set to TEXTURE_MEMORY_LAYOUT_INTEL.

public static final int
GL_TEXTURE_MEMORY_LAYOUT_INTEL

Accepted by the pname parameter of TexParameteri, for target TEXTURE_2D.

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
private static int
private static int
getStride(int[] stride)

public static ByteBuffer
glMapTexture2DINTEL(int
the texture to map
texture
,
int
the mipmap level-of-detail of the texture
level
,
int
the type of access that will be performed by the application. One of:
MAP_READ_BITMAP_WRITE_BIT
access
,
IntBuffer
returns the distance in bytes between subsequent rows in the texture
stride
,
IntBuffer
returns the internal layout of the texture in the graphics memory
layout
)

Attempts to return a direct pointer to the graphics storage for 2D texture indicated by the texture parameter.

public static ByteBuffer
glMapTexture2DINTEL(int
the texture to map
texture
,
int
the mipmap level-of-detail of the texture
level
,
int
the type of access that will be performed by the application. One of:
MAP_READ_BITMAP_WRITE_BIT
access
,
IntBuffer
returns the distance in bytes between subsequent rows in the texture
stride
,
IntBuffer
returns the internal layout of the texture in the graphics memory
layout
,
ByteBuffer old_buffer)

Attempts to return a direct pointer to the graphics storage for 2D texture indicated by the texture parameter.

public static ByteBuffer
glMapTexture2DINTEL(int
the texture to map
texture
,
int
the mipmap level-of-detail of the texture
level
,
int
the type of access that will be performed by the application. One of:
MAP_READ_BITMAP_WRITE_BIT
access
,
IntBuffer
returns the distance in bytes between subsequent rows in the texture
stride
,
IntBuffer
returns the internal layout of the texture in the graphics memory
layout
,
long length, ByteBuffer old_buffer)

Attempts to return a direct pointer to the graphics storage for 2D texture indicated by the texture parameter.

public static ByteBuffer
glMapTexture2DINTEL(int texture, int level, int access, int[] stride, int[] layout)

Array version of: MapTexture2DINTEL

public static ByteBuffer
glMapTexture2DINTEL(int texture, int level, int access, int[] stride, int[] layout, ByteBuffer old_buffer)

Array version of: MapTexture2DINTEL

public static ByteBuffer
glMapTexture2DINTEL(int texture, int level, int access, int[] stride, int[] layout, long length, ByteBuffer old_buffer)

Array version of: MapTexture2DINTEL

public static native void
glSyncTextureINTEL(int
the texture to synchronize
texture
)

Makes sure that changes made by CPU are visible to GPU by flushing texture cache in GPU.

public static native void
glUnmapTexture2DINTEL(int
the texture to unmap
texture
,
int
the mipmap level-of-detail of the texture
level
)

Releases the pointer obtained previously via MapTexture2DINTEL.

public static native long
nglMapTexture2DINTEL(int texture, int level, int access, long stride, long layout)

Unsafe version of: MapTexture2DINTEL

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

GL_LAYOUT_DEFAULT_INTELback to summary
public static final int GL_LAYOUT_DEFAULT_INTEL

Accepted by the params when pname is set to TEXTURE_MEMORY_LAYOUT_INTEL.

GL_LAYOUT_LINEAR_CPU_CACHED_INTELback to summary
public static final int GL_LAYOUT_LINEAR_CPU_CACHED_INTEL

Accepted by the params when pname is set to TEXTURE_MEMORY_LAYOUT_INTEL.

GL_LAYOUT_LINEAR_INTELback to summary
public static final int GL_LAYOUT_LINEAR_INTEL

Accepted by the params when pname is set to TEXTURE_MEMORY_LAYOUT_INTEL.

GL_TEXTURE_MEMORY_LAYOUT_INTELback to summary
public static final int GL_TEXTURE_MEMORY_LAYOUT_INTEL

Accepted by the pname parameter of TexParameteri, for target TEXTURE_2D.

Constructor Detail

INTELMapTextureback to summary
protected INTELMapTexture()

Method Detail

getStrideback to summary
private static int getStride(IntBuffer stride)
getStrideback to summary
private static int getStride(int[] stride)
glMapTexture2DINTELback to summary
public static ByteBuffer glMapTexture2DINTEL(int texture, int level, int access, IntBuffer stride, IntBuffer layout)

Attempts to return a direct pointer to the graphics storage for 2D texture indicated by the texture parameter.

LWJGL note: If glMapTexture2DINTEL without an explicit length argument is used and direct-state-access functionality is not available in the current context, the texture object must currently be bound to the GL_TEXTURE_2D target.

Parameters
texture:int

the texture to map

level:int

the mipmap level-of-detail of the texture

access:int

the type of access that will be performed by the application. One of:

MAP_READ_BITMAP_WRITE_BIT
stride:IntBuffer

returns the distance in bytes between subsequent rows in the texture

layout:IntBuffer

returns the internal layout of the texture in the graphics memory

Annotations
@Nullable
@NativeType:void *
glMapTexture2DINTELback to summary
public static ByteBuffer glMapTexture2DINTEL(int texture, int level, int access, IntBuffer stride, IntBuffer layout, ByteBuffer old_buffer)

Attempts to return a direct pointer to the graphics storage for 2D texture indicated by the texture parameter.

LWJGL note: If glMapTexture2DINTEL without an explicit length argument is used and direct-state-access functionality is not available in the current context, the texture object must currently be bound to the GL_TEXTURE_2D target.

Parameters
texture:int

the texture to map

level:int

the mipmap level-of-detail of the texture

access:int

the type of access that will be performed by the application. One of:

MAP_READ_BITMAP_WRITE_BIT
stride:IntBuffer

returns the distance in bytes between subsequent rows in the texture

layout:IntBuffer

returns the internal layout of the texture in the graphics memory

Annotations
@Nullable
@NativeType:void *
glMapTexture2DINTELback to summary
public static ByteBuffer glMapTexture2DINTEL(int texture, int level, int access, IntBuffer stride, IntBuffer layout, long length, ByteBuffer old_buffer)

Attempts to return a direct pointer to the graphics storage for 2D texture indicated by the texture parameter.

LWJGL note: If glMapTexture2DINTEL without an explicit length argument is used and direct-state-access functionality is not available in the current context, the texture object must currently be bound to the GL_TEXTURE_2D target.

Parameters
texture:int

the texture to map

level:int

the mipmap level-of-detail of the texture

access:int

the type of access that will be performed by the application. One of:

MAP_READ_BITMAP_WRITE_BIT
stride:IntBuffer

returns the distance in bytes between subsequent rows in the texture

layout:IntBuffer

returns the internal layout of the texture in the graphics memory

Annotations
@Nullable
@NativeType:void *
glMapTexture2DINTELback to summary
public static ByteBuffer glMapTexture2DINTEL(int texture, int level, int access, int[] stride, int[] layout)

Array version of: MapTexture2DINTEL

Annotations
@Nullable
@NativeType:void *
glMapTexture2DINTELback to summary
public static ByteBuffer glMapTexture2DINTEL(int texture, int level, int access, int[] stride, int[] layout, ByteBuffer old_buffer)

Array version of: MapTexture2DINTEL

Annotations
@Nullable
@NativeType:void *
glMapTexture2DINTELback to summary
public static ByteBuffer glMapTexture2DINTEL(int texture, int level, int access, int[] stride, int[] layout, long length, ByteBuffer old_buffer)

Array version of: MapTexture2DINTEL

Annotations
@Nullable
@NativeType:void *
glSyncTextureINTELback to summary
public static native void glSyncTextureINTEL(int texture)

Makes sure that changes made by CPU are visible to GPU by flushing texture cache in GPU. The GL implementation tracks the cache usage and ignores the command if such flush is not needed.

It is worth noting that this extension does not address automatic synchronization between CPU and GPU when both entities operate on the same texture at the same time. This is up to the application to assure such synchronization. Otherwise, the results may not be deterministic (writes from different entities may interleave in a non-deterministic way).

Parameters
texture:int

the texture to synchronize

glUnmapTexture2DINTELback to summary
public static native void glUnmapTexture2DINTEL(int texture, int level)

Releases the pointer obtained previously via MapTexture2DINTEL. This means that virtual memory space dedicated to make the texture available via a pointer is released and an application can no longer assume this memory is accessible from CPU. Successful execution of this command has an additional effect as if SyncTextureINTEL was called with texture parameter.

Parameters
texture:int

the texture to unmap

level:int

the mipmap level-of-detail of the texture

nglMapTexture2DINTELback to summary
public static native long nglMapTexture2DINTEL(int texture, int level, int access, long stride, long layout)

Unsafe version of: MapTexture2DINTEL