Mesa (master): spirv: fix AtomicLoad/Store on images
Lionel Landwerlin
llandwerlin at kemper.freedesktop.org
Thu Sep 22 11:08:59 UTC 2016
Module: Mesa
Branch: master
Commit: 9adfa695ac144cfd7c9bb9d0c63d280861f3add4
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9adfa695ac144cfd7c9bb9d0c63d280861f3add4
Author: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Date: Mon Sep 19 17:14:18 2016 +0100
spirv: fix AtomicLoad/Store on images
OpAtomicLoad/Store should have pointer to images just like the rest of the
atomic operators. These couple of lines were poorly copied from the
ssbo/shared_vars cases (the only ones currently tests by the CTS).
Fixes 2afb950161f8 ("spirv/nir: Add support for OpAtomicLoad/Store")
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
---
src/compiler/spirv/spirv_to_nir.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c
index 04add3e..de2cebc 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -1671,6 +1671,7 @@ vtn_handle_image(struct vtn_builder *b, SpvOp opcode,
case SpvOpAtomicIDecrement:
case SpvOpAtomicIAdd:
case SpvOpAtomicISub:
+ case SpvOpAtomicLoad:
case SpvOpAtomicSMin:
case SpvOpAtomicUMin:
case SpvOpAtomicSMax:
@@ -1681,17 +1682,9 @@ vtn_handle_image(struct vtn_builder *b, SpvOp opcode,
image = *vtn_value(b, w[3], vtn_value_type_image_pointer)->image;
break;
- case SpvOpAtomicLoad: {
- image.image =
- vtn_value(b, w[3], vtn_value_type_access_chain)->access_chain;
- break;
- }
-
- case SpvOpAtomicStore: {
- image.image =
- vtn_value(b, w[1], vtn_value_type_access_chain)->access_chain;
+ case SpvOpAtomicStore:
+ image = *vtn_value(b, w[1], vtn_value_type_image_pointer)->image;
break;
- }
case SpvOpImageQuerySize:
image.image =
More information about the mesa-commit
mailing list