Package org.lwjgl.opencl
Class CL12GL
java.lang.Object
org.lwjgl.opencl.CL10GL
org.lwjgl.opencl.CL12GL
The OpenCL 1.2 OpenGL interoperability functionality.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intcl_gl_object_typestatic final intcl_gl_object_typestatic final intcl_gl_object_typestatic final intcl_gl_object_typeFields inherited from class org.lwjgl.opencl.CL10GL
CL_GL_MIPMAP_LEVEL, CL_GL_OBJECT_BUFFER, CL_GL_OBJECT_RENDERBUFFER, CL_GL_OBJECT_TEXTURE2D, CL_GL_OBJECT_TEXTURE3D, CL_GL_TEXTURE_TARGET, CL_INVALID_GL_OBJECT, CL_INVALID_MIP_LEVEL -
Method Summary
Modifier and TypeMethodDescriptionstatic longclCreateFromGLTexture(long context, long flags, int texture_target, int miplevel, int texture, int @Nullable [] errcode_ret) Array version of:CreateFromGLTexturestatic longclCreateFromGLTexture(long context, long flags, int texture_target, int miplevel, int texture, @Nullable 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.static longnclCreateFromGLTexture(long context, long flags, int texture_target, int miplevel, int texture, long errcode_ret) Unsafe version of:CreateFromGLTextureMethods inherited from class org.lwjgl.opencl.CL10GL
clCreateFromGLBuffer, clCreateFromGLBuffer, clCreateFromGLRenderbuffer, clCreateFromGLRenderbuffer, clCreateFromGLTexture2D, clCreateFromGLTexture2D, clCreateFromGLTexture3D, clCreateFromGLTexture3D, clEnqueueAcquireGLObjects, clEnqueueAcquireGLObjects, clEnqueueReleaseGLObjects, clEnqueueReleaseGLObjects, clGetGLObjectInfo, clGetGLObjectInfo, clGetGLTextureInfo, clGetGLTextureInfo, clGetGLTextureInfo, nclCreateFromGLBuffer, nclCreateFromGLRenderbuffer, nclCreateFromGLTexture2D, nclCreateFromGLTexture3D, nclEnqueueAcquireGLObjects, nclEnqueueReleaseGLObjects, nclGetGLObjectInfo, nclGetGLTextureInfo
-
Field Details
-
CL_GL_OBJECT_TEXTURE_2D_ARRAY
public static final int CL_GL_OBJECT_TEXTURE_2D_ARRAYcl_gl_object_type- See Also:
-
CL_GL_OBJECT_TEXTURE1D
public static final int CL_GL_OBJECT_TEXTURE1Dcl_gl_object_type- See Also:
-
CL_GL_OBJECT_TEXTURE1D_ARRAY
public static final int CL_GL_OBJECT_TEXTURE1D_ARRAYcl_gl_object_type- See Also:
-
CL_GL_OBJECT_TEXTURE_BUFFER
public static final int CL_GL_OBJECT_TEXTURE_BUFFERcl_gl_object_type- See Also:
-
-
Method Details
-
nclCreateFromGLTexture
public static long nclCreateFromGLTexture(long context, long flags, int texture_target, int miplevel, int texture, long errcode_ret) Unsafe version of:CreateFromGLTexture -
clCreateFromGLTexture
public static long clCreateFromGLTexture(long context, long flags, int texture_target, int miplevel, int texture, @Nullable 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,glTexImage3Dor the values of the texture parametersGL_TEXTURE_BASE_LEVELorGL_TEXTURE_MAX_LEVELare modified) while there exists a corresponding CL image object, subsequent use of the CL image object will result in undefined behavior.The
RetainMemObjectandReleaseMemObjectfunctions can be used to retain and release the image objects.- Parameters:
context- a valid OpenCL context created from an OpenGL contextflags- a bit-field that is used to specify usage information. One of:MEM_READ_ONLYMEM_WRITE_ONLYMEM_READ_WRITEtexture_target- defines the image type oftexture. No reference to a bound GL texture object is made or implied by this parameter. One of:GL_TEXTURE_1D GL_TEXTURE_1D_ARRAY GL_TEXTURE_BUFFER GL_TEXTURE_2D GL_TEXTURE_2D_ARRAY GL_TEXTURE_3D GL_TEXTURE_CUBE_MAP_POSITIVE_X GL_TEXTURE_CUBE_MAP_POSITIVE_Y GL_TEXTURE_CUBE_MAP_POSITIVE_Z GL_TEXTURE_CUBE_MAP_NEGATIVE_X GL_TEXTURE_CUBE_MAP_NEGATIVE_Y GL_TEXTURE_CUBE_MAP_NEGATIVE_Z GL_TEXTURE_RECTANGLE miplevel- the mipmap level to be used. Implementations may returnINVALID_OPERATIONformiplevelvalues > 0. Iftexture_targetisGL_TEXTURE_BUFFER,miplevelmust be 0.texture- 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 specifiedmiplevelof 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- will return an appropriate error code. Iferrcode_retisNULL, no error code is returned.- Returns:
- a valid non-zero OpenCL image object and
errcode_retis set toSUCCESSif the image object is created successfully. Otherwise, it returns aNULLvalue with one of the following error values returned inerrcode_ret:INVALID_CONTEXTifcontextis not a valid context or was not created from a GL context.INVALID_VALUEif values specified inflagsare not valid or if value specified intexture_targetis not one of the values specified in the description oftexture_target.INVALID_MIP_LEVELifmiplevelis less than the value oflevelbase (for OpenGL implementations) or zero (for OpenGL ES implementations); or greater than the value ofq(for both OpenGL and OpenGL ES).INVALID_MIP_LEVELifmiplevelis greather than zero and the OpenGL implementation does not support creating from non-zero mipmap levels.INVALID_GL_OBJECTiftextureis not a GL texture object whose type matchestexture_target, if the specifiedmiplevelof texture is not defined, or if the width or height of the specifiedmiplevelis zero.INVALID_IMAGE_FORMAT_DESCRIPTORif the OpenGL texture internal format does not map to a supported OpenCL image format.INVALID_OPERATIONiftextureis a GL texture object created with a border width value greater than zero.OUT_OF_RESOURCESif there is a failure to allocate resources required by the OpenCL implementation on the device.OUT_OF_HOST_MEMORYif there is a failure to allocate resources required by the OpenCL implementation on the host.
- See Also:
-
clCreateFromGLTexture
public static long clCreateFromGLTexture(long context, long flags, int texture_target, int miplevel, int texture, int @Nullable [] errcode_ret) Array version of:CreateFromGLTexture- See Also:
-