Merge pull request #3350 from ReinUsesLisp/atom

shader/memory: Implement ATOM.ADD
This commit is contained in:
bunnei 2020-01-29 16:49:54 -05:00 committed by GitHub
commit 2db7adc42a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 86 additions and 39 deletions

View file

@ -1857,10 +1857,7 @@ private:
template <const std::string_view& opname, Type type>
Expression Atomic(Operation operation) {
ASSERT(stage == ShaderType::Compute);
auto& smem = std::get<SmemNode>(*operation[0]);
return {fmt::format("atomic{}(smem[{} >> 2], {})", opname, Visit(smem.GetAddress()).AsInt(),
return {fmt::format("atomic{}({}, {})", opname, Visit(operation[0]).GetCode(),
Visit(operation[1]).As(type)),
type};
}