HLSL: Don't do logical short-circuits when the operands are bool-vectors.
This seems a bit ill-defined, and was generating code that made OpPhi of two operands that were Boolean vectors result in a scalar bool.
This commit is contained in:
@@ -5356,13 +5356,19 @@ bool TGlslangToSpvTraverser::isTrivialLeaf(const glslang::TIntermTyped* node)
|
||||
}
|
||||
|
||||
// A node is trivial if it is a single operation with no side effects.
|
||||
// Error on the side of saying non-trivial.
|
||||
// Vector results seem ill-defined, currently classifying them as trivial too,
|
||||
// to avoid scalar bool-based control-flow logic.
|
||||
// Otherwise, error on the side of saying non-trivial.
|
||||
// Return true if trivial.
|
||||
bool TGlslangToSpvTraverser::isTrivial(const glslang::TIntermTyped* node)
|
||||
{
|
||||
if (node == nullptr)
|
||||
return false;
|
||||
|
||||
// count vectors as trivial
|
||||
if (node->getType().isVector())
|
||||
return true;
|
||||
|
||||
// symbols and constants are trivial
|
||||
if (isTrivialLeaf(node))
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user