All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.lwjgl.opencl.CL12GL Maven / Gradle / Ivy

Go to download

An open, royalty-free standard for cross-platform, parallel programming of diverse processors found in personal computers, servers, mobile devices and embedded platforms.

There is a newer version: 3.3.4
Show newest version
/*
 * Copyright LWJGL. All rights reserved.
 * License terms: https://www.lwjgl.org/license
 * MACHINE GENERATED FILE, DO NOT EDIT
 */
package org.lwjgl.opencl;

import java.nio.*;

import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.JNI.*;
import static org.lwjgl.system.MemoryUtil.*;

import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import org.lwjgl.opengl.GL13;
import org.lwjgl.opengl.GL30;
import org.lwjgl.opengl.GL31;

/** The OpenCL 1.2 OpenGL interoperability functionality. */
public class CL12GL {

	/** cl_gl_object_type */
	public static final int
		CL_GL_OBJECT_TEXTURE_2D_ARRAY = 0x200E,
		CL_GL_OBJECT_TEXTURE1D        = 0x200F,
		CL_GL_OBJECT_TEXTURE1D_ARRAY  = 0x2010,
		CL_GL_OBJECT_TEXTURE_BUFFER   = 0x2011;

	protected CL12GL() {
		throw new UnsupportedOperationException();
	}

	static boolean isAvailable(CLCapabilities caps) {
		return checkFunctions(
			caps.clCreateFromGLTexture
		);
	}

	// --- [ clCreateFromGLTexture ] ---

	/** Unsafe version of: {@link #clCreateFromGLTexture CreateFromGLTexture} */
	public static long nclCreateFromGLTexture(long context, long flags, int texture_target, int miplevel, int texture, long errcode_ret) {
		long __functionAddress = CL.getICD().clCreateFromGLTexture;
		if ( CHECKS ) {
			checkFunctionAddress(__functionAddress);
			checkPointer(context);
		}
		return callPJPP(__functionAddress, context, flags, texture_target, miplevel, texture, 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. {@link GL11#glTexImage2D}, {@link GL12#glTexImage3D} or the values of the * texture parameters {@link GL12#GL_TEXTURE_BASE_LEVEL} or {@link GL12#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 {@link CL10#clRetainMemObject RetainMemObject} and {@link CL10#clReleaseMemObject ReleaseMemObject} functions can be used to retain and release the image objects.

* * @param context a valid OpenCL context created from an OpenGL context * @param flags a bit-field that is used to specify usage information. One of:
{@link CL10#CL_MEM_READ_ONLY MEM_READ_ONLY}{@link CL10#CL_MEM_WRITE_ONLY MEM_WRITE_ONLY}{@link CL10#CL_MEM_READ_WRITE MEM_READ_WRITE}
* @param texture_target defines the image type of {@code texture}. No reference to a bound GL texture object is made or implied by this parameter. One of:
{@link GL11#GL_TEXTURE_1D}{@link GL30#GL_TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_BUFFER}
{@link GL11#GL_TEXTURE_2D}{@link GL30#GL_TEXTURE_2D_ARRAY}{@link GL12#GL_TEXTURE_3D}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z}
{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z}
{@link GL31#GL_TEXTURE_RECTANGLE}
* @param miplevel the mipmap level to be used. Implementations may return {@link CL10#CL_INVALID_OPERATION INVALID_OPERATION} for {@code miplevel} values > 0. If * {@code texture_target} is {@link GL31#GL_TEXTURE_BUFFER}, {@code miplevel} must be 0. * @param 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 specified {@code 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. * @param errcode_ret will return an appropriate error code. If {@code errcode_ret} is {@code NULL}, no error code is returned. * * @return a valid non-zero OpenCL image object and {@code errcode_ret} is set to {@link CL10#CL_SUCCESS SUCCESS} if the image object is created successfully. Otherwise, it returns a {@code NULL} * value with one of the following error values returned in {@code errcode_ret}: * *
    *
  • {@link CL10#CL_INVALID_CONTEXT INVALID_CONTEXT} if {@code context} is not a valid context or was not created from a GL context.
  • *
  • {@link CL10#CL_INVALID_VALUE INVALID_VALUE} if values specified in {@code flags} are not valid or if value specified in {@code texture_target} is not one of the * values specified in the description of {@code texture_target}.
  • *
  • {@link CL10GL#CL_INVALID_MIP_LEVEL INVALID_MIP_LEVEL} if {@code miplevel} is less than the value of {@code level}base (for OpenGL implementations) or zero (for * OpenGL ES implementations); or greater than the value of {@code q} (for both OpenGL and OpenGL ES).
  • *
  • {@link CL10GL#CL_INVALID_MIP_LEVEL INVALID_MIP_LEVEL} if {@code miplevel} is greather than zero and the OpenGL implementation does not support creating from non-zero mipmap * levels.
  • *
  • {@link CL10GL#CL_INVALID_GL_OBJECT INVALID_GL_OBJECT} if {@code texture} is not a GL texture object whose type matches {@code texture_target}, if the specified {@code miplevel} * of texture is not defined, or if the width or height of the specified {@code miplevel} is zero.
  • *
  • {@link CL10#CL_INVALID_IMAGE_FORMAT_DESCRIPTOR INVALID_IMAGE_FORMAT_DESCRIPTOR} if the OpenGL texture internal format does not map to a supported OpenCL image format.
  • *
  • {@link CL10#CL_INVALID_OPERATION INVALID_OPERATION} if {@code texture} is a GL texture object created with a border width value greater than zero.
  • *
  • {@link CL10#CL_OUT_OF_RESOURCES OUT_OF_RESOURCES} if there is a failure to allocate resources required by the OpenCL implementation on the device.
  • *
  • {@link CL10#CL_OUT_OF_HOST_MEMORY OUT_OF_HOST_MEMORY} if there is a failure to allocate resources required by the OpenCL implementation on the host.
  • *
*/ public static long clCreateFromGLTexture(long context, long flags, int texture_target, int miplevel, int texture, IntBuffer errcode_ret) { if ( CHECKS ) checkBufferSafe(errcode_ret, 1); return nclCreateFromGLTexture(context, flags, texture_target, miplevel, texture, memAddressSafe(errcode_ret)); } /** Array version of: {@link #clCreateFromGLTexture CreateFromGLTexture} */ public static long clCreateFromGLTexture(long context, long flags, int texture_target, int miplevel, int texture, int[] errcode_ret) { long __functionAddress = CL.getICD().clCreateFromGLTexture; if ( CHECKS ) { checkFunctionAddress(__functionAddress); checkPointer(context); checkBufferSafe(errcode_ret, 1); } return callPJPP(__functionAddress, context, flags, texture_target, miplevel, texture, errcode_ret); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy