Re: [Mesa-dev] [PATCH 1/2] spirv: Fix reaching unreachable for compare exchange on images

2017-06-26 Thread James Legg
On Fri, 2017-06-23 at 11:29 -0700, Jason Ekstrand wrote:
> OpAtomicCompareExchangeWeak is only available in OpenCL, not Vulkan. 
> As such, we probably don't want to handle it yet as no one uses
> spirv_to_nir for OpenCL.  The assert on AtomicCompareExchange is,
> however, a bug we should fix now.

I'll drop the OpAtomicCompareExchangeWeak changes. It is still
partially handled elsewhere in spirv_to_nir.c, however each case would
fail the assertion in fill_common_atomic_sources.

Thanks,
James
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/2] spirv: Fix reaching unreachable for compare exchange on images

2017-06-23 Thread Jason Ekstrand
OpAtomicCompareExchangeWeak is only available in OpenCL, not Vulkan.  As
such, we probably don't want to handle it yet as no one uses spirv_to_nir
for OpenCL.  The assert on AtomicCompareExchange is, however, a bug we
should fix now.

--Jason

On Wed, Jun 21, 2017 at 8:59 AM, James Legg 
wrote:

> We were hitting the
> unreachable("Invalid image opcode")
> near the end of vtn_handle_image when parsing SpvOpAtomicCompareExchange
> and SpvOpAtomicCompareExchangeWeak opcodes.
> ---
>  src/compiler/spirv/spirv_to_nir.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/src/compiler/spirv/spirv_to_nir.c
> b/src/compiler/spirv/spirv_to_nir.c
> index 0a5eb0e..8f21aec 100644
> --- a/src/compiler/spirv/spirv_to_nir.c
> +++ b/src/compiler/spirv/spirv_to_nir.c
> @@ -1805,6 +1805,7 @@ fill_common_atomic_sources(struct vtn_builder *b,
> SpvOp opcode,
>break;
>
> case SpvOpAtomicCompareExchange:
> +   case SpvOpAtomicCompareExchangeWeak:
>src[0] = nir_src_for_ssa(vtn_ssa_value(b, w[8])->def);
>src[1] = nir_src_for_ssa(vtn_ssa_value(b, w[7])->def);
>break;
> @@ -1977,6 +1978,8 @@ vtn_handle_image(struct vtn_builder *b, SpvOp opcode,
>intrin->src[2] = nir_src_for_ssa(vtn_ssa_value(b, w[3])->def);
>break;
>
> +   case SpvOpAtomicCompareExchange:
> +   case SpvOpAtomicCompareExchangeWeak:
> case SpvOpAtomicIIncrement:
> case SpvOpAtomicIDecrement:
> case SpvOpAtomicExchange:
> --
> 2.9.4
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/2] spirv: Fix reaching unreachable for compare exchange on images

2017-06-22 Thread Emil Velikov
On 21 June 2017 at 16:59, James Legg  wrote:
> We were hitting the
> unreachable("Invalid image opcode")
> near the end of vtn_handle_image when parsing SpvOpAtomicCompareExchange
> and SpvOpAtomicCompareExchangeWeak opcodes.

Thanks James.

Are you hitting that with the released versions of Mesa? If so please
include the following line:
Cc: 

See [1] for more information about nominating patches for stable.

-Emil
[1] https://www.mesa3d.org/submittingpatches.html#nominations
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 1/2] spirv: Fix reaching unreachable for compare exchange on images

2017-06-21 Thread James Legg
We were hitting the
unreachable("Invalid image opcode")
near the end of vtn_handle_image when parsing SpvOpAtomicCompareExchange
and SpvOpAtomicCompareExchangeWeak opcodes.
---
 src/compiler/spirv/spirv_to_nir.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/compiler/spirv/spirv_to_nir.c 
b/src/compiler/spirv/spirv_to_nir.c
index 0a5eb0e..8f21aec 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -1805,6 +1805,7 @@ fill_common_atomic_sources(struct vtn_builder *b, SpvOp 
opcode,
   break;
 
case SpvOpAtomicCompareExchange:
+   case SpvOpAtomicCompareExchangeWeak:
   src[0] = nir_src_for_ssa(vtn_ssa_value(b, w[8])->def);
   src[1] = nir_src_for_ssa(vtn_ssa_value(b, w[7])->def);
   break;
@@ -1977,6 +1978,8 @@ vtn_handle_image(struct vtn_builder *b, SpvOp opcode,
   intrin->src[2] = nir_src_for_ssa(vtn_ssa_value(b, w[3])->def);
   break;
 
+   case SpvOpAtomicCompareExchange:
+   case SpvOpAtomicCompareExchangeWeak:
case SpvOpAtomicIIncrement:
case SpvOpAtomicIDecrement:
case SpvOpAtomicExchange:
-- 
2.9.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev