Mesa (master): glsl2: Fix transpose of rows and cols

Ian Romanick idr at kemper.freedesktop.org
Tue Aug 17 23:24:14 UTC 2010


Module: Mesa
Branch: master
Commit: bdc0e5285a3d7d29b953970e43ca548cbc4e7e30
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=bdc0e5285a3d7d29b953970e43ca548cbc4e7e30

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Tue Aug 17 15:57:48 2010 -0700

glsl2: Fix transpose of rows and cols

This error led to an assertion failure for some constructors of
non-square matrices.  It only occured in matrices where the number of
columns was greater than the number of rows.  It didn't even always
occur on those.

Fixes piglit glslparsertest case constructor-16.vert.

---

 src/glsl/ast_function.cpp |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/glsl/ast_function.cpp b/src/glsl/ast_function.cpp
index 6c36a04..f85b308 100644
--- a/src/glsl/ast_function.cpp
+++ b/src/glsl/ast_function.cpp
@@ -904,8 +904,8 @@ emit_inline_matrix_constructor(const glsl_type *type,
 	 instructions->push_tail(inst);
       }
    } else {
-      const unsigned rows = type->matrix_columns;
-      const unsigned cols = type->vector_elements;
+      const unsigned cols = type->matrix_columns;
+      const unsigned rows = type->vector_elements;
       unsigned col_idx = 0;
       unsigned row_idx = 0;
 




More information about the mesa-commit mailing list