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,
|
// We only care about whether "any" is true for the active program instances,
|
||||||
// so we have to make v with the current program mask.
|
// so we have to make v with the current program mask.
|
||||||
#ifdef ISPC_TARGET_GENERIC
|
#ifdef ISPC_TARGET_GENERIC
|
||||||
return __any(v | !__mask);
|
return __any(v & __mask);
|
||||||
#else
|
#else
|
||||||
return __any(__sext_varying_bool(v) | !__mask);
|
return __any(__sext_varying_bool(v) & __mask);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -364,9 +364,9 @@ static inline uniform bool none(bool v) {
|
|||||||
// so we're only looking at the current lanes
|
// so we're only looking at the current lanes
|
||||||
|
|
||||||
#ifdef ISPC_TARGET_GENERIC
|
#ifdef ISPC_TARGET_GENERIC
|
||||||
return __none(v | !__mask);
|
return __none(v & __mask);
|
||||||
#else
|
#else
|
||||||
return __none(__sext_varying_bool(v) | !__mask);
|
return __none(__sext_varying_bool(v) & __mask);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user