summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarol Herbst <kherbst@redhat.com>2020-03-07 16:17:48 +0100
committerEric Engestrom <eric@engestrom.ch>2020-08-19 22:28:31 +0200
commitd9c26f0b1367330cf39d93feebf8f832c74f4ddd (patch)
tree7045e7c55e485615430e74342fc5b7f2417b8f18
parentb1a4bce0850c71253e01e69c45f2ae0927fb527d (diff)
nv50/ir/nir: fix global_atomic_comp_swap
Fixes: 20d0ae464c4a ("nv50/ir: implement global atomics and handle it for nir") Signed-off-by: Karol Herbst <kherbst@redhat.com> Reviewed-by: Pierre Moreau <dev@pmoreau.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6367> (cherry picked from commit b283fb335b2736ffe53c6d7d075c1b14dbcadce7)
-rw-r--r--.pick_status.json2
-rw-r--r--src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp2
2 files changed, 3 insertions, 1 deletions
diff --git a/.pick_status.json b/.pick_status.json
index 9cd8a9a1f5f..b8d3c95f619 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -94,7 +94,7 @@
"description": "nv50/ir/nir: fix global_atomic_comp_swap",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": "20d0ae464c4accd97227b1b4e805a9c10183647d"
},
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp
index bd78b76f384..66c0de19dd2 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp
@@ -2096,6 +2096,8 @@ Converter::visit(nir_intrinsic_instr *insn)
Symbol *sym = mkSymbol(FILE_MEMORY_GLOBAL, 0, dType, offset);
Instruction *atom =
mkOp2(OP_ATOM, dType, newDefs[0], sym, getSrc(&insn->src[1], 0));
+ if (op == nir_intrinsic_global_atomic_comp_swap)
+ atom->setSrc(2, getSrc(&insn->src[2], 0));
atom->setIndirect(0, 0, address);
atom->subOp = getSubOp(op);