www.khronos.org/opengles©2015 Khronos Group - Rev. 0715
OpenGL ES 3.2 API Reference Guide Page 2
Textures and Samplers [8]
void AcveTexture(enum texture);
texture: TEXTUREi (where i is [0, max (
MAX_COMBINED_TEXTURE_IMAGE_UNITS)-1])
Texture Objects [8.1]
void GenTextures(sizei n, uint *textures);
void BindTexture(enum target, uint texture);
target:
TEXTURE_2D[_ARRAY], TEXTURE_3D,
TEXTURE_2D_MULTISAMPLE[_ARRAY],
TEXTURE_BUFFER, TEXTURE_CUBE_MAP[_ARRAY]
void DeleteTextures(sizei n,
const uint *textures);
boolean IsTexture(uint texture);
Sampler Objects [8.2]
void GenSamplers(sizei count, uint *samplers);
void BindSampler(uint unit, uint sampler);
void SamplerParameter{i f}(uint sampler,
enum pname, T param);
pname: TEXTURE_X, where X may be one of
COMPARE_{MODE, FUNC}, {MIN, MAG}_FILTER,
{MIN, MAX}_LOD, WRAP_{S, T, R} [Table 20.11]
void SamplerParameter{i f}v(uint sampler,
enum pname, const T *params);
pname: See SamplerParameter{if}
void SamplerParameterI{i ui}v(uint sampler,
enum pname, const T *params);
pname: See SamplerParameter{if}
void DeleteSamplers(sizei count,
const uint *samplers);
boolean IsSampler(uint sampler);
Sampler Queries [8.3]
void GetSamplerParameter{i f}v(
uint
sampler, enum pname, T *params);
pname: See SamplerParameter{if}
void GetSamplerParameterI{i ui}v(
uint sampler, enum pname, T *params);
pname: See SamplerParameter{if}
Pixel Storage Modes and
Pixel Buer Objects
[8.4.1]
void PixelStorei(enum pname, T param);
pname: [Tables 8.1, 18.1]
[UN]PACK_ALIGNMENT,
UNPACK_IMAGE_HEIGHT,
[UN]PACK_ROW_LENGTH,
UNPACK_SKIP_IMAGES,
[UN]PACK_SKIP_PIXELS,
[UN]PACK_SKIP_ROWS
Texture Image Spec. [8.5]
void TexImage3D(enum target, int level,
int internalformat, sizei width, sizei height,
sizei depth, int border
, enum format,
enum type, const void *data);
target: TEXTURE_2D_ARRAY, TEXTURE_3D,
TEXTURE_CUBE_MAP_ARRAY
format:
ALPHA, DEPTH_{COMPONENT, STENCIL},
LUMINANCE,LUMINANCE_ALPHA, RGBA, RGB,
RG, RED, {RGBA, RGB, RG, RED}_INTEGER,
STENCIL_INDEX
type:
{UNSIGNED_}BYTE, {UNSIGNED_}SHORT,
{UNSIGNED_}INT, {HALF_}FLOAT,
UNSIGNED_SHORT_4_4_4_4,
UNSIGNED_SHORT_5_5_5_1,
UNSIGNED_SHORT_5_6_5,
UNSIGNED_INT_2_10_10_10_REV,
UNSIGNED_INT_24_8,
UNSIGNED_INT_10F_11F_11F_REV,
UNSIGNED_INT_5_9_9_9_REV,
FLOAT_32_UNSIGNED_INT_24_8_REV
internalformat: Alpha, LUMINANCE_ALPHA,
LUMINANCE, DEPTH_COMPONENT{16, 24, 32F}
R8, R8I, R8UI, R8_SNORM,
R16I, R16UI, R16F, R32I, R32UI, R32F,
RG8, RG8I, RG8UI, RG8_SNORM,
RG16I, RG16UI, RG16F, RG32I, RG32UI, RG32F,
RGB, RGB5_A1, RGB565,
RGB8, RGB8I, RGB8UI, RGB8_SNORM,
SRGB8, SRGB8_ALPHA8,
RGB9_E5, RGB10_A2, RGB10_A2UI,
RGB16I, RGB16UI, RGB16F,
RGB32I, RGB32UI, RGB32F,
RGBA, RGBA4, RGBA8, RGBA8I, RGBA8UI,
RGBA8_SNORM, RGBA16I, RGBA16UI, RGBA16F,
RGBA32I, RGBA32UI, RGBA32F,
R11F_G11F_B10F
void TexImage2D(enum target, int level,
int internalformat, sizei width, sizei height,
int border, enum format
, enum type,
void *data);
target: TEXTURE_2D,
TEXTURE_CUBE_MAP_NEGATIVE_{X, Y, Z},
TEXTURE_CUBE_MAP_POSITIVE_{X, Y, Z}
internalformat: See TexImage3D
format, type: See TexImage3D
Alternate Texture Image Spec. [8.6]
void CopyTexImage2D(enum target, int level,
enum internalformat, int x, int y
, sizei width,
sizei height, int border);
target: See TexImage2D
internalformat:
See TexImage3D, except for DEPTH* values
void TexSubImage3D(enum target, int level,
int xoset, int yoset, int zoset, sizei width,
sizei height, sizei depth, enum format,
enum type, const void *data);
target: TEXTURE_2D_ARRAY, TEXTURE_3D
format, type: See TexImage3D
void TexSubImage2D(enum target, int level,
int xoset, int yoset, sizei width,
sizei height, enum format, enum type,
const void *data);
target: See TexImage2D
format, type: See TexImage3D
void CopyTexSubImage3D(enum target,
int level, int xoset, int yoset, int zoset,
int x, int y
, sizei width, sizei height);
target: TEXTURE_2D_ARRAY, TEXTURE_3D
format, type: See TexImage3D
void CopyTexSubImage2D(enum target,
int level, int xoset, int yoset, int x, int y,
sizei width
, sizei height);
target: See TexImage2D
Compressed Texture Images [8.7]
void CompressedTexImage2D(enum target,
int level, enum internalformat, sizei width,
sizei height, int border, sizei imageSize,
const void *data);
target: See TexImage2D
internalformat: [Table 8.17] COMPRESSED_X,
where X may be one of [SIGNED_]R11_EAC,
[SIGNED_]RG11_EAC, [S]RGB8_ETC2,
[S]RGB8_PUNCHTHROUGH_ALPHA1_ETC2,
RGBA8_ETC2_EAC, SRGB8_ALPHA8_ETC2_EAC,
RGBA_ASTC_dim, or SRGB8_ALPHA8_ASTC_dim
(where dim may be one of 4x4, 5x4, 5x5, 6x5, 6x6,
8x5, 10x5, 10x6, 10x8, 10x10, 12x10, 12x12)
void CompressedTexImage3D(
enum target, int level, enum internalformat,
sizei width, sizei height
, sizei depth,
int border
, sizei imageSize,
const void *data);
target: Any compressed internal format from
[Table 18.7]
internalformat: Any ASTC compressed internal
format from [Table 18.7]:
COMPRESSED_{RGBA, SRGB8_ALPHA8}_ASTC_X,
where X may be one of
4x4, 5x4, 5x5,
6x5, 6x6, 8x5, 8x6, 8x8,
10x5, 10x6, 10x8, 10x10,
12x10, 12x12
void CompressedTexSubImage2D(
enum target, int level, int xoset, int yoset,
sizei width, sizei height
, enum format,
sizei imageSize, const void *data);
target: See TexImage2D
void CompressedTexSubImage3D(
enum target, int level, int xoset, int yoset,
int zoset, sizei width, sizei height,
sizei depth, enum format, sizei imageSize,
const void *data);
target: TEXTURE_2D_ARRAY, TEXTURE_3D
Mulsample Textures [8.8]
void TexStorage2DMulsample(enum target,
sizei samples, int sizedinternalformat,
sizei width, sizei height,
boolean xedsamplelocaons);
target: TEXTURE_2D_MULTISAMPLE
sizedinternalformat: (Supported when samples = 1)
DEPTH{24, 32F}_STENCIL8,
DEPTH_COMPONENT{16, 24, 32F},
R11F_G11F_B10F,
R16{F, I, UI}, R32{F, I, UI}, R8, R8{I, UI},
RG16{F, I, UI}, RG32{F, I, UI}, RG8, RG8{I, UI},
RGB10_A2, RGB10_A2UI, RGB8, RGB565,
RGB5_A1, RGBA16{F, I, UI}, RGBA32{F, I, UI},
RGBA4, RGBA8, RGBA8{I, UI}, SRGB8_ALPHA8,
STENCIL_INDEX8
void TexStorage3DMulsample(enum target,
sizei samples, int sizedinternalformat,
sizei width, sizei height, sizei depth,
boolean xedsamplelocaons);
target: TEXTURE_2D_MULTISAMPLE_ARRAY
sizedinternalformat: See TexStorage2DMulsample
Buer Textures [8.9]
void TexBuerRange(enum target,
enum internalformat, uint buer,
intptr oset, sizeiptr size);
target: TEXTURE_BUFFER
internalformat:
Any sized internal format from Table 8.18
void TexBuer(enum target,
enum internalformat, uint buer);
target, internalformat: See TexBuerRange
Texture Parameters [8.10]
void TexParameter{i f}(enum target,
enum pname, T param);
target:
TEXTURE_{2D, 3D},
TEXTURE_2D_{ARRAY, MULTISAMPLE},
TEXTURE_2D_MULTISAMPLE_ARRAY,
TEXTURE_CUBE_MAP[_ARRAY]
pname: [Table 8.19]
DEPTH_STENCIL_TEXTURE_MODE,
TEXTURE_BORDER_COLOR,
TEXTURE_{BASE, MAX}_LEVEL,
TEXTURE_COMPARE_{MODE, FUNC},
TEXTURE_{MIN, MAG}_FILTER,
TEXTURE_{MIN, MAX}_LOD,
TEXTURE_SWIZZLE_{R,G,B,A},
TEXTURE_WRAP_{S,T,R}
void TexParameter{i f}v(enum target,
enum pname, const T *params);
target, pname: See TexParameter{i f}
void TexParameterI{i ui}v(uint texture,
enum pname, const T *params);
pname: See TexParameter{i f}
texture: See target for TexParameter{i f}
(Connued on next page)
Programs and Shaders (cont.)
Load Uniform Vars. In Default Uniform Block
void Uniform{1234}{i f ui}(int locaon,
T value);
void Uniform{1234}{i f ui}v(int locaon,
sizei count, const T *value);
void UniformMatrix{234}fv(int locaon,
sizei count
, boolean transpose,
const oat *value);
void
UniformMatrix{2x3, 3x2, 2x4, 4x2, 3x4,
4x3}fv(int locaon, sizei count,
boolean transpose, const oat *value);
void ProgramUniform{1234}{i f}(
uint program, int locaon, T value);
void ProgramUniform{1234}{i f}v(
uint program, int locaon, sizei count,
const T *value);
void ProgramUniform{1234}ui(
uint program, int locaon, T value);
void ProgramUniform{1234}uiv(
uint program, int locaon, sizei count,
const T *value);
void ProgramUniformMatrix{234}{f}v(
uint program, int locaon, sizei count,
boolean transpose, const T *value);
void ProgramUniformMatrix{2x3, 3x2,
2x4, 4x2, 3x4, 4x3}{f}v(uint program,
int locaon, sizei count, boolean transpose,
const T *value);
Uniform Buer Object Bindings
void UniformBlockBinding(uint program,
uint uniformBlockIndex,
uint uniformBlockBinding);
Shader Memory Access [7.11]
void MemoryBarrier(biield barriers);
barriers:
ALL_BARRIER_BITS, or the OR of X_BARRIER_BIT,
where X may be one of: ATOMIC_COUNTER,
BUFFER_UPDATE, COMMAND, ELEMENT_ARRAY,
FRAMEBUFFER, PIXEL_BUFFER,
SHADER_IMAGE_ACCESS, SHADER_STORAGE,
TEXTURE_FETCH, TEXTURE_UPDATE,
TRANSFORM_FEEDBACK, UNIFORM,
VERTEX_ATTRIB_ARRAY
void MemoryBarrierByRegion(biield
barriers);
barriers:
ALL_BARRIER_BITS or the OR of
X_BARRIER_BIT, where X may be one of:
ATOMIC_COUNTER, FRAMEBUFFER,
IMAGE_ACCESS, SHADER_SHADER_STORAGE,
TEXTURE_FETCH, UNIFORM
Shader, Program, Pipeline Queries [7.12]
void GetShaderiv(uint shader, enum pname,
int *params);
pname: {COMPILE, DELETE}_STATUS,
INFO_LOG_LENGTH,
SHADER_{SOURCE_LENGTH, TYPE},
void GetProgramiv(uint program,
enum pname, int *params);
pname: ACTIVE_ATOMIC_COUNTER_BUFFERS,
ACTIVE_ATTRIBUTES, ACTIVE_UNIFORMS,
ACTIVE_{ATTRIBUTE, UNIFORM}_MAX_LENGTH,
ACTIVE_UNIFORM_BLOCKS,
ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH,
ATTACHED_SHADERS,
COMPUTE_WORK_GROUP_SIZE,
DELETE_STATUS, GEOMETRY_VERTICES_OUT,
GEOMETRY_{INPUT, OUTPUT}_TYPE,
GEOMETRY_SHADER_INVOCATIONS,
INFO_LOG_LENGTH, LINK_STATUS,
PROGRAM_BINARY_RETRIEVABLE_HINT,
PROGRAM_SEPARABLE,
TRANSFORM_FEEDBACK_BUFFER_MODE,
TRANSFORM_FEEDBACK_VARYINGS,
TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH,
TESS_CONTROL_OUTPUT_VERTICES,
TESS_GEN_MODE, TESS_GEN_SPACING,
TESS_GEN_VERTEX_ORDER,
TESS_GEN_POINT_MODE, VALIDATE_STATUS,
void GetProgramPipelineiv(uint pipeline,
enum pname, int *params);
pname: ACTIVE_PROGRAM, INFO_LOG_LENGTH,
VALIDATE_STATUS, or X_SHADER , where X may
be one of COMPUTE, FRAGMENT, GEOMETRY,
VERTEX, TESS_CONTROL, TESS_EVALUATION
void GetAachedShaders(uint program,
sizei maxCount, sizei *count,
uint *shaders);
void GetShaderInfoLog(uint shader,
sizei bufSize, sizei *length, char *infoLog);
void GetProgramInfoLog(uint program,
sizei bufSize, sizei *length, char *infoLog);
void GetProgramPipelineInfoLog(
uint pipeline, sizei bufSize,
sizei *length, char *infoLog);
void GetShaderSource(uint shader,
sizei bufSize, sizei *length, char *source);
void GetShaderPrecisionFormat(
enum shadertype, enum precisiontype,
int *range, int *precision);
shadertype: {FRAGMENT, VERTEX}_SHADER
precisiontype: {LOW, MEDIUM, HIGH}_{FLOAT, INT}
void GetUniform{f i ui}v(uint program,
int locaon, T *params);
void GetnUniform{f i ui}v(uint program,
int locaon, T *params);