summaryrefslogtreecommitdiff
path: root/tests/cross-compile/compile-time-loop.slang
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2017-07-18 15:22:20 -0700
committerGitHub <noreply@github.com>2017-07-18 15:22:20 -0700
commita01014567cccc2582547ed10870352629ffd6484 (patch)
tree30e1bf209e232d7f8d6723959db68b2c0cb015dd /tests/cross-compile/compile-time-loop.slang
parent3d313d963f29f6ca6a8d12bd5c403a70c49aca2a (diff)
parent2476c035ec15d3ee22239ebd1fe10e6e8c1e01e3 (diff)
Merge pull request #120 from tfoleyNV/compile-time-loop
Add a compile-time loop construct to Slang
Diffstat (limited to 'tests/cross-compile/compile-time-loop.slang')
-rw-r--r--tests/cross-compile/compile-time-loop.slang14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/cross-compile/compile-time-loop.slang b/tests/cross-compile/compile-time-loop.slang
new file mode 100644
index 000000000..aae35f09e
--- /dev/null
+++ b/tests/cross-compile/compile-time-loop.slang
@@ -0,0 +1,14 @@
+//TEST:CROSS_COMPILE: -profile ps_5_0 -entry main -target spirv-assembly
+
+Texture2D t;
+SamplerState s;
+
+float4 main(float2 uv) : SV_Target
+{
+ float4 result = 0;
+ $for(i in Range(0,5))
+ {
+ result += t.Sample(s, uv, int2(i - 2, 0));
+ }
+ return result;
+}