<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Thanks,<br>
<br>
I thought about that but the various
nir_intrinsic_set_write_mask()/etc.. for load/store kind of
discouraged me.<br>
I'll give it a try though.<br>
<br>
On 07/09/16 17:12, Jason Ekstrand wrote:<br>
</div>
<blockquote
cite="mid:CAOFGe95LyaCoRVA0a3nqk=y-zOtLYummebEMjEq-bpf-=K9-jA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>
<div>LGTM.<br>
<br>
</div>
Reviewed-by: Jason Ekstrand <<a moz-do-not-send="true"
href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br>
<br>
</div>
<div>Maybe we should consider making the orders of arguments a
bit more consistent for a few functions so that we can use
fill_common_atomic_sources for load and store too.<br>
<br>
</div>
<div>--Jason<br>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Wed, Sep 7, 2016 at 3:10 AM, Lionel
Landwerlin <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:llandwerlin@gmail.com" target="_blank">llandwerlin@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">Missing
bits from 2afb950161f847d9b0a7be03dfb62c<wbr>acc5ea51ba.<br>
<br>
Signed-off-by: Lionel Landwerlin <<a
moz-do-not-send="true"
href="mailto:lionel.g.landwerlin@intel.com">lionel.g.landwerlin@intel.com</a><wbr>><br>
Cc: Jason Ekstrand <<a moz-do-not-send="true"
href="mailto:jason.ekstrand@intel.com">jason.ekstrand@intel.com</a>><br>
---<br>
src/compiler/spirv/spirv_to_<wbr>nir.c | 35
++++++++++++++++++++++++++++++<wbr>++++-<br>
1 file changed, 34 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/src/compiler/spirv/spirv_to_<wbr>nir.c
b/src/compiler/spirv/spirv_to_<wbr>nir.c<br>
index 4d88fdb..f1cd4be 100644<br>
--- a/src/compiler/spirv/spirv_to_<wbr>nir.c<br>
+++ b/src/compiler/spirv/spirv_to_<wbr>nir.c<br>
@@ -1920,11 +1920,44 @@ vtn_handle_ssbo_or_shared_<wbr>atomic(struct
vtn_builder *b, SpvOp opcode,<br>
*/<br>
<br>
if (chain->var->mode ==
vtn_variable_mode_workgroup) {<br>
+ struct vtn_type *type = chain->var->type;<br>
nir_deref *deref = &vtn_access_chain_to_deref(b,
chain)->deref;<br>
nir_intrinsic_op op = get_shared_nir_atomic_op(<wbr>opcode);<br>
atomic = nir_intrinsic_instr_create(b-><wbr>nb.shader,
op);<br>
atomic->variables[0] = nir_deref_as_var(nir_copy_<wbr>deref(atomic,
deref));<br>
- fill_common_atomic_sources(b, opcode, w,
&atomic->src[0]);<br>
+<br>
+ switch (opcode) {<br>
+ case SpvOpAtomicLoad:<br>
+ atomic->num_components =
glsl_get_vector_elements(type-<wbr>>type);<br>
+ break;<br>
+<br>
+ case SpvOpAtomicStore:<br>
+ atomic->num_components =
glsl_get_vector_elements(type-<wbr>>type);<br>
+ nir_intrinsic_set_write_mask(<wbr>atomic, (1
<< atomic->num_components) - 1);<br>
+ atomic->src[0] = nir_src_for_ssa(vtn_ssa_value(<wbr>b,
w[4])->def);<br>
+ break;<br>
+<br>
+ case SpvOpAtomicExchange:<br>
+ case SpvOpAtomicCompareExchange:<br>
+ case SpvOpAtomicCompareExchangeWeak<wbr>:<br>
+ case SpvOpAtomicIIncrement:<br>
+ case SpvOpAtomicIDecrement:<br>
+ case SpvOpAtomicIAdd:<br>
+ case SpvOpAtomicISub:<br>
+ case SpvOpAtomicSMin:<br>
+ case SpvOpAtomicUMin:<br>
+ case SpvOpAtomicSMax:<br>
+ case SpvOpAtomicUMax:<br>
+ case SpvOpAtomicAnd:<br>
+ case SpvOpAtomicOr:<br>
+ case SpvOpAtomicXor:<br>
+ fill_common_atomic_sources(b, opcode, w,
&atomic->src[0]);<br>
+ break;<br>
+<br>
+ default:<br>
+ unreachable("Invalid SPIR-V atomic");<br>
+<br>
+ }<br>
} else {<br>
assert(chain->var->mode ==
vtn_variable_mode_ssbo);<br>
struct vtn_type *type;<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.9.3<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a moz-do-not-send="true"
href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a moz-do-not-send="true"
href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev"
rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote>
</div>
<br>
</div>
</blockquote>
<p><br>
</p>
</body>
</html>