summaryrefslogtreecommitdiff
path: root/tests/bindings/resources-in-structs.hlsl.disabled
diff options
context:
space:
mode:
authorTim Foley <tfoley@nvidia.com>2017-06-09 11:34:21 -0700
committerTim Foley <tfoley@nvidia.com>2017-06-09 13:44:59 -0700
commitfcf83dbf9effab3bd98bad2b83b2468b7eb05cfd (patch)
tree41047c94883b86ec085a81597391ce3ef557cd43 /tests/bindings/resources-in-structs.hlsl.disabled
parent52e8d4b9a27ab0060f874c3a63ab531847be35c0 (diff)
Initial import of code.
Diffstat (limited to 'tests/bindings/resources-in-structs.hlsl.disabled')
-rw-r--r--tests/bindings/resources-in-structs.hlsl.disabled42
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/bindings/resources-in-structs.hlsl.disabled b/tests/bindings/resources-in-structs.hlsl.disabled
new file mode 100644
index 000000000..05269d823
--- /dev/null
+++ b/tests/bindings/resources-in-structs.hlsl.disabled
@@ -0,0 +1,42 @@
+//SPIRE_TEST_OPTS:-target dxbc-assembly -profile ps_5_0 -entry main
+
+// Confirm that resources inside `struct` types work reasonably well,
+
+#ifdef __SPIRE__
+#define R(X) /**/
+#else
+#define R(X) X
+#endif
+
+float4 use(float val) { return val; };
+float4 use(float2 val) { return float4(val,0.0,0.0); };
+float4 use(float3 val) { return float4(val,0.0); };
+float4 use(float4 val) { return val; };
+float4 use(Texture2D t, SamplerState s) { return t.Sample(s, 0.0); }
+float4 use(Texture2D t, SamplerComparisonState s) { return t.SampleCmp(s, 0.0, 0.0); }
+
+struct FooData
+{
+ float4 f;
+ Texture2D t;
+ SamplerState s;
+ SamplerComparisonState c;
+};
+
+cbuffer CA R(: register(b0))
+{
+ FooData foo R(: register(c0) : register(t0) : register(s0));
+};
+
+Texture2D t R(: register(t1));
+SamplerState s R(: register(s2));
+
+float4 main() : SV_Target
+{
+ // Go ahead and use everything in this case:
+ return use(foo.t, foo.s)
+ + use(foo.t, foo.c)
+ + use(t, s)
+ + use(foo.f)
+ ;
+} \ No newline at end of file