Top Description Fields Constructors Methods
org.lwjgl.opencl

public Class CL12GL

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

The OpenCL 1.2 OpenGL interoperability functionality.

Field Summary

Modifier and TypeField and Description
public static final int
CL_GL_OBJECT_TEXTURE1D

cl_gl_object_type

public static final int
public static final int
public static final int
CL_GL_OBJECT_TEXTURE_BUFFER

cl_gl_object_type

Inherited from org.lwjgl.opencl.CL10GL:
CL_GL_MIPMAP_LEVELCL_GL_OBJECT_BUFFERCL_GL_OBJECT_RENDERBUFFERCL_GL_OBJECT_TEXTURE2DCL_GL_OBJECT_TEXTURE3DCL_GL_TEXTURE_TARGETCL_INVALID_GL_OBJECTCL_INVALID_MIP_LEVEL

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static long

Returns:

a valid non-zero OpenCL image object and errcode_ret is set to SUCCESS if the image object is created successfully. Otherwise, it returns a NULL value with one of the following error values returned in errcode_ret:
  • INVALID_CONTEXT if context is not a valid context or was not created from a GL context.
  • INVALID_VALUE if values specified in flags are not valid or if value specified in texture_target is not one of the values specified in the description of texture_target.
  • INVALID_MIP_LEVEL if miplevel is less than the value of levelbase (for OpenGL implementations) or zero (for OpenGL ES implementations); or greater than the value of q (for both OpenGL and OpenGL ES).
  • INVALID_MIP_LEVEL if miplevel is greather than zero and the OpenGL implementation does not support creating from non-zero mipmap levels.
  • INVALID_GL_OBJECT if texture is not a GL texture object whose type matches texture_target, if the specified miplevel of texture is not defined, or if the width or height of the specified miplevel is zero.
  • INVALID_IMAGE_FORMAT_DESCRIPTOR if the OpenGL texture internal format does not map to a supported OpenCL image format.
  • INVALID_OPERATION if texture is a GL texture object created with a border width value greater than zero.
  • OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device.
  • OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.
clCreateFromGLTexture
(long
a valid OpenCL context created from an OpenGL context
context
,
long
a bit-field that is used to specify usage information. One of:
MEM_READ_ONLYMEM_WRITE_ONLYMEM_READ_WRITE
flags
,
int
defines the image type of texture. No reference to a bound GL texture object is made or implied by this parameter. One of:
GL_TEXTURE_1DGL_TEXTURE_1D_ARRAYGL_TEXTURE_BUFFER
GL_TEXTURE_2DGL_TEXTURE_2D_ARRAYGL_TEXTURE_3D
GL_TEXTURE_CUBE_MAP_POSITIVE_XGL_TEXTURE_CUBE_MAP_POSITIVE_YGL_TEXTURE_CUBE_MAP_POSITIVE_Z
GL_TEXTURE_CUBE_MAP_NEGATIVE_XGL_TEXTURE_CUBE_MAP_NEGATIVE_YGL_TEXTURE_CUBE_MAP_NEGATIVE_Z
GL_TEXTURE_RECTANGLE
texture_target
,
int
the mipmap level to be used. Implementations may return INVALID_OPERATION for miplevel values > 0. If texture_target is GL_TEXTURE_BUFFER, miplevel must be 0.
miplevel
,
int
the name of a GL 1D, 2D, 3D, 1D array, 2D array, cubemap, rectangle or buffer texture object. The texture object must be a complete texture as per OpenGL rules on texture completeness. The texture format and dimensions defined by OpenGL for the specified miplevel of the texture will be used to create the OpenCL image memory object. Only GL texture objects with an internal format that maps to appropriate OpenCL image channel order and data type may be used to create the OpenCL image memory object.
texture
,
IntBuffer
will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
errcode_ret
)

Creates one of the following:

  • an OpenCL 2D image object from an OpenGL 2D texture object or a single face of an OpenGL cubemap texture object,
  • an OpenCL 2D image array object from an OpenGL 2D texture array object,
  • an OpenCL 1D image object from an OpenGL 1D texture object,
  • an OpenCL 1D image buffer object from an OpenGL texture buffer object,
  • an OpenCL 1D image array object from an OpenGL 1D texture array object,
  • an OpenCL 3D image object from an OpenGL 3D texture object.
public static long
clCreateFromGLTexture(long context, long flags, int texture_target, int miplevel, int texture, int[] errcode_ret)

Array version of: CreateFromGLTexture

public static long
nclCreateFromGLTexture(long context, long flags, int texture_target, int miplevel, int texture, long errcode_ret)

Unsafe version of: CreateFromGLTexture

Inherited from org.lwjgl.opencl.CL10GL:
clCreateFromGLBufferclCreateFromGLBufferclCreateFromGLRenderbufferclCreateFromGLRenderbufferclCreateFromGLTexture2DclCreateFromGLTexture2DclCreateFromGLTexture3DclCreateFromGLTexture3DclEnqueueAcquireGLObjectsclEnqueueAcquireGLObjectsclEnqueueReleaseGLObjectsclEnqueueReleaseGLObjectsclGetGLObjectInfoclGetGLObjectInfoclGetGLTextureInfoclGetGLTextureInfoclGetGLTextureInfonclCreateFromGLBuffernclCreateFromGLRenderbuffernclCreateFromGLTexture2DnclCreateFromGLTexture3DnclEnqueueAcquireGLObjectsnclEnqueueReleaseGLObjectsnclGetGLObjectInfonclGetGLTextureInfo

