From: Ian Romanick <[email protected]> The indices were all confused, and it wasn't obvious which order the parser expected the data. The old code worked with square matrices, it either didn't upload enough data or wrote outside the UBO for non- square matrices.
Signed-off-by: Ian Romanick <[email protected]> --- tests/shaders/shader_runner.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c index 82b834d..897edec 100644 --- a/tests/shaders/shader_runner.c +++ b/tests/shaders/shader_runner.c @@ -1336,14 +1336,18 @@ set_ubo_uniform(const char *name, const char *type, const char *line, int ubo_ar matrix_stride /= sizeof(float); + /* Expect the data in the .shader_test file to be listed in + * column-major order no matter what the layout of the data in + * the UBO will be. + */ for (c = 0; c < cols; c++) { for (r = 0; r < rows; r++) { if (row_major) { - matrixdata[matrix_stride * c + r] = - f[r * rows + c]; - } else { matrixdata[matrix_stride * r + c] = - f[r * rows + c]; + f[c * rows + r]; + } else { + matrixdata[matrix_stride * c + r] = + f[c * rows + r]; } } } @@ -1366,14 +1370,18 @@ set_ubo_uniform(const char *name, const char *type, const char *line, int ubo_ar matrix_stride /= sizeof(double); + /* Expect the data in the .shader_test file to be listed in + * column-major order no matter what the layout of the data in + * the UBO will be. + */ for (c = 0; c < cols; c++) { for (r = 0; r < rows; r++) { if (row_major) { - matrixdata[matrix_stride * c + r] = - d[r * rows + c]; - } else { matrixdata[matrix_stride * r + c] = - d[r * rows + c]; + d[c * rows + r]; + } else { + matrixdata[matrix_stride * c + r] = + d[c * rows + r]; } } } -- 1.8.1.4 _______________________________________________ Piglit mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/piglit
