yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
a697b2c67
master
1//TEST:SIMPLE(filecheck=CHECK): -allow-glsl -stage compute -entry computeMain -target glsl 2//TEST:SIMPLE(filecheck=CHECK): -allow-glsl -stage compute -entry computeMain -target spirv -emit-spirv-directly 3#version 460 4// CHECK: warning 31200 5 6buffer MyBlockName2 7{ 8 uint data[]; 9} outputBuffer; 10 11layout(local_size_x = 4) in; 12 13bool testNoiseScalar() 14{ 15 return true 16 && noise1(1.0f) == 0.0f 17 && noise2(1.0f) == vec2(0.0f) 18 && noise3(1.0f) == vec3(0.0f) 19 && noise4(1.0f) == vec4(0.0f) 20 ; 21} 22 23__generic<let N:int> 24bool testNoiseVector() 25{ 26 return true 27 && noise1(vector<float, N>(1.0f)) == 0.0f 28 && noise2(vector<float, N>(1.0f)) == vec2(0.0f) 29 && noise3(vector<float, N>(1.0f)) == vec3(0.0f) 30 && noise4(vector<float, N>(1.0f)) == vec4(0.0f) 31 ; 32} 33 34bool testNoiseFunctions() 35{ 36 return true 37 && testNoiseScalar() 38 && testNoiseVector<2>() 39 && testNoiseVector<3>() 40 && testNoiseVector<4>() 41 ; 42} 43 44void computeMain() 45{ 46 outputBuffer.data[0] = true 47 && testNoiseFunctions() 48 ; 49 // BUF: 1 50}