HLSL: Fix uniform packing for non-square matrices.
We were neglecting to transpose the types here, so were getting
incorrect registers counts for rows and columns.
BUG=angleproject:1072
TEST=dEQP-GLES3.functional.shaders.matrix.*
Change-Id: Ia0ab89bbba8b9e2d8f39e84ef4e8ad3c03bb118d
Reviewed-on: https://chromium-review.googlesource.com/286771
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/compiler/translator/blocklayoutHLSL.cpp b/src/compiler/translator/blocklayoutHLSL.cpp
index f32cf2c..2472ca8 100644
--- a/src/compiler/translator/blocklayoutHLSL.cpp
+++ b/src/compiler/translator/blocklayoutHLSL.cpp
@@ -156,6 +156,7 @@
unsigned int HLSLVariableRegisterCount(const Uniform &variable, ShShaderOutput outputType)
{
HLSLBlockEncoder encoder(HLSLBlockEncoder::GetStrategyFor(outputType));
+ encoder.setTransposeMatrices(true);
HLSLVariableRegisterCount(variable, &encoder);
const size_t registerBytes = (encoder.BytesPerComponent * encoder.ComponentsPerRegister);