Fixes to the implementations of any() and none() in the stdlib.
These make sure that inactive vector lanes do not interfere with the results
This commit is contained in:
@@ -340,9 +340,9 @@ static inline uniform bool any(bool v) {
|
||||
// We only care about whether "any" is true for the active program instances,
|
||||
// so we have to make v with the current program mask.
|
||||
#ifdef ISPC_TARGET_GENERIC
|
||||
return __any(v | !__mask);
|
||||
return __any(v & __mask);
|
||||
#else
|
||||
return __any(__sext_varying_bool(v) | !__mask);
|
||||
return __any(__sext_varying_bool(v) & __mask);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -364,9 +364,9 @@ static inline uniform bool none(bool v) {
|
||||
// so we're only looking at the current lanes
|
||||
|
||||
#ifdef ISPC_TARGET_GENERIC
|
||||
return __none(v | !__mask);
|
||||
return __none(v & __mask);
|
||||
#else
|
||||
return __none(__sext_varying_bool(v) | !__mask);
|
||||
return __none(__sext_varying_bool(v) & __mask);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user