summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2019-01-27 00:08:17 -0800
committerYong He <yonghe@google.com>2019-01-28 10:50:05 -0800
commit9812963c52eb6312546f600804bb642a38dcfe64 (patch)
tree589be4c5b1f9e74da86caa6bd5be6a4f13083b15 /tests
parentf2579a60a3de45d5f48f1e1433ba736647988e8e (diff)
Fix type legalization to correctly handle empty struct fields.
Diffstat (limited to 'tests')
-rw-r--r--tests/cross-compile/glsl-empty-struct-param-field.slang17
-rw-r--r--tests/cross-compile/glsl-empty-struct-param-field.slang.glsl26
-rw-r--r--tests/cross-compile/glsl-generic-in.slang.glsl1
3 files changed, 44 insertions, 0 deletions
diff --git a/tests/cross-compile/glsl-empty-struct-param-field.slang b/tests/cross-compile/glsl-empty-struct-param-field.slang
new file mode 100644
index 000000000..21b67e325
--- /dev/null
+++ b/tests/cross-compile/glsl-empty-struct-param-field.slang
@@ -0,0 +1,17 @@
+//TEST:CROSS_COMPILE:-target spirv-assembly -entry main -profile ps_5_0
+
+struct E
+{
+};
+
+struct P
+{
+ E em;
+ float4 param;
+};
+ParameterBlock<P> pblock;
+
+float4 main(float4 pos : SV_POSITION)
+{
+ return pblock.param;
+} \ No newline at end of file
diff --git a/tests/cross-compile/glsl-empty-struct-param-field.slang.glsl b/tests/cross-compile/glsl-empty-struct-param-field.slang.glsl
new file mode 100644
index 000000000..0f5d53a2c
--- /dev/null
+++ b/tests/cross-compile/glsl-empty-struct-param-field.slang.glsl
@@ -0,0 +1,26 @@
+//TEST_IGNORE_FILE:
+#version 450
+layout(row_major) uniform;
+layout(row_major) buffer;
+
+#line 14 0
+struct P_0
+{
+ vec4 param_0;
+};
+
+layout(binding = 0)
+layout(std140) uniform _S1
+{
+ P_0 _data;
+} pblock_0;
+layout(location = 0)
+out vec4 _S2;
+
+
+#line 14
+void main()
+{
+ _S2 = pblock_0._data.param_0;
+ return;
+} \ No newline at end of file
diff --git a/tests/cross-compile/glsl-generic-in.slang.glsl b/tests/cross-compile/glsl-generic-in.slang.glsl
index 7dbe7feca..ee686b833 100644
--- a/tests/cross-compile/glsl-generic-in.slang.glsl
+++ b/tests/cross-compile/glsl-generic-in.slang.glsl
@@ -1,3 +1,4 @@
+//TEST_IGNORE_FILE:
#version 450
layout(row_major) uniform;
layout(row_major) buffer;