summaryrefslogtreecommitdiff
path: root/tests/hlsl
diff options
context:
space:
mode:
authorHai Nguyen <chaoticbob@me.com>2018-03-24 19:47:55 -0700
committerHai Nguyen <chaoticbob@me.com>2018-03-24 19:47:55 -0700
commita24bee75e4a4cda4ddc41071bb595e4182fa8492 (patch)
tree7c3f5aae71b56bd7b2aa2b42a805abe69dcc23f0 /tests/hlsl
parentaf3f790dceacbcc6f4725c56b2e5c08f5043c820 (diff)
downloadSPIRV-Reflect-a24bee75e4a4cda4ddc41071bb595e4182fa8492.tar.gz
Resolved conflicts
Diffstat (limited to 'tests/hlsl')
-rw-r--r--tests/hlsl/counter_buffers.hlsl22
-rw-r--r--tests/hlsl/counter_buffers.spvbin0 -> 1424 bytes
-rw-r--r--tests/hlsl/semantics.hlsl51
-rw-r--r--tests/hlsl/semantics.spvbin0 -> 3156 bytes
4 files changed, 73 insertions, 0 deletions
diff --git a/tests/hlsl/counter_buffers.hlsl b/tests/hlsl/counter_buffers.hlsl
new file mode 100644
index 0000000..ca94c1a
--- /dev/null
+++ b/tests/hlsl/counter_buffers.hlsl
@@ -0,0 +1,22 @@
+/*
+Build with DXC using -fspv-reflect to enable counter buffers
+
+ dxc -spirv -fspv-reflect -T ps_5_0 -Fo counter_buffers.spv counter_buffers.hlsl
+
+*/
+
+struct Data {
+ float4 f4;
+ int i;
+};
+
+ConsumeStructuredBuffer<Data> MyBufferIn : register(u3, space2);
+AppendStructuredBuffer<Data> MyBufferOut : register(u4, space2);
+
+float4 main(float4 PosCS : SV_Position) : SV_TARGET0
+{
+ Data val = MyBufferIn.Consume();
+ MyBufferOut.Append(val);
+
+ return val.f4;
+} \ No newline at end of file
diff --git a/tests/hlsl/counter_buffers.spv b/tests/hlsl/counter_buffers.spv
new file mode 100644
index 0000000..5e91a6f
--- /dev/null
+++ b/tests/hlsl/counter_buffers.spv
Binary files differ
diff --git a/tests/hlsl/semantics.hlsl b/tests/hlsl/semantics.hlsl
new file mode 100644
index 0000000..6cb1e25
--- /dev/null
+++ b/tests/hlsl/semantics.hlsl
@@ -0,0 +1,51 @@
+/*
+Build with DXC using -fspv-reflect to enable semantics
+
+ dxc -spirv -fspv-reflect -T ps_5_0 -Fo semantics.spv semantics.hlsl
+
+*/
+
+struct UBO {
+ float4x4 XformMatrix;
+ float3 Scale;
+ float t;
+ float2 uv;
+};
+
+ConstantBuffer<UBO> MyConstants : register(b2, space2);
+
+struct PSInput {
+ float4 Position : SV_POSITION;
+ float3 Normal : NORMAL;
+ float3 Color : COLOR_00001;
+ float Alpha : OPACITY_512;
+ float4 Scaling : SCALE_987654321;
+ float2 TexCoord0 : TEXCOORD0;
+ float2 TexCoord1 : TEXCOORD1;
+ float2 TexCoord2 : TEXCOORD2;
+};
+
+struct PSOutput {
+ float4 oColor0 : SV_TARGET0;
+ float4 oColor1 : SV_TARGET1;
+ float4 oColor2 : SV_TARGET2;
+ float4 oColor3 : SV_TARGET3;
+ float4 oColor4 : SV_TARGET4;
+ float4 oColor5 : SV_TARGET5;
+ float4 oColor6 : SV_TARGET6;
+ float4 oColor7 : SV_TARGET7;
+};
+
+PSOutput main(PSInput input, uint prim_id : SV_PRIMITIVEID)
+{
+ PSOutput ret;
+ ret.oColor0 = mul(MyConstants.XformMatrix, input.Position);
+ ret.oColor1 = float4(input.Normal, 1) + float4(MyConstants.Scale, 0);
+ ret.oColor2 = float4(input.Color, 1);
+ ret.oColor3 = float4(0, 0, 0, input.Alpha);
+ ret.oColor4 = input.Scaling;
+ ret.oColor5 = float4(input.TexCoord0, 0, 0);
+ ret.oColor6 = float4(input.TexCoord1, 0, 0);
+ ret.oColor7 = float4(input.TexCoord2, 0, 0);
+ return ret;
+} \ No newline at end of file
diff --git a/tests/hlsl/semantics.spv b/tests/hlsl/semantics.spv
new file mode 100644
index 0000000..153c09a
--- /dev/null
+++ b/tests/hlsl/semantics.spv
Binary files differ