for (i = 0; i < uni->num_driver_storage; i++) {
struct gl_uniform_driver_storage *const store = &uni->driver_storage[i];
@@ -612,6 +615,7 @@ _mesa_uniform(struct gl_context *ctx, struct
gl_shader_program *shProg,
unsigned components;
unsigned src_components;
enum glsl_base_type basicType;
+ int size_mul = 1;
struct gl_uniform_storage *const uni =
validate_uniform_parameters(ctx, shProg, location, count,
@@ -670,6 +674,26 @@ _mesa_uniform(struct gl_context *ctx, struct
gl_shader_program *shProg,
basicType = GLSL_TYPE_INT;
src_components = 4;
break;
+ case GL_DOUBLE:
+ basicType = GLSL_TYPE_DOUBLE;
+ src_components = 1;
+ size_mul = 2;
+ break;
+ case GL_DOUBLE_VEC2:
+ basicType = GLSL_TYPE_DOUBLE;
+ src_components = 2;
+ size_mul = 2;
+ break;
+ case GL_DOUBLE_VEC3:
+ basicType = GLSL_TYPE_DOUBLE;
+ src_components = 3;
+ size_mul = 2;
+ break;
+ case GL_DOUBLE_VEC4:
+ basicType = GLSL_TYPE_DOUBLE;
+ src_components = 4;
+ size_mul = 2;
+ break;
case GL_BOOL:
case GL_BOOL_VEC2:
case GL_BOOL_VEC3:
@@ -683,6 +707,15 @@ _mesa_uniform(struct gl_context *ctx, struct
gl_shader_program *shProg,
case GL_FLOAT_MAT4x2:
case GL_FLOAT_MAT4x3:
case GL_FLOAT_MAT4:
+ case GL_DOUBLE_MAT2:
+ case GL_DOUBLE_MAT2x3:
+ case GL_DOUBLE_MAT2x4:
+ case GL_DOUBLE_MAT3x2:
+ case GL_DOUBLE_MAT3:
+ case GL_DOUBLE_MAT3x4:
+ case GL_DOUBLE_MAT4x2:
+ case GL_DOUBLE_MAT4x3:
+ case GL_DOUBLE_MAT4:
default:
_mesa_problem(NULL, "Invalid type in %s", __func__);
return;
@@ -697,7 +730,7 @@ _mesa_uniform(struct gl_context *ctx, struct
gl_shader_program *shProg,
bool match;
switch (uni->type->base_type) {
case GLSL_TYPE_BOOL:
- match = true;
+ match = (basicType != GLSL_TYPE_DOUBLE);
break;
case GLSL_TYPE_SAMPLER:
case GLSL_TYPE_IMAGE:
@@ -789,7 +822,7 @@ _mesa_uniform(struct gl_context *ctx, struct
gl_shader_program *shProg,
*/
if (!uni->type->is_boolean()) {
memcpy(&uni->storage[components * offset], values,
- sizeof(uni->storage[0]) * components * count);
+ sizeof(uni->storage[0]) * components * count * size_mul);
} else {
const union gl_constant_value *src =
(const union gl_constant_value *) values;
@@ -892,13 +925,14 @@ extern "C" void
_mesa_uniform_matrix(struct gl_context *ctx, struct gl_shader_program *shProg,
GLuint cols, GLuint rows,
GLint location, GLsizei count,
- GLboolean transpose, const GLfloat *values)
+ GLboolean transpose,
+ const GLvoid *values, GLenum type)
{
unsigned offset;
unsigned vectors;
unsigned components;
unsigned elements;
-
+ int size_mul = mesa_type_is_double(type) ? 2 : 1;
struct gl_uniform_storage *const uni =
validate_uniform_parameters(ctx, shProg, location, count,
&offset, "glUniformMatrix", false);
@@ -936,7 +970,7 @@ _mesa_uniform_matrix(struct gl_context *ctx, struct
gl_shader_program *shProg,
}
if (ctx->_Shader->Flags & GLSL_UNIFORMS) {
- log_uniform(values, GLSL_TYPE_FLOAT, components, vectors, count,
+ log_uniform(values, uni->type->base_type, components, vectors, count,
bool(transpose), shProg, location, uni);
}
@@ -963,11 +997,11 @@ _mesa_uniform_matrix(struct gl_context *ctx, struct
gl_shader_program *shProg,
if (!transpose) {
memcpy(&uni->storage[elements * offset], values,
- sizeof(uni->storage[0]) * elements * count);
+ sizeof(uni->storage[0]) * elements * count * size_mul);
} else {
/* Copy and transpose the matrix.
*/
- const float *src = values;
+ const float *src = (const float *)values;
float *dst = &uni->storage[elements * offset].f;
for (int i = 0; i < count; i++) {
diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c
index 467ad06..a5df363 100644
--- a/src/mesa/main/uniforms.c
+++ b/src/mesa/main/uniforms.c
@@ -539,7 +539,7 @@ _mesa_UniformMatrix2fv(GLint location, GLsizei count,
GLboolean transpose,
{
GET_CURRENT_CONTEXT(ctx);
_mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
- 2, 2, location, count, transpose, value);
+ 2, 2, location, count, transpose, value, GL_FLOAT);
}
void GLAPIENTRY
@@ -548,7 +548,7 @@ _mesa_UniformMatrix3fv(GLint location, GLsizei count,
GLboolean transpose,
{
GET_CURRENT_CONTEXT(ctx);
_mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
- 3, 3, location, count, transpose, value);
+ 3, 3, location, count, transpose, value, GL_FLOAT);
}
void GLAPIENTRY
@@ -557,7 +557,7 @@ _mesa_UniformMatrix4fv(GLint location, GLsizei count,
GLboolean transpose,
{
GET_CURRENT_CONTEXT(ctx);
_mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
- 4, 4, location, count, transpose, value);
+ 4, 4, location, count, transpose, value, GL_FLOAT);
}
/** Same as above with direct state access **/
@@ -669,7 +669,7 @@ _mesa_ProgramUniformMatrix2fv(GLuint program, GLint
location, GLsizei count,
struct gl_shader_program *shProg =
_mesa_lookup_shader_program_err(ctx, program,
"glProgramUniformMatrix2fv");
- _mesa_uniform_matrix(ctx, shProg, 2, 2, location, count, transpose, value);
+ _mesa_uniform_matrix(ctx, shProg, 2, 2, location, count, transpose, value,
GL_FLOAT);
}
void GLAPIENTRY
@@ -680,7 +680,7 @@ _mesa_ProgramUniformMatrix3fv(GLuint program, GLint
location, GLsizei count,
struct gl_shader_program *shProg =
_mesa_lookup_shader_program_err(ctx, program,
"glProgramUniformMatrix3fv");
- _mesa_uniform_matrix(ctx, shProg, 3, 3, location, count, transpose, value);
+ _mesa_uniform_matrix(ctx, shProg, 3, 3, location, count, transpose, value,
GL_FLOAT);
}
void GLAPIENTRY
@@ -691,7 +691,7 @@ _mesa_ProgramUniformMatrix4fv(GLuint program, GLint
location, GLsizei count,
struct gl_shader_program *shProg =
_mesa_lookup_shader_program_err(ctx, program,
"glProgramUniformMatrix4fv");
- _mesa_uniform_matrix(ctx, shProg, 4, 4, location, count, transpose, value);
+ _mesa_uniform_matrix(ctx, shProg, 4, 4, location, count, transpose, value,
GL_FLOAT);
}
@@ -704,7 +704,7 @@ _mesa_UniformMatrix2x3fv(GLint location, GLsizei count,
GLboolean transpose,
{
GET_CURRENT_CONTEXT(ctx);
_mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
- 2, 3, location, count, transpose, value);
+ 2, 3, location, count, transpose, value, GL_FLOAT);
}
void GLAPIENTRY
@@ -713,7 +713,7 @@ _mesa_UniformMatrix3x2fv(GLint location, GLsizei count,
GLboolean transpose,
{
GET_CURRENT_CONTEXT(ctx);
_mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
- 3, 2, location, count, transpose, value);
+ 3, 2, location, count, transpose, value, GL_FLOAT);
}
void GLAPIENTRY
@@ -722,7 +722,7 @@ _mesa_UniformMatrix2x4fv(GLint location, GLsizei count,
GLboolean transpose,
{
GET_CURRENT_CONTEXT(ctx);
_mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
- 2, 4, location, count, transpose, value);
+ 2, 4, location, count, transpose, value, GL_FLOAT);
}
void GLAPIENTRY
@@ -731,7 +731,7 @@ _mesa_UniformMatrix4x2fv(GLint location, GLsizei count,
GLboolean transpose,
{
GET_CURRENT_CONTEXT(ctx);
_mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
- 4, 2, location, count, transpose, value);
+ 4, 2, location, count, transpose, value, GL_FLOAT);
}
void GLAPIENTRY
@@ -740,7 +740,7 @@ _mesa_UniformMatrix3x4fv(GLint location, GLsizei count,
GLboolean transpose,
{
GET_CURRENT_CONTEXT(ctx);
_mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
- 3, 4, location, count, transpose, value);
+ 3, 4, location, count, transpose, value, GL_FLOAT);
}
void GLAPIENTRY
@@ -749,7 +749,7 @@ _mesa_UniformMatrix4x3fv(GLint location, GLsizei count,
GLboolean transpose,
{
GET_CURRENT_CONTEXT(ctx);
_mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
- 4, 3, location, count, transpose, value);
+ 4, 3, location, count, transpose, value, GL_FLOAT);
}
/** Same as above with direct state access **/
@@ -762,7 +762,7 @@ _mesa_ProgramUniformMatrix2x3fv(GLuint program, GLint
location, GLsizei count,
struct gl_shader_program *shProg =
_mesa_lookup_shader_program_err(ctx, program,
"glProgramUniformMatrix2x3fv");
- _mesa_uniform_matrix(ctx, shProg, 2, 3, location, count, transpose, value);
+ _mesa_uniform_matrix(ctx, shProg, 2, 3, location, count, transpose, value,
GL_FLOAT);
}
void GLAPIENTRY
@@ -773,7 +773,7 @@ _mesa_ProgramUniformMatrix3x2fv(GLuint program, GLint
location, GLsizei count,
struct gl_shader_program *shProg =
_mesa_lookup_shader_program_err(ctx, program,
"glProgramUniformMatrix3x2fv");
- _mesa_uniform_matrix(ctx, shProg, 3, 2, location, count, transpose, value);
+ _mesa_uniform_matrix(ctx, shProg, 3, 2, location, count, transpose, value,
GL_FLOAT);
}
void GLAPIENTRY
@@ -784,7 +784,7 @@ _mesa_ProgramUniformMatrix2x4fv(GLuint program, GLint
location, GLsizei count,
struct gl_shader_program *shProg =
_mesa_lookup_shader_program_err(ctx, program,
"glProgramUniformMatrix2x4fv");
- _mesa_uniform_matrix(ctx, shProg, 2, 4, location, count, transpose, value);
+ _mesa_uniform_matrix(ctx, shProg, 2, 4, location, count, transpose, value,
GL_FLOAT);
}
void GLAPIENTRY
@@ -795,7 +795,7 @@ _mesa_ProgramUniformMatrix4x2fv(GLuint program, GLint
location, GLsizei count,
struct gl_shader_program *shProg =
_mesa_lookup_shader_program_err(ctx, program,
"glProgramUniformMatrix4x2fv");
- _mesa_uniform_matrix(ctx, shProg, 4, 2, location, count, transpose, value);
+ _mesa_uniform_matrix(ctx, shProg, 4, 2, location, count, transpose, value,
GL_FLOAT);
}
void GLAPIENTRY
@@ -806,7 +806,7 @@ _mesa_ProgramUniformMatrix3x4fv(GLuint program, GLint
location, GLsizei count,
struct gl_shader_program *shProg =
_mesa_lookup_shader_program_err(ctx, program,
"glProgramUniformMatrix3x4fv");
- _mesa_uniform_matrix(ctx, shProg, 3, 4, location, count, transpose, value);
+ _mesa_uniform_matrix(ctx, shProg, 3, 4, location, count, transpose, value,
GL_FLOAT);
}
void GLAPIENTRY
@@ -817,7 +817,7 @@ _mesa_ProgramUniformMatrix4x3fv(GLuint program, GLint
location, GLsizei count,
struct gl_shader_program *shProg =
_mesa_lookup_shader_program_err(ctx, program,
"glProgramUniformMatrix4x3fv");
- _mesa_uniform_matrix(ctx, shProg, 4, 3, location, count, transpose, value);
+ _mesa_uniform_matrix(ctx, shProg, 4, 3, location, count, transpose, value,
GL_FLOAT);
}
@@ -1328,194 +1328,343 @@ _mesa_GetActiveAtomicCounterBufferiv(GLuint program,
GLuint bufferIndex,
void GLAPIENTRY
_mesa_Uniform1d(GLint location, GLdouble v0)
{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, &v0,
GL_DOUBLE);
}
void GLAPIENTRY
_mesa_Uniform2d(GLint location, GLdouble v0, GLdouble v1)
{
+ GET_CURRENT_CONTEXT(ctx);
+ GLdouble v[2];
+ v[0] = v0;
+ v[1] = v1;
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, v,
GL_DOUBLE_VEC2);
}
void GLAPIENTRY
_mesa_Uniform3d(GLint location, GLdouble v0, GLdouble v1, GLdouble v2)
{
+ GET_CURRENT_CONTEXT(ctx);
+ GLdouble v[3];
+ v[0] = v0;
+ v[1] = v1;
+ v[2] = v2;
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, v,
GL_DOUBLE_VEC3);
}
void GLAPIENTRY
_mesa_Uniform4d(GLint location, GLdouble v0, GLdouble v1, GLdouble v2,
GLdouble v3)
{
+ GET_CURRENT_CONTEXT(ctx);
+ GLdouble v[4];
+ v[0] = v0;
+ v[1] = v1;
+ v[2] = v2;
+ v[3] = v3;
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, v,
GL_DOUBLE_VEC4);
}
void GLAPIENTRY
_mesa_Uniform1dv(GLint location, GLsizei count, const GLdouble * value)
{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value,
GL_DOUBLE);
}
void GLAPIENTRY
_mesa_Uniform2dv(GLint location, GLsizei count, const GLdouble * value)
{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value,
GL_DOUBLE_VEC2);
}
void GLAPIENTRY
_mesa_Uniform3dv(GLint location, GLsizei count, const GLdouble * value)
{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value,
GL_DOUBLE_VEC3);
}
void GLAPIENTRY
_mesa_Uniform4dv(GLint location, GLsizei count, const GLdouble * value)
{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value,
GL_DOUBLE_VEC4);
}
void GLAPIENTRY
_mesa_UniformMatrix2dv(GLint location, GLsizei count, GLboolean transpose,
const GLdouble * value)
{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
+ 2, 2, location, count, transpose, value, GL_DOUBLE);
}
void GLAPIENTRY
_mesa_UniformMatrix3dv(GLint location, GLsizei count, GLboolean transpose,
const GLdouble * value)
{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
+ 3, 3, location, count, transpose, value, GL_DOUBLE);
}
void GLAPIENTRY
_mesa_UniformMatrix4dv(GLint location, GLsizei count, GLboolean transpose,
const GLdouble * value)
{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
+ 4, 4, location, count, transpose, value, GL_DOUBLE);
}
void GLAPIENTRY
_mesa_UniformMatrix2x3dv(GLint location, GLsizei count, GLboolean transpose,
const GLdouble *value)
{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
+ 2, 3, location, count, transpose, value, GL_DOUBLE);
}
void GLAPIENTRY
_mesa_UniformMatrix3x2dv(GLint location, GLsizei count, GLboolean transpose,
const GLdouble *value)
{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
+ 3, 2, location, count, transpose, value, GL_DOUBLE);
}
void GLAPIENTRY
_mesa_UniformMatrix2x4dv(GLint location, GLsizei count, GLboolean transpose,
const GLdouble *value)
{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
+ 2, 4, location, count, transpose, value, GL_DOUBLE);
}
void GLAPIENTRY
_mesa_UniformMatrix4x2dv(GLint location, GLsizei count, GLboolean transpose,
const GLdouble *value)
{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
+ 4, 2, location, count, transpose, value, GL_DOUBLE);
}
void GLAPIENTRY
_mesa_UniformMatrix3x4dv(GLint location, GLsizei count, GLboolean transpose,
const GLdouble *value)
{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
+ 3, 4, location, count, transpose, value, GL_DOUBLE);
}
void GLAPIENTRY
_mesa_UniformMatrix4x3dv(GLint location, GLsizei count, GLboolean transpose,
const GLdouble *value)
{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
+ 4, 3, location, count, transpose, value, GL_DOUBLE);
}
void GLAPIENTRY
_mesa_ProgramUniform1d(GLuint program, GLint location, GLdouble v0)
{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniform1d");
+ _mesa_uniform(ctx, shProg, location, 1, &v0, GL_DOUBLE);
}
void GLAPIENTRY
_mesa_ProgramUniform2d(GLuint program, GLint location, GLdouble v0, GLdouble
v1)
{
+ GET_CURRENT_CONTEXT(ctx);
+ GLdouble v[2];
+ struct gl_shader_program *shProg;
+ v[0] = v0;
+ v[1] = v1;
+ shProg = _mesa_lookup_shader_program_err(ctx, program,
"glProgramUniform2d");
+ _mesa_uniform(ctx, shProg, location, 1, v, GL_DOUBLE_VEC2);
}
void GLAPIENTRY
_mesa_ProgramUniform3d(GLuint program, GLint location, GLdouble v0, GLdouble
v1,
GLdouble v2)
{
+ GET_CURRENT_CONTEXT(ctx);
+ GLdouble v[3];
+ struct gl_shader_program *shProg;
+ v[0] = v0;
+ v[1] = v1;
+ v[2] = v2;
+ shProg = _mesa_lookup_shader_program_err(ctx, program,
"glProgramUniform3d");
+ _mesa_uniform(ctx, shProg, location, 1, v, GL_DOUBLE_VEC3);
}
void GLAPIENTRY
_mesa_ProgramUniform4d(GLuint program, GLint location, GLdouble v0, GLdouble
v1,
GLdouble v2, GLdouble v3)
{
+ GET_CURRENT_CONTEXT(ctx);
+ GLdouble 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,
"glProgramUniform4d");
+ _mesa_uniform(ctx, shProg, location, 1, v, GL_DOUBLE_VEC4);
}
void GLAPIENTRY
_mesa_ProgramUniform1dv(GLuint program, GLint location, GLsizei count,
const GLdouble * value)
{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniform1dv");
+ _mesa_uniform(ctx, shProg, location, count, value, GL_DOUBLE);
}
void GLAPIENTRY
_mesa_ProgramUniform2dv(GLuint program, GLint location, GLsizei count,
const GLdouble * value)
{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniform2dv");
+ _mesa_uniform(ctx, shProg, location, count, value, GL_DOUBLE_VEC2);
}
void GLAPIENTRY
_mesa_ProgramUniform3dv(GLuint program, GLint location, GLsizei count,
const GLdouble * value)
{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniform3dv");
+ _mesa_uniform(ctx, shProg, location, count, value, GL_DOUBLE_VEC3);
}
void GLAPIENTRY
_mesa_ProgramUniform4dv(GLuint program, GLint location, GLsizei count,
const GLdouble * value)
{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniform4dv");
+ _mesa_uniform(ctx, shProg, location, count, value, GL_DOUBLE_VEC4);
}
void GLAPIENTRY
_mesa_ProgramUniformMatrix2dv(GLuint program, GLint location, GLsizei count,
GLboolean transpose, const GLdouble * value)
{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniformMatrix2dv");
+ _mesa_uniform_matrix(ctx, shProg, 2, 2, location, count, transpose, value,
GL_DOUBLE);
}
void GLAPIENTRY
_mesa_ProgramUniformMatrix3dv(GLuint program, GLint location, GLsizei count,
GLboolean transpose, const GLdouble * value)
{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniformMatrix3dv");
+ _mesa_uniform_matrix(ctx, shProg, 3, 3, location, count, transpose, value,
GL_DOUBLE);
}
void GLAPIENTRY
_mesa_ProgramUniformMatrix4dv(GLuint program, GLint location, GLsizei count,
GLboolean transpose, const GLdouble * value)
{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniformMatrix4dv");
+ _mesa_uniform_matrix(ctx, shProg, 4, 4, location, count, transpose, value,
GL_DOUBLE);
}
void GLAPIENTRY
_mesa_ProgramUniformMatrix2x3dv(GLuint program, GLint location, GLsizei count,
GLboolean transpose, const GLdouble * value)
{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniformMatrix2x3dv");
+ _mesa_uniform_matrix(ctx, shProg, 2, 3, location, count, transpose, value,
GL_DOUBLE);
}
void GLAPIENTRY
_mesa_ProgramUniformMatrix3x2dv(GLuint program, GLint location, GLsizei count,
GLboolean transpose, const GLdouble * value)
{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniformMatrix3x2dv");
+ _mesa_uniform_matrix(ctx, shProg, 3, 2, location, count, transpose, value,
GL_DOUBLE);
}
void GLAPIENTRY
_mesa_ProgramUniformMatrix2x4dv(GLuint program, GLint location, GLsizei count,
GLboolean transpose, const GLdouble * value)
{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniformMatrix2x4dv");
+ _mesa_uniform_matrix(ctx, shProg, 2, 4, location, count, transpose, value,
GL_DOUBLE);
}
void GLAPIENTRY
_mesa_ProgramUniformMatrix4x2dv(GLuint program, GLint location, GLsizei count,
GLboolean transpose, const GLdouble * value)
{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniformMatrix4x2dv");
+ _mesa_uniform_matrix(ctx, shProg, 4, 2, location, count, transpose, value,
GL_DOUBLE);
}
void GLAPIENTRY
_mesa_ProgramUniformMatrix3x4dv(GLuint program, GLint location, GLsizei count,
GLboolean transpose, const GLdouble * value)
{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniformMatrix3x4dv");
+ _mesa_uniform_matrix(ctx, shProg, 3, 4, location, count, transpose, value,
GL_DOUBLE);
}
void GLAPIENTRY
_mesa_ProgramUniformMatrix4x3dv(GLuint program, GLint location, GLsizei count,
GLboolean transpose, const GLdouble * value)
{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramUniformMatrix4x3dv");
+ _mesa_uniform_matrix(ctx, shProg, 4, 3, location, count, transpose, value,
GL_DOUBLE);
}
diff --git a/src/mesa/main/uniforms.h b/src/mesa/main/uniforms.h
index a752c08..0f57711 100644
--- a/src/mesa/main/uniforms.h
+++ b/src/mesa/main/uniforms.h
@@ -360,7 +360,8 @@ void
_mesa_uniform_matrix(struct gl_context *ctx, struct gl_shader_program *shProg,
GLuint cols, GLuint rows,
GLint location, GLsizei count,
- GLboolean transpose, const GLfloat *values);
+ GLboolean transpose,
+ const GLvoid *values, GLenum type);
void
_mesa_get_uniform(struct gl_context *ctx, GLuint program, GLint location,
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index 49e4a7a..3028412 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -607,6 +607,14 @@ type_size(const struct glsl_type *type)
*/
return 1;
}
+ break;
+ case GLSL_TYPE_DOUBLE:
+ if (type->is_matrix()) {
+ return type->matrix_columns * 2;
+ } else {
+ return 2;
+ }
+ break;