Skip to content

Latest commit

 

History

History
69 lines (43 loc) · 2.78 KB

cl_khr_gl_msaa_sharing.adoc

File metadata and controls

69 lines (43 loc) · 2.78 KB

cl_khr_gl_msaa_sharing

Extends the CL/GL sharing to support GL multi-sampled texture (color or depth).

#pragma OPENCL EXTENSION cl_khr_gl_msaa_sharing : enable

Description

This extension name is cl_khr_gl_msaa_sharing. This extension requires cl_khr_gl_depth_images.

This extension adds read_image and write_image functions to the Image Read and Write Functions.

Multi-sample CL image objects (MSAA) can only be read from a kernel. Multi-sample CL image objects cannot be used as arguments to clEnqueueReadImage , clEnqueueWriteImage, clEnqueueCopyImage, clEnqueueCopyImageToBuffer, clEnqueueCopyBufferToImage, clEnqueueMapImage and clEnqueueFillImage and will return a CL_INVALID_OPERATION error.

Add the following new data types to table 6.3 in section 6.1.3 of the OpenCL 2.1 specification (see otherDataTypes):

Type Description

image2d_msaa_t

A 2D multi-sample color image. Refer to section 6.13.14 for a detailed description of the built-in functions that use this type.

image2d_array_msaa_t

A 2D multi-sample color image array. Refer to section 6.13.14 for a detailed description of the built-in functions that use this type.

image2d_msaa_depth_t

A 2D multi-sample depth image. Refer to section 6.13.14 for a detailed description of the built-in functions that use this type.

image2d_array_msaa_depth_t

A 2D multi-sample depth image array. Refer to section 6.13.14 for a detailed description of the built-in functions that use this type.

Note
When a multisample image is accessed in a kernel, the access takes one vector of integers describing which pixel to fetch and an integer corresponding to the sample numbers describing which sample within the pixel to fetch. sample identifies the sample position in the multi-sample image.

For best performance, we recommend that sample be a literal value so it is known at compile time and the OpenCL compiler can perform appropriate optimizations for multisample reads on the device.

No standard sampling instructions are allowed on the multisample image. Accessing a coordinate outside the image and/or a sample that is outside the number of samples associated with each pixel in the image is undefined