From 7d3bfe403362b294cc2a1f2607d51dfcd447aafd Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Mon, 26 Jun 2017 09:32:40 -0700 Subject: Replace "auto-import" with `#import` Right now `#import` only differs from `#include` in that it takes a string literal for a file name instead of a raw identifier (to which `.slang` gets appended). The next step is to make `#import` respect preprocessor state, while `__import` doesn't. --- tests/render/pound-import.slang.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/render/pound-import.slang.h (limited to 'tests/render/pound-import.slang.h') diff --git a/tests/render/pound-import.slang.h b/tests/render/pound-import.slang.h new file mode 100644 index 000000000..d53005688 --- /dev/null +++ b/tests/render/pound-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 -- cgit v1.2.3