wgpu icon indicating copy to clipboard operation
wgpu copied to clipboard

atomicExchange() and atomicCompareExchangeWeak() validation failed on Metal

Open ciaochaos opened this issue 2 years ago • 0 comments

wgsl

atomicExchange(&springForceSrc[source_node * 3u + 2u], 0u);
atomicCompareExchangeWeak(&springForceSrc[source_node * 3u + 2u], 0u, 1u);

Error message

program_source:184:49: error: cannot take the address of an rvalue of type 'metal::uint' (aka 'unsigned int')
    uint _e33 = metal::atomic_exchange_explicit(&uint(_e30) < 1 + (_buffer_sizes.size4 - 0 - 4) / 4 ? springForceSrc[_e30] : DefaultConstructible(), 0u, metal::memory_order_relaxed);

Platform wgpu = "0.18.1" macOS 12.3, M1 Max

ciaochaos avatar Aug 06 '22 16:08 ciaochaos