HLSL: Fix #903: Don't short-circuit && or ||.
This commit is contained in:
@@ -5361,8 +5361,7 @@ bool TGlslangToSpvTraverser::isTrivialLeaf(const glslang::TIntermTyped* node)
|
||||
}
|
||||
|
||||
// A node is trivial if it is a single operation with no side effects.
|
||||
// Vector results seem ill-defined, currently classifying them as trivial too,
|
||||
// to avoid scalar bool-based control-flow logic.
|
||||
// HLSL (and/or vectors) are always trivial, as it does not short circuit.
|
||||
// Otherwise, error on the side of saying non-trivial.
|
||||
// Return true if trivial.
|
||||
bool TGlslangToSpvTraverser::isTrivial(const glslang::TIntermTyped* node)
|
||||
@@ -5370,8 +5369,8 @@ bool TGlslangToSpvTraverser::isTrivial(const glslang::TIntermTyped* node)
|
||||
if (node == nullptr)
|
||||
return false;
|
||||
|
||||
// count vectors as trivial
|
||||
if (node->getType().isVector())
|
||||
// count non scalars as trivial, as well as anything coming from HLSL
|
||||
if (! node->getType().isScalarOrVec1() || glslangIntermediate->getSource() == glslang::EShSourceHlsl)
|
||||
return true;
|
||||
|
||||
// symbols and constants are trivial
|
||||
|
||||
Reference in New Issue
Block a user