HLSL: matrix and vector truncations for m*v, v*m, m*m

HLSL truncates the vector, or one of the two matrix dimensions if there is a
dimensional mismatch in m*v, v*m, or m*m.

This PR adds that ability.  Conversion constructors are added as required.
This commit is contained in:
LoopDawg 2017-11-22 10:33:34 -07:00
parent 698bf7547a
commit 2e62910633
6 changed files with 523 additions and 0 deletions

View file

@ -1152,6 +1152,7 @@ public:
sampler.clear();
qualifier.clear();
qualifier.storage = q;
assert(!(isMatrix() && vectorSize != 0)); // prevent vectorSize != 0 on matrices
}
// for explicit precision qualifier
TType(TBasicType t, TStorageQualifier q, TPrecisionQualifier p, int vs = 1, int mc = 0, int mr = 0,
@ -1164,6 +1165,7 @@ public:
qualifier.storage = q;
qualifier.precision = p;
assert(p >= EpqNone && p <= EpqHigh);
assert(!(isMatrix() && vectorSize != 0)); // prevent vectorSize != 0 on matrices
}
// for turning a TPublicType into a TType, using a shallow copy
explicit TType(const TPublicType& p) :