| #version 450 core | |
| #extension GL_EXT_long_vector : enable | |
| #extension GL_EXT_shader_explicit_arithmetic_types : enable | |
| layout (local_size_x = 64, local_size_y = 1, local_size_z = 1) in; | |
| layout(set = 0, binding = 0) buffer Buf { | |
| float f[]; | |
| } buf; | |
| void main() | |
| { | |
| const vector<float, 8> v = vector<float, 8>(1.0); | |
| const vector<float, 8> w = vector<float, 8>(2.0); | |
| const vector<int, 8> iv = vector<int, 8>(3); | |
| // builtins that are not constant folded, called with constant arguments | |
| const vector<float, 8> f = fma(v, w, w); | |
| const vector<int, 8> bc = bitCount(iv); | |
| float x = fma(v, w, w)[3]; | |
| int y = bitCount(iv)[int(v[0])]; | |
| // the output argument keeps its own qualifier | |
| vector<float, 8> ip; | |
| vector<float, 8> m = modf(v, ip); | |
| buf.f[0] = f[0] + float(bc[1]) + x + float(y) + m[2] + ip[3]; | |
| } |