| // Copyright (C) 2015 The Android Open Source Project |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); |
| // you may not use this file except in compliance with the License. |
| // You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glActiveShaderProgram.xhtml","OpenGL ES 3.1") |
| cmd void glActiveShaderProgram(PipelineId pipeline, ProgramId program) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glAttachShader.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glAttachShader.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glAttachShader.xhtml","OpenGL ES 3.1") |
| cmd void glAttachShader(ProgramId program, ShaderId shader) { |
| minRequiredVersion(2, 0) |
| |
| ctx := GetContext() |
| p := ctx.Instances.Programs[program] |
| s := ctx.Instances.Shaders[shader] |
| p.Shaders[s.Type] = shader |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glBindAttribLocation.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glBindAttribLocation.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glBindAttribLocation.xhtml","OpenGL ES 3.1") |
| cmd void glBindAttribLocation(ProgramId program, AttributeLocation location, string name) { |
| minRequiredVersion(2, 0) |
| |
| ctx := GetContext() |
| p := ctx.Instances.Programs[program] |
| p.AttributeBindings[name] = location |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glBindProgramPipeline.xhtml","OpenGL ES 3.1") |
| cmd void glBindProgramPipeline(PipelineId pipeline) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glCompileShader.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glCompileShader.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glCompileShader.xhtml","OpenGL ES 3.1") |
| cmd void glCompileShader(ShaderId shader) { |
| minRequiredVersion(2, 0) |
| |
| // TODO: shader.Binary < ? |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glCreateProgram.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glCreateProgram.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glCreateProgram.xhtml","OpenGL ES 3.1") |
| cmd ProgramId glCreateProgram() { |
| minRequiredVersion(2, 0) |
| |
| ctx := GetContext() |
| id := as!ProgramId(?) |
| ctx.Instances.Programs[id] = new!Program() |
| return id |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glCreateShader.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glCreateShader.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glCreateShader.xhtml","OpenGL ES 3.1") |
| cmd ShaderId glCreateShader(GLenum type) { |
| minRequiredVersion(2, 0) |
| switch (type) { |
| case GL_FRAGMENT_SHADER, GL_VERTEX_SHADER: { |
| // version 2.0 |
| } |
| case GL_COMPUTE_SHADER: { |
| minRequiredVersion(3, 1) |
| } |
| default: { |
| glErrorInvalidEnum(type) |
| } |
| } |
| |
| ctx := GetContext() |
| id := as!ShaderId(?) |
| ctx.Instances.Shaders[id] = new!Shader() |
| s := ctx.Instances.Shaders[id] |
| s.Type = type |
| return id |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glCreateShaderProgram.xhtml","OpenGL ES 3.1") |
| cmd ProgramId glCreateShaderProgramv(GLenum type, GLsizei count, const GLchar* const* strings) { |
| minRequiredVersion(3, 1) |
| switch (type) { |
| case GL_COMPUTE_SHADER, GL_FRAGMENT_SHADER, GL_VERTEX_SHADER: { |
| // version 3.1 |
| } |
| default: { |
| glErrorInvalidEnum(type) |
| } |
| } |
| // TODO |
| return ? |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glDeleteProgram.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteProgram.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glDeleteProgram.xhtml","OpenGL ES 3.1") |
| cmd void glDeleteProgram(ProgramId program) { |
| minRequiredVersion(2, 0) |
| |
| ctx := GetContext() |
| ctx.Instances.Programs[program] = null |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glDeleteProgramPipelines.xhtml","OpenGL ES 3.1") |
| cmd void glDeleteProgramPipelines(GLsizei n, const PipelineId* pipelines) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glDeleteShader.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteShader.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glDeleteShader.xhtml","OpenGL ES 3.1") |
| cmd void glDeleteShader(ShaderId shader) { |
| minRequiredVersion(2, 0) |
| |
| ctx := GetContext() |
| s := ctx.Instances.Shaders[shader] |
| s.Deletable = true |
| // TODO: refcount shader attachment and only destroy if zero |
| ctx.Instances.Shaders[shader] = null |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glDetachShader.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glDetachShader.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glDetachShader.xhtml","OpenGL ES 3.1") |
| cmd void glDetachShader(ProgramId program, ShaderId shader) { |
| minRequiredVersion(2, 0) |
| |
| ctx := GetContext() |
| p := ctx.Instances.Programs[program] |
| s := ctx.Instances.Shaders[shader] |
| p.Shaders[s.Type] = null |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glDispatchCompute.xhtml","OpenGL ES 3.1") |
| cmd void glDispatchCompute(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glDispatchComputeIndirect.xhtml","OpenGL ES 3.1") |
| cmd void glDispatchComputeIndirect(GLintptr indirect) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glGenProgramPipelines.xhtml","OpenGL ES 3.1") |
| cmd void glGenProgramPipelines(GLsizei n, PipelineId* pipelines) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGetActiveAttrib.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glGetActiveAttrib.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glGetActiveAttrib.xhtml","OpenGL ES 3.1") |
| cmd void glGetActiveAttrib(ProgramId program, |
| AttributeLocation location, |
| GLsizei buffer_size, |
| GLsizei* buffer_bytes_written, |
| GLint* vector_count, |
| GLenum* type, |
| GLchar* name) { |
| minRequiredVersion(2, 0) |
| |
| if buffer_bytes_written != null { |
| l := as!GLsizei(?) |
| buffer_bytes_written[0] = l |
| write(name[0:l]) |
| } else { |
| write(name[0:256]) // HACK: Non-deterministic string length! |
| } |
| |
| vector_count[0] = as!GLint(?) |
| type[0] = as!GLenum(?) |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGetActiveUniform.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glGetActiveUniform.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glGetActiveUniform.xhtml","OpenGL ES 3.1") |
| cmd void glGetActiveUniform(ProgramId program, |
| GLuint location, |
| GLsizei buffer_size, |
| GLsizei* buffer_bytes_written, |
| GLint* vector_count, |
| GLenum* type, |
| GLchar* name) { |
| minRequiredVersion(2, 0) |
| |
| if buffer_bytes_written != null { |
| l := as!GLsizei(?) |
| buffer_bytes_written[0] = l |
| write(name[0:l]) |
| } else { |
| write(name[0:256]) // HACK: Non-deterministic string length! |
| } |
| |
| vector_count[0] = as!GLint(?) |
| type[0] = as!GLenum(?) |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glGetActiveUniformBlockName.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glGetActiveUniformBlockName.xhtml","OpenGL ES 3.1") |
| cmd void glGetActiveUniformBlockName(ProgramId program, |
| UniformBlockId uniform_block_index, |
| GLsizei buffer_size, |
| GLsizei* buffer_bytes_written, |
| GLchar* name) { |
| minRequiredVersion(3, 0) |
| |
| l := as!GLsizei(?) |
| buffer_bytes_written[0] = l |
| write(name[0:l]) |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glGetActiveUniformBlockiv.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glGetActiveUniformBlockiv.xhtml","OpenGL ES 3.1") |
| cmd void glGetActiveUniformBlockiv(ProgramId program, |
| UniformBlockId uniform_block_index, |
| GLenum parameter_name, |
| GLint* parameters) { |
| minRequiredVersion(3, 0) |
| switch (parameter_name) { |
| case GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS, GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES, |
| GL_UNIFORM_BLOCK_BINDING, GL_UNIFORM_BLOCK_DATA_SIZE, GL_UNIFORM_BLOCK_NAME_LENGTH, |
| GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER, |
| GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: { |
| // version 3.0 |
| } |
| default: { |
| glErrorInvalidEnum(parameter_name) |
| } |
| } |
| |
| parameters[0] = ? |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glGetActiveUniformsiv.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glGetActiveUniformsiv.xhtml","OpenGL ES 3.1") |
| cmd void glGetActiveUniformsiv(ProgramId program, |
| GLsizei uniform_count, |
| const GLuint* uniform_indices, |
| GLenum parameter_name, |
| GLint* parameters) { |
| minRequiredVersion(3, 0) |
| switch (parameter_name) { |
| case GL_UNIFORM_ARRAY_STRIDE, GL_UNIFORM_BLOCK_INDEX, GL_UNIFORM_IS_ROW_MAJOR, |
| GL_UNIFORM_MATRIX_STRIDE, GL_UNIFORM_NAME_LENGTH, GL_UNIFORM_OFFSET, GL_UNIFORM_SIZE, |
| GL_UNIFORM_TYPE: { |
| // version 3.0 |
| } |
| default: { |
| glErrorInvalidEnum(parameter_name) |
| } |
| } |
| |
| read(uniform_indices[0:uniform_count]) |
| write(parameters[0:uniform_count]) |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGetAttachedShaders.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glGetAttachedShaders.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glGetAttachedShaders.xhtml","OpenGL ES 3.1") |
| cmd void glGetAttachedShaders(ProgramId program, |
| GLsizei buffer_length, |
| GLsizei* shaders_length_written, |
| ShaderId* shaders) { |
| minRequiredVersion(2, 0) |
| |
| ctx := GetContext() |
| p := ctx.Instances.Programs[program] |
| l := min(as!s32(buffer_length), len(p.Shaders)) |
| shaders_length_written[0] = as!GLsizei(l) |
| // TODO: Requires language support. |
| // for i, k, v in p.Shaders { |
| // if i < l { |
| // shaders[i] = v |
| // } |
| // } |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGetAttribLocation.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glGetAttribLocation.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glGetAttribLocation.xhtml","OpenGL ES 3.1") |
| cmd GLint glGetAttribLocation(ProgramId program, string name) { |
| minRequiredVersion(2, 0) |
| |
| return ? |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glGetFragDataLocation.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glGetFragDataLocation.xhtml","OpenGL ES 3.1") |
| cmd GLint glGetFragDataLocation(ProgramId program, const GLchar* name) { |
| minRequiredVersion(3, 0) |
| // TODO |
| return ? |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glGetProgramBinary.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glGetProgramBinary.xhtml","OpenGL ES 3.1") |
| cmd void glGetProgramBinary(ProgramId program, |
| GLsizei bufSize, |
| GLsizei* length, |
| GLenum* binaryFormat, |
| void* binary) { |
| minRequiredVersion(3, 0) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGetProgramInfoLog.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glGetProgramInfoLog.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glGetProgramInfoLog.xhtml","OpenGL ES 3.1") |
| cmd void glGetProgramInfoLog(ProgramId program, |
| GLsizei buffer_length, |
| GLsizei* string_length_written, |
| GLchar* info) { |
| minRequiredVersion(2, 0) |
| |
| ctx := GetContext() |
| p := ctx.Instances.Programs[program] |
| l := min(as!s32(buffer_length), as!s32(len(p.InfoLog))) |
| copy(info[0:l], p.InfoLog[0:l]) |
| string_length_written[0] = as!GLsizei(l) |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glGetProgramInterface.xhtml","OpenGL ES 3.1") |
| cmd void glGetProgramInterfaceiv(ProgramId program, |
| GLenum programInterface, |
| GLenum pname, |
| GLint* params) { |
| minRequiredVersion(3, 1) |
| switch (programInterface) { |
| case GL_ATOMIC_COUNTER_BUFFER, GL_BUFFER_VARIABLE, GL_PROGRAM_INPUT, GL_PROGRAM_OUTPUT, |
| GL_SHADER_STORAGE_BLOCK, GL_TRANSFORM_FEEDBACK_BUFFER, GL_TRANSFORM_FEEDBACK_VARYING, |
| GL_UNIFORM, GL_UNIFORM_BLOCK: { |
| // version 3.1 |
| } |
| default: { |
| glErrorInvalidEnum(programInterface) |
| } |
| } |
| switch (pname) { |
| case GL_ACTIVE_RESOURCES, GL_MAX_NAME_LENGTH, GL_MAX_NUM_ACTIVE_VARIABLES: { |
| // version 3.1 |
| } |
| default: { |
| glErrorInvalidEnum(pname) |
| } |
| } |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glGetProgramPipelineInfoLog.xhtml","OpenGL ES 3.1") |
| cmd void glGetProgramPipelineInfoLog(PipelineId pipeline, |
| GLsizei bufSize, |
| GLsizei* length, |
| GLchar* infoLog) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glGetProgramPipeline.xhtml","OpenGL ES 3.1") |
| cmd void glGetProgramPipelineiv(PipelineId pipeline, GLenum pname, GLint* params) { |
| minRequiredVersion(3, 1) |
| switch (pname) { |
| case GL_ACTIVE_PROGRAM, GL_COMPUTE_SHADER, GL_FRAGMENT_SHADER, GL_INFO_LOG_LENGTH, |
| GL_VALIDATE_STATUS, GL_VERTEX_SHADER: { |
| // version 3.1 |
| } |
| default: { |
| glErrorInvalidEnum(pname) |
| } |
| } |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glGetProgramResourceIndex.xhtml","OpenGL ES 3.1") |
| cmd GLuint glGetProgramResourceIndex(ProgramId program, |
| GLenum programInterface, |
| const GLchar* name) { |
| minRequiredVersion(3, 1) |
| switch (programInterface) { |
| case GL_BUFFER_VARIABLE, GL_PROGRAM_INPUT, GL_PROGRAM_OUTPUT, GL_SHADER_STORAGE_BLOCK, |
| GL_TRANSFORM_FEEDBACK_VARYING, GL_UNIFORM, GL_UNIFORM_BLOCK: { |
| // version 3.1 |
| } |
| default: { |
| glErrorInvalidEnum(programInterface) |
| } |
| } |
| // TODO |
| return ? |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glGetProgramResourceLocation.xhtml","OpenGL ES 3.1") |
| cmd GLint glGetProgramResourceLocation(ProgramId program, |
| GLenum programInterface, |
| const GLchar* name) { |
| minRequiredVersion(3, 1) |
| switch (programInterface) { |
| case GL_PROGRAM_INPUT, GL_PROGRAM_OUTPUT, GL_TRANSFORM_FEEDBACK_BUFFER, GL_UNIFORM: { |
| // version 3.1 |
| } |
| default: { |
| glErrorInvalidEnum(programInterface) |
| } |
| } |
| // TODO |
| return ? |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glGetProgramResourceName.xhtml","OpenGL ES 3.1") |
| cmd void glGetProgramResourceName(ProgramId program, |
| GLenum programInterface, |
| GLuint index, |
| GLsizei bufSize, |
| GLsizei* length, |
| GLchar* name) { |
| minRequiredVersion(3, 1) |
| switch (programInterface) { |
| case GL_BUFFER_VARIABLE, GL_PROGRAM_INPUT, GL_PROGRAM_OUTPUT, GL_SHADER_STORAGE_BLOCK, |
| GL_TRANSFORM_FEEDBACK_VARYING, GL_UNIFORM, GL_UNIFORM_BLOCK: { |
| // version 3.1 |
| } |
| default: { |
| glErrorInvalidEnum(programInterface) |
| } |
| } |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glGetProgramResource.xhtml","OpenGL ES 3.1") |
| cmd void glGetProgramResourceiv(ProgramId program, |
| GLenum programInterface, |
| GLuint index, |
| GLsizei propCount, |
| const GLenum* props, |
| GLsizei bufSize, |
| GLsizei* length, |
| GLint* params) { |
| minRequiredVersion(3, 1) |
| switch (programInterface) { |
| case GL_ATOMIC_COUNTER_BUFFER, GL_BUFFER_VARIABLE, GL_PROGRAM_INPUT, GL_PROGRAM_OUTPUT, |
| GL_SHADER_STORAGE_BLOCK, GL_TRANSFORM_FEEDBACK_BUFFER, GL_TRANSFORM_FEEDBACK_VARYING, |
| GL_UNIFORM, GL_UNIFORM_BLOCK: { |
| // version 3.1 |
| } |
| default: { |
| glErrorInvalidEnum(programInterface) |
| } |
| } |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGetProgramiv.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glGetProgramiv.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glGetProgramiv.xhtml","OpenGL ES 3.1") |
| cmd void glGetProgramiv(ProgramId program, GLenum parameter, GLint* value) { |
| minRequiredVersion(2, 0) |
| switch (parameter) { |
| case GL_ACTIVE_ATTRIBUTES, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, GL_ACTIVE_UNIFORMS, |
| GL_ACTIVE_UNIFORM_MAX_LENGTH, GL_ATTACHED_SHADERS, GL_DELETE_STATUS, GL_INFO_LOG_LENGTH, |
| GL_LINK_STATUS, GL_VALIDATE_STATUS: { |
| // version 2.0 |
| } |
| case GL_ACTIVE_UNIFORM_BLOCKS, GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH, |
| GL_PROGRAM_BINARY_RETRIEVABLE_HINT, GL_TRANSFORM_FEEDBACK_BUFFER_MODE, |
| GL_TRANSFORM_FEEDBACK_VARYINGS, GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH: { |
| minRequiredVersion(3, 0) |
| } |
| case GL_ACTIVE_ATOMIC_COUNTER_BUFFERS, GL_COMPUTE_WORK_GROUP_SIZE, GL_PROGRAM_SEPARABLE: { |
| minRequiredVersion(3, 1) |
| } |
| default: { |
| glErrorInvalidEnum(parameter) |
| } |
| } |
| |
| value[0] = ? |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGetShaderInfoLog.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glGetShaderInfoLog.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glGetShaderInfoLog.xhtml","OpenGL ES 3.1") |
| cmd void glGetShaderInfoLog(ShaderId shader, |
| GLsizei buffer_length, |
| GLsizei* string_length_written, |
| GLchar* info) { |
| minRequiredVersion(2, 0) |
| |
| ctx := GetContext() |
| s := ctx.Instances.Shaders[shader] |
| l := min(as!s32(buffer_length), as!s32(len(s.InfoLog))) |
| copy(info[0:l], s.InfoLog[0:l]) |
| string_length_written[0] = as!GLsizei(l) |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGetShaderPrecisionFormat.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glGetShaderPrecisionFormat.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glGetShaderPrecisionFormat.xhtml","OpenGL ES 3.1") |
| cmd void glGetShaderPrecisionFormat(GLenum shader_type, |
| GLenum precision_type, |
| GLint* range, |
| GLint* precision) { |
| minRequiredVersion(2, 0) |
| switch (shader_type) { |
| case GL_FRAGMENT_SHADER, GL_VERTEX_SHADER: { |
| // version 2.0 |
| } |
| default: { |
| glErrorInvalidEnum(shader_type) |
| } |
| } |
| switch (precision_type) { |
| case GL_HIGH_FLOAT, GL_HIGH_INT, GL_LOW_FLOAT, GL_LOW_INT, GL_MEDIUM_FLOAT, GL_MEDIUM_INT: { |
| // version 2.0 |
| } |
| default: { |
| glErrorInvalidEnum(precision_type) |
| } |
| } |
| |
| write(range[0:2]) |
| precision[0] = ? |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGetShaderSource.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glGetShaderSource.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glGetShaderSource.xhtml","OpenGL ES 3.1") |
| cmd void glGetShaderSource(ShaderId shader, |
| GLsizei buffer_length, |
| GLsizei* string_length_written, |
| GLchar* source) { |
| minRequiredVersion(2, 0) |
| |
| ctx := GetContext() |
| s := ctx.Instances.Shaders[shader] |
| l := min(as!s32(buffer_length), as!s32(len(s.Source))) |
| copy(as!char*(source)[0:l], as!char[](s.Source)[0:l]) |
| string_length_written[0] = as!GLsizei(l) |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGetShaderiv.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glGetShaderiv.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glGetShaderiv.xhtml","OpenGL ES 3.1") |
| cmd void glGetShaderiv(ShaderId shader, GLenum parameter, GLint* value) { |
| minRequiredVersion(2, 0) |
| switch (parameter) { |
| case GL_COMPILE_STATUS, GL_DELETE_STATUS, GL_INFO_LOG_LENGTH, GL_SHADER_SOURCE_LENGTH, |
| GL_SHADER_TYPE: { |
| // version 2.0 |
| } |
| default: { |
| glErrorInvalidEnum(parameter) |
| } |
| } |
| |
| ctx := GetContext() |
| s := ctx.Instances.Shaders[shader] |
| value[0] = switch (parameter) { |
| case GL_SHADER_TYPE: as!GLint(s.Type) |
| case GL_DELETE_STATUS: switch (s.Deletable) { case true: 1 case false: 0 } |
| case GL_COMPILE_STATUS: switch (s.Compiled) { case true: 1 case false: 0 } |
| case GL_INFO_LOG_LENGTH: as!GLint(len(s.InfoLog)) |
| case GL_SHADER_SOURCE_LENGTH: as!GLint(len(s.Source)) |
| } |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glGetUniformBlockIndex.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glGetUniformBlockIndex.xhtml","OpenGL ES 3.1") |
| cmd UniformBlockId glGetUniformBlockIndex(ProgramId program, const GLchar* uniformBlockName) { |
| minRequiredVersion(3, 0) |
| // TODO |
| return ? |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glGetUniformIndices.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glGetUniformIndices.xhtml","OpenGL ES 3.1") |
| cmd void glGetUniformIndices(ProgramId program, |
| GLsizei uniformCount, |
| const GLchar* const* uniformNames, |
| GLuint* uniformIndices) { |
| minRequiredVersion(3, 0) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGetUniformLocation.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glGetUniformLocation.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glGetUniformLocation.xhtml","OpenGL ES 3.1") |
| cmd UniformLocation glGetUniformLocation(ProgramId program, string name) { |
| minRequiredVersion(2, 0) |
| |
| return ? |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGetUniform.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glGetUniform.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glGetUniform.xhtml","OpenGL ES 3.1") |
| cmd void glGetUniformfv(ProgramId program, UniformLocation location, GLfloat* values) { |
| minRequiredVersion(2, 0) |
| |
| // p := Instances.Programs[program] |
| // uniform := p.Uniforms[location] |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGetUniform.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glGetUniform.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glGetUniform.xhtml","OpenGL ES 3.1") |
| cmd void glGetUniformiv(ProgramId program, UniformLocation location, GLint* values) { |
| minRequiredVersion(2, 0) |
| |
| // p := Instances.Programs[program] |
| // uniform := p.Uniforms[location] |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glGetUniform.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glGetUniform.xhtml","OpenGL ES 3.1") |
| cmd void glGetUniformuiv(ProgramId program, UniformLocation location, GLuint* params) { |
| minRequiredVersion(3, 0) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glIsProgram.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glIsProgram.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glIsProgram.xhtml","OpenGL ES 3.1") |
| cmd GLboolean glIsProgram(ProgramId program) { |
| minRequiredVersion(2, 0) |
| |
| ctx := GetContext() |
| return as!GLboolean(program in ctx.Instances.Programs) |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glIsProgramPipeline.xhtml","OpenGL ES 3.1") |
| cmd GLboolean glIsProgramPipeline(PipelineId pipeline) { |
| minRequiredVersion(3, 1) |
| // TODO |
| return ? |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glIsShader.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glIsShader.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glIsShader.xhtml","OpenGL ES 3.1") |
| cmd GLboolean glIsShader(ShaderId shader) { |
| minRequiredVersion(2, 0) |
| |
| ctx := GetContext() |
| return as!GLboolean(shader in ctx.Instances.Shaders) |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glLinkProgram.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glLinkProgram.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glLinkProgram.xhtml","OpenGL ES 3.1") |
| cmd void glLinkProgram(ProgramId program) { |
| minRequiredVersion(2, 0) |
| |
| //for s in (program.Shaders) { |
| // TODO: use(s.Binary) |
| //} |
| // TODO: program.Binary < ? |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glMemoryBarrier.xhtml","OpenGL ES 3.1") |
| cmd void glMemoryBarrier(GLbitfield barriers) { |
| minRequiredVersion(3, 1) |
| supportsBits(barriers, GL_ALL_BARRIER_BITS | GL_ATOMIC_COUNTER_BARRIER_BIT | GL_BUFFER_UPDATE_BARRIER_BIT | GL_COMMAND_BARRIER_BIT | GL_ELEMENT_ARRAY_BARRIER_BIT | GL_FRAMEBUFFER_BARRIER_BIT | GL_PIXEL_BUFFER_BARRIER_BIT | GL_SHADER_IMAGE_ACCESS_BARRIER_BIT | GL_SHADER_STORAGE_BARRIER_BIT | GL_TEXTURE_FETCH_BARRIER_BIT | GL_TEXTURE_UPDATE_BARRIER_BIT | GL_TRANSFORM_FEEDBACK_BARRIER_BIT | GL_UNIFORM_BARRIER_BIT | GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT) |
| if (GL_ALL_BARRIER_BITS in barriers) { |
| } |
| if (GL_ATOMIC_COUNTER_BARRIER_BIT in barriers) { |
| } |
| if (GL_BUFFER_UPDATE_BARRIER_BIT in barriers) { |
| } |
| if (GL_COMMAND_BARRIER_BIT in barriers) { |
| } |
| if (GL_ELEMENT_ARRAY_BARRIER_BIT in barriers) { |
| } |
| if (GL_FRAMEBUFFER_BARRIER_BIT in barriers) { |
| } |
| if (GL_PIXEL_BUFFER_BARRIER_BIT in barriers) { |
| } |
| if (GL_SHADER_IMAGE_ACCESS_BARRIER_BIT in barriers) { |
| } |
| if (GL_SHADER_STORAGE_BARRIER_BIT in barriers) { |
| } |
| if (GL_TEXTURE_FETCH_BARRIER_BIT in barriers) { |
| } |
| if (GL_TEXTURE_UPDATE_BARRIER_BIT in barriers) { |
| } |
| if (GL_TRANSFORM_FEEDBACK_BARRIER_BIT in barriers) { |
| } |
| if (GL_UNIFORM_BARRIER_BIT in barriers) { |
| } |
| if (GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT in barriers) { |
| } |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glMemoryBarrier.xhtml","OpenGL ES 3.1") |
| cmd void glMemoryBarrierByRegion(GLbitfield barriers) { |
| minRequiredVersion(3, 1) |
| supportsBits(barriers, GL_ALL_BARRIER_BITS | GL_ATOMIC_COUNTER_BARRIER_BIT | GL_BUFFER_UPDATE_BARRIER_BIT | GL_COMMAND_BARRIER_BIT | GL_ELEMENT_ARRAY_BARRIER_BIT | GL_FRAMEBUFFER_BARRIER_BIT | GL_PIXEL_BUFFER_BARRIER_BIT | GL_SHADER_IMAGE_ACCESS_BARRIER_BIT | GL_SHADER_STORAGE_BARRIER_BIT | GL_TEXTURE_FETCH_BARRIER_BIT | GL_TEXTURE_UPDATE_BARRIER_BIT | GL_TRANSFORM_FEEDBACK_BARRIER_BIT | GL_UNIFORM_BARRIER_BIT | GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT) |
| if (GL_ALL_BARRIER_BITS in barriers) { |
| } |
| if (GL_ATOMIC_COUNTER_BARRIER_BIT in barriers) { |
| } |
| if (GL_BUFFER_UPDATE_BARRIER_BIT in barriers) { |
| } |
| if (GL_COMMAND_BARRIER_BIT in barriers) { |
| } |
| if (GL_ELEMENT_ARRAY_BARRIER_BIT in barriers) { |
| } |
| if (GL_FRAMEBUFFER_BARRIER_BIT in barriers) { |
| } |
| if (GL_PIXEL_BUFFER_BARRIER_BIT in barriers) { |
| } |
| if (GL_SHADER_IMAGE_ACCESS_BARRIER_BIT in barriers) { |
| } |
| if (GL_SHADER_STORAGE_BARRIER_BIT in barriers) { |
| } |
| if (GL_TEXTURE_FETCH_BARRIER_BIT in barriers) { |
| } |
| if (GL_TEXTURE_UPDATE_BARRIER_BIT in barriers) { |
| } |
| if (GL_TRANSFORM_FEEDBACK_BARRIER_BIT in barriers) { |
| } |
| if (GL_UNIFORM_BARRIER_BIT in barriers) { |
| } |
| if (GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT in barriers) { |
| } |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glProgramBinary.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glProgramBinary.xhtml","OpenGL ES 3.1") |
| cmd void glProgramBinary(ProgramId program, |
| GLenum binaryFormat, |
| const void* binary, |
| GLsizei length) { |
| minRequiredVersion(3, 0) |
| switch (binaryFormat) { |
| default: { |
| glErrorInvalidEnum(binaryFormat) |
| } |
| } |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glProgramParameteri.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glProgramParameteri.xhtml","OpenGL ES 3.1") |
| cmd void glProgramParameteri(ProgramId program, GLenum pname, GLint value) { |
| minRequiredVersion(3, 0) |
| switch (pname) { |
| case GL_PROGRAM_BINARY_RETRIEVABLE_HINT: { |
| // version 3.0 |
| } |
| case GL_PROGRAM_SEPARABLE: { |
| minRequiredVersion(3, 1) |
| } |
| default: { |
| glErrorInvalidEnum(pname) |
| } |
| } |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glProgramUniform.xhtml","OpenGL ES 3.1") |
| cmd void glProgramUniform1f(ProgramId program, UniformLocation location, GLfloat v0) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glProgramUniform.xhtml","OpenGL ES 3.1") |
| cmd void glProgramUniform1fv(ProgramId program, |
| UniformLocation location, |
| GLsizei count, |
| const GLfloat* value) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glProgramUniform.xhtml","OpenGL ES 3.1") |
| cmd void glProgramUniform1i(ProgramId program, UniformLocation location, GLint v0) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glProgramUniform.xhtml","OpenGL ES 3.1") |
| cmd void glProgramUniform1iv(ProgramId program, |
| UniformLocation location, |
| GLsizei count, |
| const GLint* value) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glProgramUniform.xhtml","OpenGL ES 3.1") |
| cmd void glProgramUniform1ui(ProgramId program, UniformLocation location, GLuint v0) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glProgramUniform.xhtml","OpenGL ES 3.1") |
| cmd void glProgramUniform1uiv(ProgramId program, |
| UniformLocation location, |
| GLsizei count, |
| const GLuint* value) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glProgramUniform.xhtml","OpenGL ES 3.1") |
| cmd void glProgramUniform2f(ProgramId program, UniformLocation location, GLfloat v0, GLfloat v1) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glProgramUniform.xhtml","OpenGL ES 3.1") |
| cmd void glProgramUniform2fv(ProgramId program, |
| UniformLocation location, |
| GLsizei count, |
| const GLfloat* value) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glProgramUniform.xhtml","OpenGL ES 3.1") |
| cmd void glProgramUniform2i(ProgramId program, UniformLocation location, GLint v0, GLint v1) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glProgramUniform.xhtml","OpenGL ES 3.1") |
| cmd void glProgramUniform2iv(ProgramId program, |
| UniformLocation location, |
| GLsizei count, |
| const GLint* value) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glProgramUniform.xhtml","OpenGL ES 3.1") |
| cmd void glProgramUniform2ui(ProgramId program, UniformLocation location, GLuint v0, GLuint v1) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glProgramUniform.xhtml","OpenGL ES 3.1") |
| cmd void glProgramUniform2uiv(ProgramId program, |
| UniformLocation location, |
| GLsizei count, |
| const GLuint* value) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glProgramUniform.xhtml","OpenGL ES 3.1") |
| cmd void glProgramUniform3f(ProgramId program, |
| UniformLocation location, |
| GLfloat v0, |
| GLfloat v1, |
| GLfloat v2) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glProgramUniform.xhtml","OpenGL ES 3.1") |
| cmd void glProgramUniform3fv(ProgramId program, |
| UniformLocation location, |
| GLsizei count, |
| const GLfloat* value) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glProgramUniform.xhtml","OpenGL ES 3.1") |
| cmd void glProgramUniform3i(ProgramId program, |
| UniformLocation location, |
| GLint v0, |
| GLint v1, |
| GLint v2) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glProgramUniform.xhtml","OpenGL ES 3.1") |
| cmd void glProgramUniform3iv(ProgramId program, |
| UniformLocation location, |
| GLsizei count, |
| const GLint* value) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glProgramUniform.xhtml","OpenGL ES 3.1") |
| cmd void glProgramUniform3ui(ProgramId program, |
| UniformLocation location, |
| GLuint v0, |
| GLuint v1, |
| GLuint v2) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glProgramUniform.xhtml","OpenGL ES 3.1") |
| cmd void glProgramUniform3uiv(ProgramId program, |
| UniformLocation location, |
| GLsizei count, |
| const GLuint* value) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glProgramUniform.xhtml","OpenGL ES 3.1") |
| cmd void glProgramUniform4f(ProgramId program, |
| UniformLocation location, |
| GLfloat v0, |
| GLfloat v1, |
| GLfloat v2, |
| GLfloat v3) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glProgramUniform.xhtml","OpenGL ES 3.1") |
| cmd void glProgramUniform4fv(ProgramId program, |
| UniformLocation location, |
| GLsizei count, |
| const GLfloat* value) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glProgramUniform.xhtml","OpenGL ES 3.1") |
| cmd void glProgramUniform4i(ProgramId program, |
| UniformLocation location, |
| GLint v0, |
| GLint v1, |
| GLint v2, |
| GLint v3) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glProgramUniform.xhtml","OpenGL ES 3.1") |
| cmd void glProgramUniform4iv(ProgramId program, |
| UniformLocation location, |
| GLsizei count, |
| const GLint* value) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glProgramUniform.xhtml","OpenGL ES 3.1") |
| cmd void glProgramUniform4ui(ProgramId program, |
| UniformLocation location, |
| GLuint v0, |
| GLuint v1, |
| GLuint v2, |
| GLuint v3) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glProgramUniform.xhtml","OpenGL ES 3.1") |
| cmd void glProgramUniform4uiv(ProgramId program, |
| UniformLocation location, |
| GLsizei count, |
| const GLuint* value) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glProgramUniform.xhtml","OpenGL ES 3.1") |
| cmd void glProgramUniformMatrix2fv(ProgramId program, |
| UniformLocation location, |
| GLsizei count, |
| GLboolean transpose, |
| const GLfloat* value) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glProgramUniform.xhtml","OpenGL ES 3.1") |
| cmd void glProgramUniformMatrix2x3fv(ProgramId program, |
| UniformLocation location, |
| GLsizei count, |
| GLboolean transpose, |
| const GLfloat* value) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glProgramUniform.xhtml","OpenGL ES 3.1") |
| cmd void glProgramUniformMatrix2x4fv(ProgramId program, |
| UniformLocation location, |
| GLsizei count, |
| GLboolean transpose, |
| const GLfloat* value) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glProgramUniform.xhtml","OpenGL ES 3.1") |
| cmd void glProgramUniformMatrix3fv(ProgramId program, |
| UniformLocation location, |
| GLsizei count, |
| GLboolean transpose, |
| const GLfloat* value) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glProgramUniform.xhtml","OpenGL ES 3.1") |
| cmd void glProgramUniformMatrix3x2fv(ProgramId program, |
| UniformLocation location, |
| GLsizei count, |
| GLboolean transpose, |
| const GLfloat* value) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glProgramUniform.xhtml","OpenGL ES 3.1") |
| cmd void glProgramUniformMatrix3x4fv(ProgramId program, |
| UniformLocation location, |
| GLsizei count, |
| GLboolean transpose, |
| const GLfloat* value) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glProgramUniform.xhtml","OpenGL ES 3.1") |
| cmd void glProgramUniformMatrix4fv(ProgramId program, |
| UniformLocation location, |
| GLsizei count, |
| GLboolean transpose, |
| const GLfloat* value) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glProgramUniform.xhtml","OpenGL ES 3.1") |
| cmd void glProgramUniformMatrix4x2fv(ProgramId program, |
| UniformLocation location, |
| GLsizei count, |
| GLboolean transpose, |
| const GLfloat* value) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glProgramUniform.xhtml","OpenGL ES 3.1") |
| cmd void glProgramUniformMatrix4x3fv(ProgramId program, |
| UniformLocation location, |
| GLsizei count, |
| GLboolean transpose, |
| const GLfloat* value) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glReleaseShaderCompiler.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glReleaseShaderCompiler.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glReleaseShaderCompiler.xhtml","OpenGL ES 3.1") |
| cmd void glReleaseShaderCompiler() { |
| minRequiredVersion(2, 0) |
| |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glShaderBinary.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glShaderBinary.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glShaderBinary.xhtml","OpenGL ES 3.1") |
| cmd void glShaderBinary(GLsizei count, |
| const ShaderId* shaders, |
| GLenum binary_format, |
| const void* binary, |
| GLsizei binary_size) { |
| minRequiredVersion(2, 0) |
| switch (binary_format) { |
| default: { |
| glErrorInvalidEnum(binary_format) |
| } |
| } |
| |
| for i in (0 .. count) { |
| // TODO: shaders[i].Binary = ? |
| } |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glShaderSource.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glShaderSource.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glShaderSource.xhtml","OpenGL ES 3.1") |
| cmd void glShaderSource(ShaderId shader, |
| GLsizei count, |
| const GLchar* const* source, |
| const GLint* length) { |
| minRequiredVersion(2, 0) |
| |
| sources := source[0:count] |
| lengths := length[0:count] |
| ctx := GetContext() |
| s := ctx.Instances.Shaders[shader] |
| for i in (0 .. count) { |
| str := switch ((length == null) || (lengths[i] < 0)) { |
| case true: as!string(as!char*(sources[i])) |
| case false: as!string(as!char*(sources[i])[0:lengths[i]]) |
| } |
| // TODO: We should have a newline between sources to avoid unintentional |
| // concatenation. The language currently does not support string literals. |
| s.Source += str |
| } |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glUniform.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glUniform.xhtml","OpenGL ES 3.1") |
| cmd void glUniform1f(UniformLocation location, GLfloat value) { |
| minRequiredVersion(2, 0) |
| |
| ctx := GetContext() |
| v := make!GLfloat(1) |
| v[0] = value |
| program := ctx.Instances.Programs[ctx.BoundProgram] |
| uniform := program.Uniforms[location] |
| uniform.Type = GL_FLOAT |
| uniform.Value = as!u8[](v) |
| program.Uniforms[location] = uniform |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glUniform.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glUniform.xhtml","OpenGL ES 3.1") |
| cmd void glUniform1fv(UniformLocation location, GLsizei count, const GLfloat* values) { |
| minRequiredVersion(2, 0) |
| |
| ctx := GetContext() |
| v := values[0:count] |
| program := ctx.Instances.Programs[ctx.BoundProgram] |
| uniform := program.Uniforms[location] |
| uniform.Type = GL_FLOAT |
| uniform.Value = clone(as!u8[](v)) |
| program.Uniforms[location] = uniform |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glUniform.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glUniform.xhtml","OpenGL ES 3.1") |
| cmd void glUniform1i(UniformLocation location, GLint value) { |
| minRequiredVersion(2, 0) |
| |
| ctx := GetContext() |
| v := make!GLint(1) |
| v[0] = value |
| program := ctx.Instances.Programs[ctx.BoundProgram] |
| uniform := program.Uniforms[location] |
| uniform.Type = GL_INT |
| uniform.Value = as!u8[](v) |
| program.Uniforms[location] = uniform |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glUniform.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glUniform.xhtml","OpenGL ES 3.1") |
| cmd void glUniform1iv(UniformLocation location, GLsizei count, const GLint* values) { |
| minRequiredVersion(2, 0) |
| |
| ctx := GetContext() |
| v := values[0:count] |
| program := ctx.Instances.Programs[ctx.BoundProgram] |
| uniform := program.Uniforms[location] |
| uniform.Type = GL_INT |
| uniform.Value = clone(as!u8[](v)) |
| program.Uniforms[location] = uniform |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glUniform.xhtml","OpenGL ES 3.1") |
| cmd void glUniform1ui(UniformLocation location, GLuint v0) { |
| minRequiredVersion(3, 0) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glUniform.xhtml","OpenGL ES 3.1") |
| cmd void glUniform1uiv(UniformLocation location, GLsizei count, const GLuint* value) { |
| minRequiredVersion(3, 0) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glUniform.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glUniform.xhtml","OpenGL ES 3.1") |
| cmd void glUniform2f(UniformLocation location, GLfloat value0, GLfloat value1) { |
| minRequiredVersion(2, 0) |
| |
| ctx := GetContext() |
| v := make!Vec2f(1) |
| v[0] = Vec2f(value0, value1) |
| program := ctx.Instances.Programs[ctx.BoundProgram] |
| uniform := program.Uniforms[location] |
| uniform.Type = GL_FLOAT_VEC2 |
| uniform.Value = as!u8[](v) |
| program.Uniforms[location] = uniform |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glUniform.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glUniform.xhtml","OpenGL ES 3.1") |
| cmd void glUniform2fv(UniformLocation location, GLsizei count, const GLfloat* values) { |
| minRequiredVersion(2, 0) |
| |
| ctx := GetContext() |
| v := as!Vec2f*(values)[0:count] |
| program := ctx.Instances.Programs[ctx.BoundProgram] |
| uniform := program.Uniforms[location] |
| uniform.Type = GL_FLOAT_VEC2 |
| uniform.Value = clone(as!u8[](v)) |
| program.Uniforms[location] = uniform |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glUniform.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glUniform.xhtml","OpenGL ES 3.1") |
| cmd void glUniform2i(UniformLocation location, GLint value0, GLint value1) { |
| minRequiredVersion(2, 0) |
| |
| ctx := GetContext() |
| v := make!Vec2i(1) |
| v[0] = Vec2i(value0, value1) |
| program := ctx.Instances.Programs[ctx.BoundProgram] |
| uniform := program.Uniforms[location] |
| uniform.Type = GL_INT_VEC2 |
| uniform.Value = as!u8[](v) |
| program.Uniforms[location] = uniform |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glUniform.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glUniform.xhtml","OpenGL ES 3.1") |
| cmd void glUniform2iv(UniformLocation location, GLsizei count, const GLint* values) { |
| minRequiredVersion(2, 0) |
| |
| ctx := GetContext() |
| v := as!Vec2i*(values)[0:count] |
| program := ctx.Instances.Programs[ctx.BoundProgram] |
| uniform := program.Uniforms[location] |
| uniform.Type = GL_INT_VEC2 |
| uniform.Value = clone(as!u8[](v)) |
| program.Uniforms[location] = uniform |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glUniform.xhtml","OpenGL ES 3.1") |
| cmd void glUniform2ui(UniformLocation location, GLuint v0, GLuint v1) { |
| minRequiredVersion(3, 0) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glUniform.xhtml","OpenGL ES 3.1") |
| cmd void glUniform2uiv(UniformLocation location, GLsizei count, const GLuint* value) { |
| minRequiredVersion(3, 0) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glUniform.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glUniform.xhtml","OpenGL ES 3.1") |
| cmd void glUniform3f(UniformLocation location, GLfloat value0, GLfloat value1, GLfloat value2) { |
| minRequiredVersion(2, 0) |
| |
| ctx := GetContext() |
| v := make!Vec3f(1) |
| v[0] = Vec3f(value0, value1, value2) |
| program := ctx.Instances.Programs[ctx.BoundProgram] |
| uniform := program.Uniforms[location] |
| uniform.Type = GL_FLOAT_VEC3 |
| uniform.Value = as!u8[](v) |
| program.Uniforms[location] = uniform |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glUniform.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glUniform.xhtml","OpenGL ES 3.1") |
| cmd void glUniform3fv(UniformLocation location, GLsizei count, const GLfloat* values) { |
| minRequiredVersion(2, 0) |
| |
| ctx := GetContext() |
| v := as!Vec3f*(values)[0:count] |
| program := ctx.Instances.Programs[ctx.BoundProgram] |
| uniform := program.Uniforms[location] |
| uniform.Type = GL_FLOAT_VEC3 |
| uniform.Value = clone(as!u8[](v)) |
| program.Uniforms[location] = uniform |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glUniform.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glUniform.xhtml","OpenGL ES 3.1") |
| cmd void glUniform3i(UniformLocation location, GLint value0, GLint value1, GLint value2) { |
| minRequiredVersion(2, 0) |
| |
| ctx := GetContext() |
| v := make!Vec3i(1) |
| v[0] = Vec3i(value0, value1, value2) |
| program := ctx.Instances.Programs[ctx.BoundProgram] |
| uniform := program.Uniforms[location] |
| uniform.Type = GL_INT_VEC3 |
| uniform.Value = as!u8[](v) |
| program.Uniforms[location] = uniform |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glUniform.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glUniform.xhtml","OpenGL ES 3.1") |
| cmd void glUniform3iv(UniformLocation location, GLsizei count, const GLint* values) { |
| minRequiredVersion(2, 0) |
| |
| ctx := GetContext() |
| v := as!Vec3i*(values)[0:count] |
| program := ctx.Instances.Programs[ctx.BoundProgram] |
| uniform := program.Uniforms[location] |
| uniform.Type = GL_INT_VEC3 |
| uniform.Value = clone(as!u8[](v)) |
| program.Uniforms[location] = uniform |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glUniform.xhtml","OpenGL ES 3.1") |
| cmd void glUniform3ui(UniformLocation location, GLuint v0, GLuint v1, GLuint v2) { |
| minRequiredVersion(3, 0) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glUniform.xhtml","OpenGL ES 3.1") |
| cmd void glUniform3uiv(UniformLocation location, GLsizei count, const GLuint* value) { |
| minRequiredVersion(3, 0) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glUniform.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glUniform.xhtml","OpenGL ES 3.1") |
| cmd void glUniform4f(UniformLocation location, |
| GLfloat value0, |
| GLfloat value1, |
| GLfloat value2, |
| GLfloat value3) { |
| minRequiredVersion(2, 0) |
| |
| ctx := GetContext() |
| v := make!Vec4f(1) |
| v[0] = Vec4f(value0, value1, value2, value3) |
| program := ctx.Instances.Programs[ctx.BoundProgram] |
| uniform := program.Uniforms[location] |
| uniform.Type = GL_FLOAT_VEC4 |
| uniform.Value = as!u8[](v) |
| program.Uniforms[location] = uniform |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glUniform.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glUniform.xhtml","OpenGL ES 3.1") |
| cmd void glUniform4fv(UniformLocation location, GLsizei count, const GLfloat* values) { |
| minRequiredVersion(2, 0) |
| |
| ctx := GetContext() |
| v := as!Vec4f*(values)[0:count] |
| program := ctx.Instances.Programs[ctx.BoundProgram] |
| uniform := program.Uniforms[location] |
| uniform.Type = GL_FLOAT_VEC4 |
| uniform.Value = clone(as!u8[](v)) |
| program.Uniforms[location] = uniform |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glUniform.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glUniform.xhtml","OpenGL ES 3.1") |
| cmd void glUniform4i(UniformLocation location, |
| GLint value0, |
| GLint value1, |
| GLint value2, |
| GLint value3) { |
| minRequiredVersion(2, 0) |
| |
| ctx := GetContext() |
| v := make!Vec4i(1) |
| v[0] = Vec4i(value0, value1, value2, value3) |
| program := ctx.Instances.Programs[ctx.BoundProgram] |
| uniform := program.Uniforms[location] |
| uniform.Type = GL_INT_VEC4 |
| uniform.Value = as!u8[](v) |
| program.Uniforms[location] = uniform |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glUniform.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glUniform.xhtml","OpenGL ES 3.1") |
| cmd void glUniform4iv(UniformLocation location, GLsizei count, const GLint* values) { |
| minRequiredVersion(2, 0) |
| |
| ctx := GetContext() |
| v := as!Vec4i*(values)[0:count] |
| program := ctx.Instances.Programs[ctx.BoundProgram] |
| uniform := program.Uniforms[location] |
| uniform.Type = GL_INT_VEC4 |
| uniform.Value = clone(as!u8[](v)) |
| program.Uniforms[location] = uniform |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glUniform.xhtml","OpenGL ES 3.1") |
| cmd void glUniform4ui(UniformLocation location, GLuint v0, GLuint v1, GLuint v2, GLuint v3) { |
| minRequiredVersion(3, 0) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glUniform.xhtml","OpenGL ES 3.1") |
| cmd void glUniform4uiv(UniformLocation location, GLsizei count, const GLuint* value) { |
| minRequiredVersion(3, 0) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glUniformBlockBinding.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glUniformBlockBinding.xhtml","OpenGL ES 3.1") |
| cmd void glUniformBlockBinding(ProgramId program, |
| UniformBlockId uniform_block_index, |
| GLuint uniform_block_binding) { |
| minRequiredVersion(3, 0) |
| |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glUniform.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glUniform.xhtml","OpenGL ES 3.1") |
| cmd void glUniformMatrix2fv(UniformLocation location, |
| GLsizei count, |
| GLboolean transpose, |
| const GLfloat* values) { |
| minRequiredVersion(2, 0) |
| |
| ctx := GetContext() |
| v := as!Mat2f*(values)[0:count] |
| program := ctx.Instances.Programs[ctx.BoundProgram] |
| uniform := program.Uniforms[location] |
| uniform.Type = GL_FLOAT_MAT2 |
| uniform.Value = clone(as!u8[](v)) |
| program.Uniforms[location] = uniform |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glUniform.xhtml","OpenGL ES 3.1") |
| cmd void glUniformMatrix2x3fv(UniformLocation location, |
| GLsizei count, |
| GLboolean transpose, |
| const GLfloat* value) { |
| minRequiredVersion(3, 0) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glUniform.xhtml","OpenGL ES 3.1") |
| cmd void glUniformMatrix2x4fv(UniformLocation location, |
| GLsizei count, |
| GLboolean transpose, |
| const GLfloat* value) { |
| minRequiredVersion(3, 0) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glUniform.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glUniform.xhtml","OpenGL ES 3.1") |
| cmd void glUniformMatrix3fv(UniformLocation location, |
| GLsizei count, |
| GLboolean transpose, |
| const GLfloat* values) { |
| minRequiredVersion(2, 0) |
| |
| ctx := GetContext() |
| v := as!Mat3f*(values)[0:count] |
| program := ctx.Instances.Programs[ctx.BoundProgram] |
| uniform := program.Uniforms[location] |
| uniform.Type = GL_FLOAT_MAT3 |
| uniform.Value = clone(as!u8[](v)) |
| program.Uniforms[location] = uniform |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glUniform.xhtml","OpenGL ES 3.1") |
| cmd void glUniformMatrix3x2fv(UniformLocation location, |
| GLsizei count, |
| GLboolean transpose, |
| const GLfloat* value) { |
| minRequiredVersion(3, 0) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glUniform.xhtml","OpenGL ES 3.1") |
| cmd void glUniformMatrix3x4fv(UniformLocation location, |
| GLsizei count, |
| GLboolean transpose, |
| const GLfloat* value) { |
| minRequiredVersion(3, 0) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glUniform.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glUniform.xhtml","OpenGL ES 3.1") |
| cmd void glUniformMatrix4fv(UniformLocation location, |
| GLsizei count, |
| GLboolean transpose, |
| const GLfloat* values) { |
| minRequiredVersion(2, 0) |
| |
| ctx := GetContext() |
| v := as!Mat4f*(values)[0:count] |
| program := ctx.Instances.Programs[ctx.BoundProgram] |
| uniform := program.Uniforms[location] |
| uniform.Value = clone(as!u8[](v)) |
| program.Uniforms[location] = uniform |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glUniform.xhtml","OpenGL ES 3.1") |
| cmd void glUniformMatrix4x2fv(UniformLocation location, |
| GLsizei count, |
| GLboolean transpose, |
| const GLfloat* value) { |
| minRequiredVersion(3, 0) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glUniform.xhtml","OpenGL ES 3.1") |
| cmd void glUniformMatrix4x3fv(UniformLocation location, |
| GLsizei count, |
| GLboolean transpose, |
| const GLfloat* value) { |
| minRequiredVersion(3, 0) |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glUseProgram.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glUseProgram.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glUseProgram.xhtml","OpenGL ES 3.1") |
| cmd void glUseProgram(ProgramId program) { |
| minRequiredVersion(2, 0) |
| |
| ctx := GetContext() |
| ctx.BoundProgram = program |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glUseProgramStages.xhtml","OpenGL ES 3.1") |
| cmd void glUseProgramStages(PipelineId pipeline, GLbitfield stages, ProgramId program) { |
| minRequiredVersion(3, 1) |
| supportsBits(stages, GL_ALL_SHADER_BITS | GL_COMPUTE_SHADER_BIT | GL_FRAGMENT_SHADER_BIT | GL_VERTEX_SHADER_BIT) |
| if (GL_ALL_SHADER_BITS in stages) { |
| } |
| if (GL_COMPUTE_SHADER_BIT in stages) { |
| } |
| if (GL_FRAGMENT_SHADER_BIT in stages) { |
| } |
| if (GL_VERTEX_SHADER_BIT in stages) { |
| } |
| // TODO |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man/xhtml/glValidateProgram.xml","OpenGL ES 2.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man3/html/glValidateProgram.xhtml","OpenGL ES 3.0") |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glValidateProgram.xhtml","OpenGL ES 3.1") |
| cmd void glValidateProgram(ProgramId program) { |
| minRequiredVersion(2, 0) |
| |
| } |
| |
| @Doc("https://www.khronos.org/opengles/sdk/docs/man31/html/glValidateProgramPipeline.xhtml","OpenGL ES 3.1") |
| cmd void glValidateProgramPipeline(PipelineId pipeline) { |
| minRequiredVersion(3, 1) |
| // TODO |
| } |
| |