Fix WavePrefixCountBits() being off by one.

It was counting bits up to the current lane included, whereas the
documentation says it should be excluded. This now matches dxc's behavior
as well.

Fix #2929
This commit is contained in:
Ryp 2022-04-21 22:05:17 +03:00
parent 06ac141412
commit f906b895ec
2 changed files with 5 additions and 5 deletions

View file

@ -5430,7 +5430,7 @@ void HlslParseContext::decomposeIntrinsic(const TSourceLoc& loc, TIntermTyped*&
}
case EOpWavePrefixCountBits:
{
// Mapped to subgroupBallotInclusiveBitCount(subgroupBallot())
// Mapped to subgroupBallotExclusiveBitCount(subgroupBallot())
// builtin
// uvec4 type.
@ -5444,7 +5444,7 @@ void HlslParseContext::decomposeIntrinsic(const TSourceLoc& loc, TIntermTyped*&
TType uintType(EbtUint, EvqTemporary);
node = intermediate.addBuiltInFunctionCall(loc,
EOpSubgroupBallotInclusiveBitCount, true, res, uintType);
EOpSubgroupBallotExclusiveBitCount, true, res, uintType);
break;
}