summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2017-07-18 13:32:56 -0700
committerGitHub <noreply@github.com>2017-07-18 13:32:56 -0700
commit3d313d963f29f6ca6a8d12bd5c403a70c49aca2a (patch)
treed4a5f0cefd50c96aaf22921f9fef715b6359c0c5 /tests
parentac310e2d848f3174cfb88ca6166676afc2cbe3cd (diff)
parent1c022e2c3654de868c45658683f9e04cf4d68cc0 (diff)
Merge pull request #118 from tfoleyNV/falcor-shadow-fixes
Falcor shadow fixes
Diffstat (limited to 'tests')
-rw-r--r--tests/reflection/thread-group-size.hlsl.expected4
-rw-r--r--tests/rewriter/varying-struct.slang21
-rw-r--r--tests/rewriter/varying-struct.vert54
3 files changed, 78 insertions, 1 deletions
diff --git a/tests/reflection/thread-group-size.hlsl.expected b/tests/reflection/thread-group-size.hlsl.expected
index 60d5e822c..d139c5b64 100644
--- a/tests/reflection/thread-group-size.hlsl.expected
+++ b/tests/reflection/thread-group-size.hlsl.expected
@@ -21,7 +21,9 @@ standard output = {
"parameters": [
{
"name": "tid",
- "binding": {"kind": "vertexInput", "index": 0},
+ "bindings": [
+
+ ],
"type": {
"kind": "vector",
"elementCount": 3,
diff --git a/tests/rewriter/varying-struct.slang b/tests/rewriter/varying-struct.slang
new file mode 100644
index 000000000..92e9dda2e
--- /dev/null
+++ b/tests/rewriter/varying-struct.slang
@@ -0,0 +1,21 @@
+//TEST_IGNORE_FILE:
+
+struct VS_IN
+{
+ float4 x : X;
+ float4 y : Y;
+};
+
+struct VS_OUT
+{
+ float4 color : COLOR;
+ float4 posH : SV_Position;
+};
+
+VS_OUT doIt(VS_IN i)
+{
+ VS_OUT o;
+ o.color = i.x;
+ o.posH = i.y;
+ return o;
+}
diff --git a/tests/rewriter/varying-struct.vert b/tests/rewriter/varying-struct.vert
new file mode 100644
index 000000000..74ca8be37
--- /dev/null
+++ b/tests/rewriter/varying-struct.vert
@@ -0,0 +1,54 @@
+#version 450 core
+//TEST:COMPARE_GLSL:
+
+#if defined(__SLANG__)
+
+__import varying_struct;
+
+in VS_IN foo;
+out VS_OUT bar;
+
+void main()
+{
+ bar = doIt(foo);
+}
+
+#else
+
+struct VS_IN
+{
+ vec4 x;
+ vec4 y;
+};
+
+struct VS_OUT
+{
+ vec4 color;
+ vec4 posH;
+};
+
+VS_OUT doIt(VS_IN i)
+{
+ VS_OUT o;
+ o.color = i.x;
+ o.posH = i.y;
+ return o;
+}
+
+layout(location = 0)
+out vec4 SLANG_out_bar_color;
+
+layout(location = 0)
+in vec4 SLANG_in_foo_x;
+
+layout(location = 1)
+in vec4 SLANG_in_foo_y;
+
+void main()
+{
+ VS_OUT SLANG_tmp_0 = doIt(VS_IN(SLANG_in_foo_x, SLANG_in_foo_y));
+ SLANG_out_bar_color = SLANG_tmp_0.color;
+ gl_Position = SLANG_tmp_0.posH;
+}
+
+#endif