GLSL: Fix #1247. Remove extraneous *= matrix test.

This commit is contained in:
John Kessenich 2018-02-15 12:22:25 -07:00
parent 98e3fb1926
commit b587fb6208
5 changed files with 17 additions and 2 deletions

View File

@ -158,6 +158,9 @@ Shader version: 150
0:49 'FragColor' ( out 4-component vector of float) 0:49 'FragColor' ( out 4-component vector of float)
0:49 Constant: 0:49 Constant:
0:49 3 (const int) 0:49 3 (const int)
0:50 matrix mult second child into first child ( temp 3X4 matrix of float)
0:50 'm34' ( temp 3X4 matrix of float)
0:50 'colorTransform' ( uniform 3X3 matrix of float)
0:? Linker Objects 0:? Linker Objects
0:? 'colorTransform' ( uniform 3X3 matrix of float) 0:? 'colorTransform' ( uniform 3X3 matrix of float)
0:? 'Color' ( smooth in 3-component vector of float) 0:? 'Color' ( smooth in 3-component vector of float)
@ -331,6 +334,9 @@ Shader version: 150
0:49 'FragColor' ( out 4-component vector of float) 0:49 'FragColor' ( out 4-component vector of float)
0:49 Constant: 0:49 Constant:
0:49 3 (const int) 0:49 3 (const int)
0:50 matrix mult second child into first child ( temp 3X4 matrix of float)
0:50 'm34' ( temp 3X4 matrix of float)
0:50 'colorTransform' ( uniform 3X3 matrix of float)
0:? Linker Objects 0:? Linker Objects
0:? 'colorTransform' ( uniform 3X3 matrix of float) 0:? 'colorTransform' ( uniform 3X3 matrix of float)
0:? 'Color' ( smooth in 3-component vector of float) 0:? 'Color' ( smooth in 3-component vector of float)

View File

@ -6,7 +6,9 @@ ERROR: 0:18: 'assign' : cannot convert from ' temp 2-component vector of float'
ERROR: 0:19: 'xy' : does not apply to this type: temp 2X3 matrix of float ERROR: 0:19: 'xy' : does not apply to this type: temp 2X3 matrix of float
ERROR: 0:21: '[' : matrix index out of range '2' ERROR: 0:21: '[' : matrix index out of range '2'
ERROR: 0:21: '[' : vector index out of range '4' ERROR: 0:21: '[' : vector index out of range '4'
ERROR: 7 compilation errors. No code generated. ERROR: 0:22: 'assign' : cannot convert from ' temp 2X3 matrix of float' to ' temp 2X3 matrix of float'
ERROR: 0:23: 'assign' : cannot convert from ' uniform 3X2 matrix of float' to ' temp 2X3 matrix of float'
ERROR: 9 compilation errors. No code generated.
Shader version: 120 Shader version: 120
@ -32,6 +34,8 @@ ERROR: node is still EOpNull!
0:21 2 (const int) 0:21 2 (const int)
0:21 Constant: 0:21 Constant:
0:21 4 (const int) 0:21 4 (const int)
0:22 'm23' ( temp 2X3 matrix of float)
0:23 'm23' ( temp 2X3 matrix of float)
0:? Linker Objects 0:? Linker Objects
0:? 'v3' ( in 3-component vector of float) 0:? 'v3' ( in 3-component vector of float)
0:? 'm32' ( uniform 3X2 matrix of float) 0:? 'm32' ( uniform 3X2 matrix of float)
@ -64,6 +68,8 @@ ERROR: node is still EOpNull!
0:21 2 (const int) 0:21 2 (const int)
0:21 Constant: 0:21 Constant:
0:21 4 (const int) 0:21 4 (const int)
0:22 'm23' ( temp 2X3 matrix of float)
0:23 'm23' ( temp 2X3 matrix of float)
0:? Linker Objects 0:? Linker Objects
0:? 'v3' ( in 3-component vector of float) 0:? 'v3' ( in 3-component vector of float)
0:? 'm32' ( uniform 3X2 matrix of float) 0:? 'm32' ( uniform 3X2 matrix of float)

View File

@ -47,4 +47,5 @@ void main()
FragColor *= inv4; FragColor *= inv4;
FragColor = vec4(FragColor * matrixCompMult(un34, un34), FragColor.w); FragColor = vec4(FragColor * matrixCompMult(un34, un34), FragColor.w);
m34 *= colorTransform;
} }

View File

@ -19,4 +19,6 @@ void main()
m23.xy; // ERROR, can't use . m23.xy; // ERROR, can't use .
gl_Position = vec4(m23 * m32 * v3, m24[2][4]); // ERROR, 2 and 4 are out of range gl_Position = vec4(m23 * m32 * v3, m24[2][4]); // ERROR, 2 and 4 are out of range
m23 *= m23; // ERROR, right side needs to be square
m23 *= m32; // ERROR, left columns must match right rows
} }

View File

@ -2706,7 +2706,7 @@ bool TIntermediate::promoteBinary(TIntermBinary& node)
node.setOp(op = EOpMatrixTimesScalarAssign); node.setOp(op = EOpMatrixTimesScalarAssign);
} }
} else if (left->isMatrix() && right->isMatrix()) { } else if (left->isMatrix() && right->isMatrix()) {
if (left->getMatrixCols() != left->getMatrixRows() || left->getMatrixCols() != right->getMatrixCols() || left->getMatrixCols() != right->getMatrixRows()) if (left->getMatrixCols() != right->getMatrixCols() || left->getMatrixCols() != right->getMatrixRows())
return false; return false;
node.setOp(op = EOpMatrixTimesMatrixAssign); node.setOp(op = EOpMatrixTimesMatrixAssign);
} else if (!left->isMatrix() && !right->isMatrix()) { } else if (!left->isMatrix() && !right->isMatrix()) {