mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-29 17:44:09 +01:00
44 lines
2.0 KiB
Plaintext
44 lines
2.0 KiB
Plaintext
// language: metal2.0
|
|
#include <metal_stdlib>
|
|
#include <simd/simd.h>
|
|
|
|
using metal::uint;
|
|
|
|
|
|
fragment void main_(
|
|
) {
|
|
metal::float4 v = metal::float4(0.0);
|
|
float a = ((1.0) * 57.295779513082322865);
|
|
float b = ((1.0) * 0.017453292519943295474);
|
|
metal::float4 c = ((v) * 57.295779513082322865);
|
|
metal::float4 d = ((v) * 0.017453292519943295474);
|
|
metal::float4 e = metal::saturate(v);
|
|
metal::float4 g = metal::refract(v, v, 1.0);
|
|
int const_dot = ( + metal::int2 {}.x * metal::int2 {}.x + metal::int2 {}.y * metal::int2 {}.y);
|
|
uint _e13 = metal::abs(0u);
|
|
uint first_leading_bit_abs = metal::select(31 - metal::clz(_e13), uint(-1), _e13 == 0 || _e13 == -1);
|
|
int flb_a = metal::select(31 - metal::clz(metal::select(-1, ~-1, -1 < 0)), int(-1), -1 == 0 || -1 == -1);
|
|
metal::int2 _e18 = metal::int2(-1);
|
|
metal::int2 flb_b = metal::select(31 - metal::clz(metal::select(_e18, ~_e18, _e18 < 0)), int2(-1), _e18 == 0 || _e18 == -1);
|
|
metal::uint2 _e21 = metal::uint2(1u);
|
|
metal::uint2 flb_c = metal::select(31 - metal::clz(_e21), uint2(-1), _e21 == 0 || _e21 == -1);
|
|
int ftb_a = (((metal::ctz(-1) + 1) % 33) - 1);
|
|
uint ftb_b = (((metal::ctz(1u) + 1) % 33) - 1);
|
|
metal::int2 ftb_c = (((metal::ctz(metal::int2(-1)) + 1) % 33) - 1);
|
|
metal::uint2 ftb_d = (((metal::ctz(metal::uint2(1u)) + 1) % 33) - 1);
|
|
uint ctz_a = metal::ctz(0u);
|
|
int ctz_b = metal::ctz(0);
|
|
uint ctz_c = metal::ctz(4294967295u);
|
|
int ctz_d = metal::ctz(-1);
|
|
metal::uint2 ctz_e = metal::ctz(metal::uint2(0u));
|
|
metal::int2 ctz_f = metal::ctz(metal::int2(0));
|
|
metal::uint2 ctz_g = metal::ctz(metal::uint2(1u));
|
|
metal::int2 ctz_h = metal::ctz(metal::int2(1));
|
|
int clz_a = metal::clz(-1);
|
|
uint clz_b = metal::clz(1u);
|
|
metal::int2 clz_c = metal::clz(metal::int2(-1));
|
|
metal::uint2 clz_d = metal::clz(metal::uint2(1u));
|
|
float lde_a = metal::ldexp(1.0, 2);
|
|
metal::float2 lde_b = metal::ldexp(metal::float2(1.0, 2.0), metal::int2(3, 4));
|
|
}
|