yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
b40b711f5
master
1//DIAGNOSTIC_TEST:SIMPLE: 2 3float nonDiff(float x) 4{ 5 return x; 6} 7 8[Differentiable] 9float f(float x) 10{ 11 return x * x; 12} 13 14[Differentiable] 15float h(float x) 16{ 17 float val = 0; 18 19 // call to non-differentiable method 20 // (should error if the data-flow propagation works properly.) 21 // 22 float y = nonDiff(x); 23 24 // call to a differentiable method, using the 25 // result of a non-differentiable call. 26 // 27 val = f(y); 28 29 return val; 30}