Compiler - fix mat3 conformance
TRAC #11723
Matrix elements are accessed as [col][row] in GLSL and [row][col] in HLSL. Fixed this by transposing all matrix uniforms so they have a row-major layout. Then transpose them in the shader every time they're used in matrix math.
Signed-off-by: Andrew Lewycky
Signed-off-by: Daniel Koch
Author: Nicolas Capens
git-svn-id: https://angleproject.googlecode.com/svn/trunk@96 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/Program.cpp b/src/libGLESv2/Program.cpp
index df91db5..3030ac1 100644
--- a/src/libGLESv2/Program.cpp
+++ b/src/libGLESv2/Program.cpp
@@ -789,12 +789,12 @@
if (constantPS)
{
- mConstantTablePS->SetMatrixArray(device, constantPS, matrix, count);
+ mConstantTablePS->SetMatrixTransposeArray(device, constantPS, matrix, count);
}
if (constantVS)
{
- mConstantTableVS->SetMatrixArray(device, constantVS, matrix, count);
+ mConstantTableVS->SetMatrixTransposeArray(device, constantVS, matrix, count);
}
delete[] matrix;
@@ -822,12 +822,12 @@
if (constantPS)
{
- mConstantTablePS->SetMatrixArray(device, constantPS, matrix, count);
+ mConstantTablePS->SetMatrixTransposeArray(device, constantPS, matrix, count);
}
if (constantVS)
{
- mConstantTableVS->SetMatrixArray(device, constantVS, matrix, count);
+ mConstantTableVS->SetMatrixTransposeArray(device, constantVS, matrix, count);
}
delete[] matrix;
@@ -855,12 +855,12 @@
if (constantPS)
{
- mConstantTablePS->SetMatrixArray(device, constantPS, matrix, count);
+ mConstantTablePS->SetMatrixTransposeArray(device, constantPS, matrix, count);
}
if (constantVS)
{
- mConstantTableVS->SetMatrixArray(device, constantVS, matrix, count);
+ mConstantTableVS->SetMatrixTransposeArray(device, constantVS, matrix, count);
}
delete[] matrix;