SPV: Use OpLogicalEqual/OpLogicalNotEqual for boolean type comparison.
This commit is contained in:
parent
d6abcee1fc
commit
c7d3656dde
3 changed files with 8 additions and 3 deletions
|
|
@ -2633,6 +2633,7 @@ spv::Id TGlslangToSpvTraverser::createBinaryOperation(glslang::TOperator op, spv
|
|||
{
|
||||
bool isUnsigned = typeProxy == glslang::EbtUint;
|
||||
bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble;
|
||||
bool isBool = typeProxy == glslang::EbtBool;
|
||||
|
||||
spv::Op binOp = spv::OpNop;
|
||||
bool needMatchingVectors = true; // for non-matrix ops, would a scalar need to smear to match a vector?
|
||||
|
|
@ -2820,6 +2821,8 @@ spv::Id TGlslangToSpvTraverser::createBinaryOperation(glslang::TOperator op, spv
|
|||
case glslang::EOpVectorEqual:
|
||||
if (isFloat)
|
||||
binOp = spv::OpFOrdEqual;
|
||||
else if (isBool)
|
||||
binOp = spv::OpLogicalEqual;
|
||||
else
|
||||
binOp = spv::OpIEqual;
|
||||
break;
|
||||
|
|
@ -2827,6 +2830,8 @@ spv::Id TGlslangToSpvTraverser::createBinaryOperation(glslang::TOperator op, spv
|
|||
case glslang::EOpVectorNotEqual:
|
||||
if (isFloat)
|
||||
binOp = spv::OpFOrdNotEqual;
|
||||
else if (isBool)
|
||||
binOp = spv::OpLogicalNotEqual;
|
||||
else
|
||||
binOp = spv::OpINotEqual;
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue