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
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};
}