Skip to content

Latest commit

 

History

History
153 lines (102 loc) · 3.22 KB

gl_formatsInc.adoc

File metadata and controls

153 lines (102 loc) · 3.22 KB
OpenGL and Corresponding OpenCL Image Formats

The table below (Table 9.4) describes the list of GL texture internal formats and the corresponding CL image formats. If a GL texture object with an internal format from the table below is successfully created by OpenGL, then there is guaranteed to be a mapping to one of the corresponding CL image format(s) in that table. Texture objects created with other OpenGL internal formats may (but are not guaranteed to) have a mapping to a CL image format; if such mappings exist, they are guaranteed to preserve all color components, data types, and at least the number of bits/component actually allocated by OpenGL for that format.

GL internal format CL image format (channel order, channel data type)

GL_RGBA8

CL_RGBA, CL_UNORM_INT8 or CL_BGRA, CL_UNORM_INT8

GL_SRGBA8_ALPHA8

CL_sRGBA, CL_UNORM_INT8

GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV

CL_RGBA, CL_UNORM_INT8

GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV

CL_BGRA, CL_UNORM_INT8

GL_RGBA8I, GL_RGBA8I_EXT

CL_RGBA, CL_SIGNED_INT8

GL_RGBA16I, GL_RGBA16I_EXT

CL_RGBA, CL_SIGNED_INT16

GL_RGBA32I, GL_RGBA32I_EXT

CL_RGBA, CL_SIGNED_INT32

GL_RGBA8UI, GL_RGBA8UI_EXT

CL_RGBA, CL_UNSIGNED_INT8

GL_RGBA16UI, GL_RGBA16UI_EXT

CL_RGBA, CL_UNSIGNED_INT16

GL_RGBA32UI, GL_RGBA32UI_EXT

CL_RGBA, CL_UNSIGNED_INT32

GL_RGBA8_SNORM

CL_RGBA, CL_SNORM_INT8

GL_RGBA16

CL_RGBA, CL_UNORM_INT16

GL_RGBA16_SNORM

CL_RGBA, CL_SNORM_INT166

GL_RGBA16F, GL_RGBA16F_ARB

CL_RGBA, CL_HALF_FLOAT

GL_RGBA32F, GL_RGBA32F_ARB

CL_RGBA, CL_FLOAT

GL_R8

CL_R, CL_UNORM_INT8

GL_R8_SNORM

CL_R, CL_SNORM_INT8

GL_R16

CL_R, CL_UNORM_INT16

GL_R16_SNORM

CL_R, CL_SNORM_INT16

GL_R16F

CL_R, CL_HALF_FLOAT

GL_R32F

CL_R, CL_FLOAT

GL_R8I

CL_R, CL_SIGNED_INT8

GL_R16I

CL_R, CL_SIGNED_INT16

GL_R32I

CL_R, CL_SIGNED_INT32

GL_R8UI

CL_R, CL_UNSIGNED_INT8

GL_R16UI

CL_R, CL_UNSIGNED_INT16

GL_R32UI

CL_R, CL_UNSIGNED_INT32

GL_RG8

CL_RG, CL_UNORM_INT8

GL_RG8_SNORM

CL_RG, CL_SNORM_INT8

GL_RG16

CL_RG, CL_UNORM_INT16

GL_RG16_SNORM

CL_RG, CL_SNORM_INT16

GL_RG16F

CL_RG, CL_HALF_FLOAT

GL_RG32F

CL_RG, CL_FLOAT

GL_RG8I

CL_RG, CL_SIGNED_INT8

GL_RG16I

CL_RG, CL_SIGNED_INT16

GL_RG32I

CL_RG, CL_SIGNED_INT32

GL_RG8UI

CL_RG, CL_UNSIGNED_INT8

GL_RG16UI

CL_RG, CL_UNSIGNED_INT16

GL_RG32UI

CL_RG, CL_UNSIGNED_INT32

If the cl_khr_gl_depth_images extension is enabled, the following new image formats are added to table 9.4 in section 9.6.3.1 of the OpenCL 2.0 extension specification. If a GL texture object with an internal format from table 9.4 is successfully created by OpenGL, then there is guaranteed to be a mapping to one of the corresponding CL image format(s) in that table.

GL internal format CL image format (channel order, channel data type)

GL_DEPTH_COMPONENT32F

CL_DEPTH, CL_FLOAT

GL_DEPTH_COMPONENT16

CL_DEPTH, CL_UNORM_INT16

GL_DEPTH24_STENCIL8

CL_DEPTH_STENCIL, CL_UNORM_INT24

GL_DEPTH32F_STENCIL8

CL_DEPTH_STENCIL, CL_FLOAT