Field Detail

CL_GL_OBJECT_TEXTURE1Dback to summary
public static final int CL_GL_OBJECT_TEXTURE1D

cl_gl_object_type

CL_GL_OBJECT_TEXTURE1D_ARRAYback to summary
public static final int CL_GL_OBJECT_TEXTURE1D_ARRAY

cl_gl_object_type

CL_GL_OBJECT_TEXTURE_2D_ARRAYback to summary
public static final int CL_GL_OBJECT_TEXTURE_2D_ARRAY

cl_gl_object_type

CL_GL_OBJECT_TEXTURE_BUFFERback to summary
public static final int CL_GL_OBJECT_TEXTURE_BUFFER

cl_gl_object_type

Constructor Detail

CL12GLback to summary
protected CL12GL()

Method Detail

clCreateFromGLTextureback to summary
public static long clCreateFromGLTexture(long context, long flags, int texture_target, int miplevel, int texture, IntBuffer errcode_ret)

Creates one of the following:

  • an OpenCL 2D image object from an OpenGL 2D texture object or a single face of an OpenGL cubemap texture object,
  • an OpenCL 2D image array object from an OpenGL 2D texture array object,
  • an OpenCL 1D image object from an OpenGL 1D texture object,
  • an OpenCL 1D image buffer object from an OpenGL texture buffer object,
  • an OpenCL 1D image array object from an OpenGL 1D texture array object,
  • an OpenCL 3D image object from an OpenGL 3D texture object.

If the state of a GL texture object is modified through the GL API (e.g. glTexImage2D, glTexImage3D or the values of the texture parameters GL_TEXTURE_BASE_LEVEL or GL_TEXTURE_MAX_LEVEL are modified) while there exists a corresponding CL image object, subsequent use of the CL image object will result in undefined behavior.

The RetainMemObject and ReleaseMemObject functions can be used to retain and release the image objects.

Parameters
context:long

a valid OpenCL context created from an OpenGL context

flags:long

a bit-field that is used to specify usage information. One of:

MEM_READ_ONLYMEM_WRITE_ONLYMEM_READ_WRITE
texture_target:int

defines the image type of texture. No reference to a bound GL texture object is made or implied by this parameter. One of:

GL_TEXTURE_1DGL_TEXTURE_1D_ARRAYGL_TEXTURE_BUFFER
GL_TEXTURE_2DGL_TEXTURE_2D_ARRAYGL_TEXTURE_3D
GL_TEXTURE_CUBE_MAP_POSITIVE_XGL_TEXTURE_CUBE_MAP_POSITIVE_YGL_TEXTURE_CUBE_MAP_POSITIVE_Z
GL_TEXTURE_CUBE_MAP_NEGATIVE_XGL_TEXTURE_CUBE_MAP_NEGATIVE_YGL_TEXTURE_CUBE_MAP_NEGATIVE_Z
GL_TEXTURE_RECTANGLE
miplevel:int

the mipmap level to be used. Implementations may return INVALID_OPERATION for miplevel values > 0. If texture_target is GL_TEXTURE_BUFFER, miplevel must be 0.

texture:int

the name of a GL 1D, 2D, 3D, 1D array, 2D array, cubemap, rectangle or buffer texture object. The texture object must be a complete texture as per OpenGL rules on texture completeness. The texture format and dimensions defined by OpenGL for the specified miplevel of the texture will be used to create the OpenCL image memory object. Only GL texture objects with an internal format that maps to appropriate OpenCL image channel order and data type may be used to create the OpenCL image memory object.

errcode_ret:IntBuffer

will return an appropriate error code. If errcode_ret is NULL, no error code is returned.

Returns:long

a valid non-zero OpenCL image object and errcode_ret is set to SUCCESS if the image object is created successfully. Otherwise, it returns a NULL value with one of the following error values returned in errcode_ret:

  • INVALID_CONTEXT if context is not a valid context or was not created from a GL context.
  • INVALID_VALUE if values specified in flags are not valid or if value specified in texture_target is not one of the values specified in the description of texture_target.
  • INVALID_MIP_LEVEL if miplevel is less than the value of levelbase (for OpenGL implementations) or zero (for OpenGL ES implementations); or greater than the value of q (for both OpenGL and OpenGL ES).
  • INVALID_MIP_LEVEL if miplevel is greather than zero and the OpenGL implementation does not support creating from non-zero mipmap levels.
  • INVALID_GL_OBJECT if texture is not a GL texture object whose type matches texture_target, if the specified miplevel of texture is not defined, or if the width or height of the specified miplevel is zero.
  • INVALID_IMAGE_FORMAT_DESCRIPTOR if the OpenGL texture internal format does not map to a supported OpenCL image format.
  • INVALID_OPERATION if texture is a GL texture object created with a border width value greater than zero.
  • OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device.
  • OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.
Annotations
@NativeType:cl_mem
See Also
Reference Page
clCreateFromGLTextureback to summary
public static long clCreateFromGLTexture(long context, long flags, int texture_target, int miplevel, int texture, int[] errcode_ret)

Array version of: CreateFromGLTexture

Annotations
@NativeType:cl_mem
See Also
Reference Page
nclCreateFromGLTextureback to summary
public static long nclCreateFromGLTexture(long context, long flags, int texture_target, int miplevel, int texture, long errcode_ret)

Unsafe version of: CreateFromGLTexture