<p dir="ltr">This looks good to me.</p>
<p dir="ltr">Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>></p>
<p dir="ltr">Do we have tests for this? If not, we should write some. I know there are other image atomic tests in the CTS. They shouldn't be hard to extend.</p>
<div class="gmail_extra"><br><div class="gmail_quote">On Sep 19, 2016 9:36 AM, "Lionel Landwerlin" <<a href="mailto:llandwerlin@gmail.com">llandwerlin@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">OpAtomicLoad/Store should have pointer to images just like the rest of the<br>
atomic operators. These couple of lines were poorly copied from the<br>
ssbo/shared_vars cases (the only ones currently tests by the CTS).<br>
<br>
Fixes 2afb950161f847d9b0a7 "spirv/nir: Add support for OpAtomicLoad/Store"<br>
Cc: Timothy Arceri <<a href="mailto:timothy.arceri@collabora.com">timothy.arceri@collabora.com</a>><br>
Cc: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br>
---<br>
src/compiler/spirv/spirv_to_<wbr>nir.c | 13 +++----------<br>
1 file changed, 3 insertions(+), 10 deletions(-)<br>
<br>
diff --git a/src/compiler/spirv/spirv_to_<wbr>nir.c b/src/compiler/spirv/spirv_to_<wbr>nir.c<br>
index 49338b2..12b43ee 100644<br>
--- a/src/compiler/spirv/spirv_to_<wbr>nir.c<br>
+++ b/src/compiler/spirv/spirv_to_<wbr>nir.c<br>
@@ -1671,6 +1671,7 @@ vtn_handle_image(struct vtn_builder *b, SpvOp opcode,<br>
case SpvOpAtomicIDecrement:<br>
case SpvOpAtomicIAdd:<br>
case SpvOpAtomicISub:<br>
+ case SpvOpAtomicLoad:<br>
case SpvOpAtomicSMin:<br>
case SpvOpAtomicUMin:<br>
case SpvOpAtomicSMax:<br>
@@ -1681,17 +1682,9 @@ vtn_handle_image(struct vtn_builder *b, SpvOp opcode,<br>
image = *vtn_value(b, w[3], vtn_value_type_image_pointer)-<wbr>>image;<br>
break;<br>
<br>
- case SpvOpAtomicLoad: {<br>
- image.image =<br>
- vtn_value(b, w[3], vtn_value_type_access_chain)-><wbr>access_chain;<br>
- break;<br>
- }<br>
-<br>
- case SpvOpAtomicStore: {<br>
- image.image =<br>
- vtn_value(b, w[1], vtn_value_type_access_chain)-><wbr>access_chain;<br>
+ case SpvOpAtomicStore:<br>
+ image = *vtn_value(b, w[1], vtn_value_type_image_pointer)-<wbr>>image;<br>
break;<br>
- }<br>
<br>
case SpvOpImageQuerySize:<br>
image.image =<br>
--<br>
2.9.3<br>
<br>
</blockquote></div></div>