diff options
author | marha <marha@users.sourceforge.net> | 2014-03-04 12:18:13 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2014-03-04 12:23:48 +0100 |
commit | 45392e4a0642880b569ea5d4a350cdc395a2c7db (patch) | |
tree | c3c2a49de903a18c3f8e1bf79684c29337ebcf7c /mesalib/src/mesa/main/uniforms.c | |
parent | 5ec0616d4e3c4c6095f4975abbe9c21e5b6af967 (diff) | |
parent | 321c01267ae1c446f1bd22b642567fcafa016c02 (diff) | |
download | vcxsrv-45392e4a0642880b569ea5d4a350cdc395a2c7db.tar.gz vcxsrv-45392e4a0642880b569ea5d4a350cdc395a2c7db.tar.bz2 vcxsrv-45392e4a0642880b569ea5d4a350cdc395a2c7db.zip |
Merge remote-tracking branch 'origin/released'
* origin/released:
libX11 libxcb mesa xserver xcb-proto xkeyboard-config git update 4 Mar 2014
Conflicts:
mesalib/src/mapi/glapi/glapi.h
mesalib/src/mapi/glapi/glthread.c
mesalib/src/mesa/drivers/dri/common/dri_util.c
mesalib/src/mesa/main/bufferobj.c
xorg-server/dix/dispatch.c
xorg-server/hw/xwin/glx/gen_gl_wrappers.py
xorg-server/hw/xwin/winmultiwindowwm.c
Diffstat (limited to 'mesalib/src/mesa/main/uniforms.c')
-rw-r--r-- | mesalib/src/mesa/main/uniforms.c | 393 |
1 files changed, 393 insertions, 0 deletions
diff --git a/mesalib/src/mesa/main/uniforms.c b/mesalib/src/mesa/main/uniforms.c index 071d668f3..c25c2df7e 100644 --- a/mesalib/src/mesa/main/uniforms.c +++ b/mesalib/src/mesa/main/uniforms.c @@ -270,6 +270,197 @@ _mesa_Uniform4iv(GLint location, GLsizei count, const GLint * value) _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_INT_VEC4); } +/** Same as above with direct state access **/ +void GLAPIENTRY +_mesa_ProgramUniform1f(GLuint program, GLint location, GLfloat v0) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_shader_program *shProg = + _mesa_lookup_shader_program_err(ctx, program, + "glProgramUniform1f"); + _mesa_uniform(ctx, shProg, location, 1, &v0, GL_FLOAT); +} + +void GLAPIENTRY +_mesa_ProgramUniform2f(GLuint program, GLint location, GLfloat v0, GLfloat v1) +{ + GET_CURRENT_CONTEXT(ctx); + GLfloat v[2]; + struct gl_shader_program *shProg; + v[0] = v0; + v[1] = v1; + shProg = _mesa_lookup_shader_program_err(ctx, program, "glProgramUniform2f"); + _mesa_uniform(ctx, shProg, location, 1, v, GL_FLOAT_VEC2); +} + +void GLAPIENTRY +_mesa_ProgramUniform3f(GLuint program, GLint location, GLfloat v0, GLfloat v1, + GLfloat v2) +{ + GET_CURRENT_CONTEXT(ctx); + GLfloat v[3]; + struct gl_shader_program *shProg; + v[0] = v0; + v[1] = v1; + v[2] = v2; + shProg = _mesa_lookup_shader_program_err(ctx, program, "glProgramUniform3f"); + _mesa_uniform(ctx, shProg, location, 1, v, GL_FLOAT_VEC3); +} + +void GLAPIENTRY +_mesa_ProgramUniform4f(GLuint program, GLint location, GLfloat v0, GLfloat v1, + GLfloat v2, GLfloat v3) +{ + GET_CURRENT_CONTEXT(ctx); + GLfloat v[4]; + struct gl_shader_program *shProg; + v[0] = v0; + v[1] = v1; + v[2] = v2; + v[3] = v3; + shProg = _mesa_lookup_shader_program_err(ctx, program, "glProgramUniform4f"); + _mesa_uniform(ctx, shProg, location, 1, v, GL_FLOAT_VEC4); +} + +void GLAPIENTRY +_mesa_ProgramUniform1i(GLuint program, GLint location, GLint v0) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_shader_program *shProg = + _mesa_lookup_shader_program_err(ctx, program, + "glProgramUniform1i"); + _mesa_uniform(ctx, shProg, location, 1, &v0, GL_INT); +} + +void GLAPIENTRY +_mesa_ProgramUniform2i(GLuint program, GLint location, GLint v0, GLint v1) +{ + GET_CURRENT_CONTEXT(ctx); + GLint v[2]; + struct gl_shader_program *shProg; + v[0] = v0; + v[1] = v1; + shProg = _mesa_lookup_shader_program_err(ctx, program, "glProgramUniform2i"); + _mesa_uniform(ctx, shProg, location, 1, v, GL_INT_VEC2); +} + +void GLAPIENTRY +_mesa_ProgramUniform3i(GLuint program, GLint location, GLint v0, GLint v1, + GLint v2) +{ + GET_CURRENT_CONTEXT(ctx); + GLint v[3]; + struct gl_shader_program *shProg; + v[0] = v0; + v[1] = v1; + v[2] = v2; + shProg = _mesa_lookup_shader_program_err(ctx, program, "glProgramUniform3i"); + _mesa_uniform(ctx, shProg, location, 1, v, GL_INT_VEC3); +} + +void GLAPIENTRY +_mesa_ProgramUniform4i(GLuint program, GLint location, GLint v0, GLint v1, + GLint v2, GLint v3) +{ + GET_CURRENT_CONTEXT(ctx); + GLint v[4]; + struct gl_shader_program *shProg; + v[0] = v0; + v[1] = v1; + v[2] = v2; + v[3] = v3; + shProg = _mesa_lookup_shader_program_err(ctx, program, "glProgramUniform4i"); + _mesa_uniform(ctx, shProg, location, 1, v, GL_INT_VEC4); +} + +void GLAPIENTRY +_mesa_ProgramUniform1fv(GLuint program, GLint location, GLsizei count, + const GLfloat * value) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_shader_program *shProg = + _mesa_lookup_shader_program_err(ctx, program, + "glProgramUniform1fv"); + _mesa_uniform(ctx, shProg, location, count, value, GL_FLOAT); +} + +void GLAPIENTRY +_mesa_ProgramUniform2fv(GLuint program, GLint location, GLsizei count, + const GLfloat * value) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_shader_program *shProg = + _mesa_lookup_shader_program_err(ctx, program, + "glProgramUniform2fv"); + _mesa_uniform(ctx, shProg, location, count, value, GL_FLOAT_VEC2); +} + +void GLAPIENTRY +_mesa_ProgramUniform3fv(GLuint program, GLint location, GLsizei count, + const GLfloat * value) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_shader_program *shProg = + _mesa_lookup_shader_program_err(ctx, program, + "glProgramUniform3fv"); + _mesa_uniform(ctx, shProg, location, count, value, GL_FLOAT_VEC3); +} + +void GLAPIENTRY +_mesa_ProgramUniform4fv(GLuint program, GLint location, GLsizei count, + const GLfloat * value) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_shader_program *shProg = + _mesa_lookup_shader_program_err(ctx, program, + "glProgramUniform4fv"); + _mesa_uniform(ctx, shProg, location, count, value, GL_FLOAT_VEC4); +} + +void GLAPIENTRY +_mesa_ProgramUniform1iv(GLuint program, GLint location, GLsizei count, + const GLint * value) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_shader_program *shProg = + _mesa_lookup_shader_program_err(ctx, program, + "glProgramUniform1iv"); + _mesa_uniform(ctx, shProg, location, count, value, GL_INT); +} + +void GLAPIENTRY +_mesa_ProgramUniform2iv(GLuint program, GLint location, GLsizei count, + const GLint * value) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_shader_program *shProg = + _mesa_lookup_shader_program_err(ctx, program, + "glProgramUniform2iv"); + _mesa_uniform(ctx, shProg, location, count, value, GL_INT_VEC2); +} + +void GLAPIENTRY +_mesa_ProgramUniform3iv(GLuint program, GLint location, GLsizei count, + const GLint * value) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_shader_program *shProg = + _mesa_lookup_shader_program_err(ctx, program, + "glProgramUniform3iv"); + _mesa_uniform(ctx, shProg, location, count, value, GL_INT_VEC3); +} + +void GLAPIENTRY +_mesa_ProgramUniform4iv(GLuint program, GLint location, GLsizei count, + const GLint * value) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_shader_program *shProg = + _mesa_lookup_shader_program_err(ctx, program, + "glProgramUniform4iv"); + _mesa_uniform(ctx, shProg, location, count, value, GL_INT_VEC4); +} + /** OpenGL 3.0 GLuint-valued functions **/ void GLAPIENTRY @@ -369,6 +560,140 @@ _mesa_UniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, 4, 4, location, count, transpose, value); } +/** Same as above with direct state access **/ + +void GLAPIENTRY +_mesa_ProgramUniform1ui(GLuint program, GLint location, GLuint v0) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_shader_program *shProg = + _mesa_lookup_shader_program_err(ctx, program, + "glProgramUniform1ui"); + _mesa_uniform(ctx, shProg, location, 1, &v0, GL_UNSIGNED_INT); +} + +void GLAPIENTRY +_mesa_ProgramUniform2ui(GLuint program, GLint location, GLuint v0, GLuint v1) +{ + GET_CURRENT_CONTEXT(ctx); + GLuint v[2]; + struct gl_shader_program *shProg; + v[0] = v0; + v[1] = v1; + shProg = _mesa_lookup_shader_program_err(ctx, program, + "glProgramUniform2ui"); + _mesa_uniform(ctx, shProg, location, 1, v, GL_UNSIGNED_INT_VEC2); +} + +void GLAPIENTRY +_mesa_ProgramUniform3ui(GLuint program, GLint location, GLuint v0, GLuint v1, + GLuint v2) +{ + GET_CURRENT_CONTEXT(ctx); + GLuint v[3]; + struct gl_shader_program *shProg; + v[0] = v0; + v[1] = v1; + v[2] = v2; + shProg = _mesa_lookup_shader_program_err(ctx, program, + "glProgramUniform3ui"); + _mesa_uniform(ctx, shProg, location, 1, v, GL_UNSIGNED_INT_VEC3); +} + +void GLAPIENTRY +_mesa_ProgramUniform4ui(GLuint program, GLint location, GLuint v0, GLuint v1, + GLuint v2, GLuint v3) +{ + GET_CURRENT_CONTEXT(ctx); + GLuint v[4]; + struct gl_shader_program *shProg; + v[0] = v0; + v[1] = v1; + v[2] = v2; + v[3] = v3; + shProg = _mesa_lookup_shader_program_err(ctx, program, "glProgramUniform4ui"); + _mesa_uniform(ctx, shProg, location, 1, v, GL_UNSIGNED_INT_VEC4); +} + +void GLAPIENTRY +_mesa_ProgramUniform1uiv(GLuint program, GLint location, GLsizei count, + const GLuint *value) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_shader_program *shProg = + _mesa_lookup_shader_program_err(ctx, program, + "glProgramUniform1uiv"); + _mesa_uniform(ctx, shProg, location, count, value, GL_UNSIGNED_INT); +} + +void GLAPIENTRY +_mesa_ProgramUniform2uiv(GLuint program, GLint location, GLsizei count, + const GLuint *value) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_shader_program *shProg = + _mesa_lookup_shader_program_err(ctx, program, + "glProgramUniform2uiv"); + _mesa_uniform(ctx, shProg, location, count, value, GL_UNSIGNED_INT_VEC2); +} + +void GLAPIENTRY +_mesa_ProgramUniform3uiv(GLuint program, GLint location, GLsizei count, + const GLuint *value) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_shader_program *shProg = + _mesa_lookup_shader_program_err(ctx, program, + "glProgramUniform3uiv"); + _mesa_uniform(ctx, shProg, location, count, value, GL_UNSIGNED_INT_VEC3); +} + +void GLAPIENTRY +_mesa_ProgramUniform4uiv(GLuint program, GLint location, GLsizei count, + const GLuint *value) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_shader_program *shProg = + _mesa_lookup_shader_program_err(ctx, program, + "glProgramUniform4uiv"); + _mesa_uniform(ctx, shProg, location, count, value, GL_UNSIGNED_INT_VEC4); +} + + + +void GLAPIENTRY +_mesa_ProgramUniformMatrix2fv(GLuint program, GLint location, GLsizei count, + GLboolean transpose, const GLfloat * value) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_shader_program *shProg = + _mesa_lookup_shader_program_err(ctx, program, + "glProgramUniformMatrix2fv"); + _mesa_uniform_matrix(ctx, shProg, 2, 2, location, count, transpose, value); +} + +void GLAPIENTRY +_mesa_ProgramUniformMatrix3fv(GLuint program, GLint location, GLsizei count, + GLboolean transpose, const GLfloat * value) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_shader_program *shProg = + _mesa_lookup_shader_program_err(ctx, program, + "glProgramUniformMatrix3fv"); + _mesa_uniform_matrix(ctx, shProg, 3, 3, location, count, transpose, value); +} + +void GLAPIENTRY +_mesa_ProgramUniformMatrix4fv(GLuint program, GLint location, GLsizei count, + GLboolean transpose, const GLfloat * value) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_shader_program *shProg = + _mesa_lookup_shader_program_err(ctx, program, + "glProgramUniformMatrix4fv"); + _mesa_uniform_matrix(ctx, shProg, 4, 4, location, count, transpose, value); +} + /** * Non-square UniformMatrix are OpenGL 2.1 @@ -427,6 +752,74 @@ _mesa_UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, 4, 3, location, count, transpose, value); } +/** Same as above with direct state access **/ + +void GLAPIENTRY +_mesa_ProgramUniformMatrix2x3fv(GLuint program, GLint location, GLsizei count, + GLboolean transpose, const GLfloat * value) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_shader_program *shProg = + _mesa_lookup_shader_program_err(ctx, program, + "glProgramUniformMatrix2x3fv"); + _mesa_uniform_matrix(ctx, shProg, 2, 3, location, count, transpose, value); +} + +void GLAPIENTRY +_mesa_ProgramUniformMatrix3x2fv(GLuint program, GLint location, GLsizei count, + GLboolean transpose, const GLfloat * value) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_shader_program *shProg = + _mesa_lookup_shader_program_err(ctx, program, + "glProgramUniformMatrix3x2fv"); + _mesa_uniform_matrix(ctx, shProg, 3, 2, location, count, transpose, value); +} + +void GLAPIENTRY +_mesa_ProgramUniformMatrix2x4fv(GLuint program, GLint location, GLsizei count, + GLboolean transpose, const GLfloat * value) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_shader_program *shProg = + _mesa_lookup_shader_program_err(ctx, program, + "glProgramUniformMatrix2x4fv"); + _mesa_uniform_matrix(ctx, shProg, 2, 4, location, count, transpose, value); +} + +void GLAPIENTRY +_mesa_ProgramUniformMatrix4x2fv(GLuint program, GLint location, GLsizei count, + GLboolean transpose, const GLfloat * value) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_shader_program *shProg = + _mesa_lookup_shader_program_err(ctx, program, + "glProgramUniformMatrix4x2fv"); + _mesa_uniform_matrix(ctx, shProg, 4, 2, location, count, transpose, value); +} + +void GLAPIENTRY +_mesa_ProgramUniformMatrix3x4fv(GLuint program, GLint location, GLsizei count, + GLboolean transpose, const GLfloat * value) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_shader_program *shProg = + _mesa_lookup_shader_program_err(ctx, program, + "glProgramUniformMatrix3x4fv"); + _mesa_uniform_matrix(ctx, shProg, 3, 4, location, count, transpose, value); +} + +void GLAPIENTRY +_mesa_ProgramUniformMatrix4x3fv(GLuint program, GLint location, GLsizei count, + GLboolean transpose, const GLfloat * value) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_shader_program *shProg = + _mesa_lookup_shader_program_err(ctx, program, + "glProgramUniformMatrix4x3fv"); + _mesa_uniform_matrix(ctx, shProg, 4, 3, location, count, transpose, value); +} + void GLAPIENTRY _mesa_GetnUniformfvARB(GLhandleARB program, GLint location, |