mesa/main: handle double uniform matrices properly
authorJuan A. Suarez Romero <jasuarez@igalia.com>
Tue, 9 Feb 2016 11:51:03 +0000 (12:51 +0100)
committerSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Wed, 4 May 2016 06:08:12 +0000 (08:08 +0200)
When computing the offset in the uniform storage table, take into account
the size multiplier so double precision matrices are handled correctly.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/main/uniform_query.cpp

index ab5c3cd..997b0cb 100644 (file)
@@ -993,7 +993,7 @@ _mesa_uniform_matrix(struct gl_context *ctx, struct gl_shader_program *shProg,
    elements = components * vectors;
 
    if (!transpose) {
-      memcpy(&uni->storage[elements * offset], values,
+      memcpy(&uni->storage[size_mul * elements * offset], values,
             sizeof(uni->storage[0]) * elements * count * size_mul);
    } else if (basicType == GLSL_TYPE_FLOAT) {
       /* Copy and transpose the matrix.