summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2017-07-10 09:49:46 -0700
committerGitHub <noreply@github.com>2017-07-10 09:49:46 -0700
commit8abdf2dddd10feb9794c86cdf6b2159a2b6383e4 (patch)
treedf7d790f33f7e4c8adc1b9b747c7c908d8bab0d4 /tests
parent68df74b58a56b0a1fb19b9ec4ff0282969cd6a12 (diff)
parent5b7c254d24653fd1c19157e8d5ef68a7e787ff58 (diff)
Merge pull request #65 from tfoleyNV/falcor-work
Falcor work
Diffstat (limited to 'tests')
-rw-r--r--tests/preprocessor/import.hlsl2
-rw-r--r--tests/reflection/cross-compile.slang23
-rw-r--r--tests/reflection/cross-compile.slang.expected48
-rw-r--r--tests/render/cross-compile0.hlsl4
-rw-r--r--tests/render/imported-parameters.hlsl4
-rw-r--r--tests/render/pound-import.hlsl4
6 files changed, 78 insertions, 7 deletions
diff --git a/tests/preprocessor/import.hlsl b/tests/preprocessor/import.hlsl
index 486023678..f0618a667 100644
--- a/tests/preprocessor/import.hlsl
+++ b/tests/preprocessor/import.hlsl
@@ -1,4 +1,4 @@
-//TEST:SIMPLE:-profile vs_5_0
+//TEST:SIMPLE:-target none -profile vs_5_0
// Confirm that `#import` interacts with preprocessor as expected
diff --git a/tests/reflection/cross-compile.slang b/tests/reflection/cross-compile.slang
new file mode 100644
index 000000000..12376c82a
--- /dev/null
+++ b/tests/reflection/cross-compile.slang
@@ -0,0 +1,23 @@
+//TEST(smoke):SIMPLE:-profile glsl_fragment -target glsl -target reflection-json
+
+// Confirm that when targetting GLSL via cross compilation,
+// we use the Vulkan layout rules instead of HLSL ones
+//
+// Specifically, we expect all of our top-level parameters
+// to get distinct registers in the same descriptor set,
+// rather than all getting register `0` because they
+// occupy different names register spaces (as they would in D3D)
+
+Texture2D t;
+
+SamplerState s;
+
+cbuffer C
+{
+ float3 c;
+}
+
+float4 main() : SV_Target
+{
+ return 0.0;
+} \ No newline at end of file
diff --git a/tests/reflection/cross-compile.slang.expected b/tests/reflection/cross-compile.slang.expected
new file mode 100644
index 000000000..3bb730f66
--- /dev/null
+++ b/tests/reflection/cross-compile.slang.expected
@@ -0,0 +1,48 @@
+result code = 0
+standard error = {
+}
+standard output = {
+{
+ "parameters": [
+ {
+ "name": "t",
+ "binding": {"kind": "descriptorTableSlot", "index": 0},
+ "type": {
+ "kind": "resource",
+ "baseShape": "texture2D"
+ }
+ },
+ {
+ "name": "s",
+ "binding": {"kind": "descriptorTableSlot", "index": 1},
+ "type": {
+ "kind": "samplerState"
+ }
+ },
+ {
+ "name": "C",
+ "binding": {"kind": "descriptorTableSlot", "index": 2},
+ "type": {
+ "kind": "constantBuffer",
+ "elementType": {
+ "kind": "struct",
+ "fields": [
+ {
+ "name": "c",
+ "type": {
+ "kind": "vector",
+ "elementCount": 3,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ }
+ },
+ "binding": {"kind": "uniform", "offset": 0, "size": 12}
+ }
+ ]
+ }
+ }
+ }
+ ]
+}
+}
diff --git a/tests/render/cross-compile0.hlsl b/tests/render/cross-compile0.hlsl
index d300e2bd5..d40f3460f 100644
--- a/tests/render/cross-compile0.hlsl
+++ b/tests/render/cross-compile0.hlsl
@@ -97,8 +97,8 @@ uniform Uniforms
#define ASSEMBLED_VERTEX(QUAL) \
/* */
-#define V2F(QUAL) \
- QUAL vec3 coarse_color; \
+#define V2F(QUAL) \
+ layout(location = 0) QUAL vec3 coarse_color; \
/* */
// Vertex Shader
diff --git a/tests/render/imported-parameters.hlsl b/tests/render/imported-parameters.hlsl
index 605214fc9..99216728e 100644
--- a/tests/render/imported-parameters.hlsl
+++ b/tests/render/imported-parameters.hlsl
@@ -84,8 +84,8 @@ FragmentStageOutput fragmentMain(FragmentStageInput input)
#define ASSEMBLED_VERTEX(QUAL) \
/* */
-#define V2F(QUAL) \
- QUAL vec3 coarse_color; \
+#define V2F(QUAL) \
+ layout(location = 0) QUAL vec3 coarse_color; \
/* */
// Vertex Shader
diff --git a/tests/render/pound-import.hlsl b/tests/render/pound-import.hlsl
index a9b625fb6..07b195966 100644
--- a/tests/render/pound-import.hlsl
+++ b/tests/render/pound-import.hlsl
@@ -97,8 +97,8 @@ uniform Uniforms
#define ASSEMBLED_VERTEX(QUAL) \
/* */
-#define V2F(QUAL) \
- QUAL vec3 coarse_color; \
+#define V2F(QUAL) \
+ layout(location = 0) QUAL vec3 coarse_color; \
/* */
// Vertex Shader