1#pragma clang diagnostic ignored "-Wunused-variable" 2 3#include <metal_stdlib> 4#include <simd/simd.h> 5#include <metal_atomic> 6 7using namespace metal; 8 9struct SSBO 10{ 11 float in_data[1]; 12}; 13 14struct SSBO2 15{ 16 float out_data[1]; 17}; 18 19struct SSBO3 20{ 21 uint count; 22}; 23 24constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(4u, 1u, 1u); 25 26kernel void main0(const device SSBO& _22 [[buffer(0)]], device SSBO2& _38 [[buffer(1)]], device SSBO3& _41 [[buffer(2)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) 27{ 28 float _28 = _22.in_data[gl_GlobalInvocationID.x]; 29 if (_28 > 12.0) 30 { 31 uint _45 = atomic_fetch_add_explicit((device atomic_uint*)&_41.count, 1u, memory_order_relaxed); 32 _38.out_data[_45] = _28; 33 } 34} 35 36