HLSL: Smear scalars to match vectors for relational operations.
Yield a vector relational compare and a vector result.
diff --git a/SPIRV/GlslangToSpv.cpp b/SPIRV/GlslangToSpv.cpp
index 6aec9e6..5993e16 100755
--- a/SPIRV/GlslangToSpv.cpp
+++ b/SPIRV/GlslangToSpv.cpp
@@ -3082,11 +3082,9 @@
// 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: