HLSL: Smear scalars to match vectors for relational operations.

Yield a vector relational compare and a vector result.
This commit is contained in:
John Kessenich
2016-08-07 19:14:22 -06:00
parent 267590d452
commit 4583b61e20
6 changed files with 168 additions and 22 deletions

View File

@@ -3082,11 +3082,9 @@ spv::Id TGlslangToSpvTraverser::createBinaryOperation(glslang::TOperator op, spv
// Handle comparison instructions
if (reduceComparison && (builder.isVector(left) || builder.isMatrix(left) || builder.isAggregate(left))) {
assert(op == glslang::EOpEqual || op == glslang::EOpNotEqual);
if (reduceComparison && (op == glslang::EOpEqual || op == glslang::EOpNotEqual)
&& (builder.isVector(left) || builder.isMatrix(left) || builder.isAggregate(left)))
return builder.createCompositeCompare(precision, left, right, op == glslang::EOpEqual);
}
switch (op) {
case glslang::EOpLessThan: