diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2017-06-19 10:23:16 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-06-19 10:23:16 -0700 |
| commit | bb9ca29160f5d95f3860504262693ea650d96be5 (patch) | |
| tree | 04f502283ed818f661e368b3d8d1ba5ce875d1d2 /tests/render/auto-import.slang.h | |
| parent | cafed774d99f95bce6f182599913f3417dc68a3a (diff) | |
| parent | 634522da69b14b38c15b14d6b717b1289812e9bb (diff) | |
Merge pull request #29 from tfoleyNV/auto-import
Allow for automatic importing of Slang code
Diffstat (limited to 'tests/render/auto-import.slang.h')
| -rw-r--r-- | tests/render/auto-import.slang.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/render/auto-import.slang.h b/tests/render/auto-import.slang.h new file mode 100644 index 000000000..d53005688 --- /dev/null +++ b/tests/render/auto-import.slang.h @@ -0,0 +1,21 @@ +//TEST_IGNORE_FILE: + +// This file implements the "library" code +// that both the HLSL and GLSL shaders share. +// +// This code is written in Slang (more or less +// just HLSL), and will be translated as needed +// for each of the targets. + +float3 transformColor(float3 color) +{ + float3 result; + + result.x = sin(20.0 * (color.x + color.y)); + result.y = saturate(cos(color.z * 30.0)); + result.z = sin(color.x * color.y * color.z * 100.0); + + result = 0.5 * (result + 1); + + return result; +}
\ No newline at end of file |
