From 97989059b9472b4055ff72dac02b0e6c6f4afeb7 Mon Sep 17 00:00:00 2001 From: "Juan A. Suarez Romero" Date: Tue, 9 Feb 2016 12:51:03 +0100 Subject: [PATCH] mesa/main: handle double uniform matrices properly 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 Reviewed-by: Kenneth Graunke --- src/mesa/main/uniform_query.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp index ab5c3cd9249..997b0cb1c7e 100644 --- a/src/mesa/main/uniform_query.cpp +++ b/src/mesa/main/uniform_query.cpp @@ -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. -- 2.30.2