C Specification
To create an EGLImage target of type cl_mem from the EGLImage source
provided as image, call the function
// Provided by cl_khr_egl_image
cl_mem clCreateFromEGLImageKHR(
cl_context context,
CLeglDisplayKHR egldisplay,
CLeglImageKHR eglimage,
cl_mem_flags flags,
const cl_egl_image_properties_khr* properties,
cl_int* errcode_ret);
clCreateFromEGLImageKHR is provided by the cl_khr_egl_image extension.
|
Parameters
-
display should be of type
EGLDisplay, cast into the typeCLeglDisplayKHR. -
image should be of type
EGLImageKHR, cast into the typeCLeglImageKHR. Assuming no errors are generated in this function, the resulting image object will be anEGLImagetarget of the specifiedEGLImageimage. The resultingcl_memis an image object which may be used normally by all OpenCL operations. This maps to animage2d_ttype in OpenCL kernel code. -
flags is a bit-field that is used to specify usage information about the memory object being created. Refer to the Memory Flags table for a description of flags. Accepted values in flags are described below.
-
properties specifies a list of property names and their corresponding values. Each property name is immediately followed by the corresponding desired value. The list is terminated with 0. No properties are currently supported with this version of the extension. properties can be
NULL. -
errcode_ret will return an appropriate error code. If errcode_ret is
NULL, no error code is returned.
Description
Accepted for flags are CL_MEM_, CL_MEM_,
CL_MEM_,
and CL_MEM_.
If OpenCL 1.2 is supported, flags also accepts CL_MEM_,
CL_MEM_, and CL_MEM_.
cl_khr_ only requires support for CL_MEM_, and for
CL_MEM_ if OpenCL 1.2 or later is supported.
For OpenCL 1.1, a CL_INVALID_ will be returned for images which
do not support host mapping.
If the value passed in flags is not supported by the OpenCL
implementation, it will return CL_INVALID_.
The accepted flags may be dependent upon the texture format used.
If CL_MEM_ is set in flags, the image created is
an immutable memory object that cannot be modified by the implementation
after creation.
clCreateFromEGLImageKHR returns a valid non-zero OpenCL image object and
errcode_ret is set to CL_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:
-
CL_INVALID_if context is not a valid OpenCL context.CONTEXT -
CL_INVALID_if properties contains invalid values, if display is not a valid display object or if flags are not in the set defined above.VALUE -
CL_INVALID_if image is not a validEGL_ OBJECT_ KHR EGLImageobject. -
CL_IMAGE_if the OpenCL implementation is not able to create aFORMAT_ NOT_ SUPPORTED cl_memcompatible with the providedCLeglImageKHRfor an implementation-dependent reason (this could be caused by, but not limited to, reasons such as unsupported texture formats, etc). -
CL_OUT_if there is a failure to allocate resources required by the OpenCL implementation on the host.OF_ HOST_ MEMORY -
CL_OUT_if there is a failure to allocate resources required by the OpenCL implementation on the device.OF_ RESOURCES -
CL_INVALID_if there are no devices in context that support images (i.e.OPERATION CL_DEVICE_specified in table 4.3 isIMAGE_ SUPPORT CL_FALSE) or if the flags passed are not supported for that image type. -
CL_INVALID_ifVALUE CL_MEM_is set in flags andIMMUTABLE_ EXT CL_MEM_,READ_ WRITE CL_MEM_, orWRITE_ ONLY CL_MEM_is set in flags.HOST_ WRITE_ ONLY
Document Notes
For more information, see the OpenCL Specification
This page is extracted from the OpenCL Specification. Fixes and changes should be made to the Specification, not directly.