From f4e39bfdcb6a9eeff9a94de81eafb31a158356f7 Mon Sep 17 00:00:00 2001 From: Jamie Madill Date: Fri, 1 Aug 2014 17:22:17 -0400 Subject: [PATCH] Fix non-square matrix-to-matrix constructors. This fixes some broken tests in dEQP: functional.shaders.conversions.matrix_to_matrix BUG=angle:712 Change-Id: I0538595f2913a2c1d4f0da901d65d608a6580d19 Reviewed-on: https://chromium-review.googlesource.com/210882 Tested-by: Jamie Madill Reviewed-by: Geoff Lang Reviewed-by: Nicolas Capens --- src/compiler/translator/StructureHLSL.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compiler/translator/StructureHLSL.cpp b/src/compiler/translator/StructureHLSL.cpp index cdd10c568..7aaf47c4c 100644 --- a/src/compiler/translator/StructureHLSL.cpp +++ b/src/compiler/translator/StructureHLSL.cpp @@ -306,13 +306,13 @@ void StructureHLSL::addConstructor(const TType &type, const TString &name, const } else if (parameter.isMatrix()) { - for (int row = 0; row < rows; row++) + for (int col = 0; col < cols; col++) { - for (int col = 0; col < cols; col++) + for (int row = 0; row < rows; row++) { if (row < parameter.getRows() && col < parameter.getCols()) { - constructor += TString("x0") + "[" + str(row) + "][" + str(col) + "]"; + constructor += TString("x0") + "[" + str(col) + "][" + str(row) + "]"; } else {