diff options
Diffstat (limited to 'tests/wgsl')
| -rw-r--r-- | tests/wgsl/semantic-coverage.slang | 16 | ||||
| -rw-r--r-- | tests/wgsl/semantic-depth.slang | 16 | ||||
| -rw-r--r-- | tests/wgsl/semantic-dispatch-thread-id.slang | 9 | ||||
| -rw-r--r-- | tests/wgsl/semantic-group-id.slang | 9 | ||||
| -rw-r--r-- | tests/wgsl/semantic-group-index.slang | 9 | ||||
| -rw-r--r-- | tests/wgsl/semantic-group-thread-id.slang | 9 | ||||
| -rw-r--r-- | tests/wgsl/semantic-instance-id.slang | 9 | ||||
| -rw-r--r-- | tests/wgsl/semantic-is-front-face.slang | 9 | ||||
| -rw-r--r-- | tests/wgsl/semantic-position.slang | 16 | ||||
| -rw-r--r-- | tests/wgsl/semantic-sample-index.slang | 9 | ||||
| -rw-r--r-- | tests/wgsl/semantic-vertex-id.slang | 9 |
11 files changed, 120 insertions, 0 deletions
diff --git a/tests/wgsl/semantic-coverage.slang b/tests/wgsl/semantic-coverage.slang new file mode 100644 index 000000000..722f7180c --- /dev/null +++ b/tests/wgsl/semantic-coverage.slang @@ -0,0 +1,16 @@ +//TEST:SIMPLE(filecheck=WGSL): -target wgsl -stage fragment -entry main + +//WGSL-DAG: @builtin(sample_mask) +//WGSL-DAG: @fragment + +struct Out +{ + uint coverage : SV_Coverage; +}; + +Out main() +{ + Out output; + output.coverage = 1; + return output; +} diff --git a/tests/wgsl/semantic-depth.slang b/tests/wgsl/semantic-depth.slang new file mode 100644 index 000000000..65b29600a --- /dev/null +++ b/tests/wgsl/semantic-depth.slang @@ -0,0 +1,16 @@ +//TEST:SIMPLE(filecheck=WGSL): -target wgsl -stage fragment -entry main + +//WGSL-DAG: @builtin(frag_depth) +//WGSL-DAG: @fragment + +struct Out +{ + float depth : SV_Depth; +}; + +Out main() +{ + Out output; + output.depth = 1.0; + return output; +} diff --git a/tests/wgsl/semantic-dispatch-thread-id.slang b/tests/wgsl/semantic-dispatch-thread-id.slang new file mode 100644 index 000000000..9216c02da --- /dev/null +++ b/tests/wgsl/semantic-dispatch-thread-id.slang @@ -0,0 +1,9 @@ +//TEST:SIMPLE(filecheck=WGSL): -target wgsl -stage compute -entry main + +//WGSL-DAG: @builtin(global_invocation_id) +//WGSL-DAG: @compute + +void main(uint3 dtid : SV_DispatchThreadID) +{ + // Empty compute shader +} diff --git a/tests/wgsl/semantic-group-id.slang b/tests/wgsl/semantic-group-id.slang new file mode 100644 index 000000000..d83f85d8e --- /dev/null +++ b/tests/wgsl/semantic-group-id.slang @@ -0,0 +1,9 @@ +//TEST:SIMPLE(filecheck=WGSL): -target wgsl -stage compute -entry main + +//WGSL-DAG: @builtin(workgroup_id) +//WGSL-DAG: @compute + +void main(uint3 gid : SV_GroupID) +{ + // Empty compute shader +} diff --git a/tests/wgsl/semantic-group-index.slang b/tests/wgsl/semantic-group-index.slang new file mode 100644 index 000000000..06429ff39 --- /dev/null +++ b/tests/wgsl/semantic-group-index.slang @@ -0,0 +1,9 @@ +//TEST:SIMPLE(filecheck=WGSL): -target wgsl -stage compute -entry main + +//WGSL-DAG: @builtin(local_invocation_index) +//WGSL-DAG: @compute + +void main(uint idx : SV_GroupIndex) +{ + // Empty compute shader +} diff --git a/tests/wgsl/semantic-group-thread-id.slang b/tests/wgsl/semantic-group-thread-id.slang new file mode 100644 index 000000000..7646397d0 --- /dev/null +++ b/tests/wgsl/semantic-group-thread-id.slang @@ -0,0 +1,9 @@ +//TEST:SIMPLE(filecheck=WGSL): -target wgsl -stage compute -entry main + +//WGSL-DAG: @builtin(local_invocation_id) +//WGSL-DAG: @compute + +void main(uint3 gtid : SV_GroupThreadID) +{ + // Empty compute shader +} diff --git a/tests/wgsl/semantic-instance-id.slang b/tests/wgsl/semantic-instance-id.slang new file mode 100644 index 000000000..868d9149d --- /dev/null +++ b/tests/wgsl/semantic-instance-id.slang @@ -0,0 +1,9 @@ +//TEST:SIMPLE(filecheck=WGSL): -target wgsl -stage vertex -entry main + +//WGSL-DAG: @builtin(instance_index) +//WGSL-DAG: @vertex + +float4 main(uint instanceID : SV_InstanceID) : SV_Position +{ + return float4(1,1,1,1); +} diff --git a/tests/wgsl/semantic-is-front-face.slang b/tests/wgsl/semantic-is-front-face.slang new file mode 100644 index 000000000..d79ab672b --- /dev/null +++ b/tests/wgsl/semantic-is-front-face.slang @@ -0,0 +1,9 @@ +//TEST:SIMPLE(filecheck=WGSL): -target wgsl -stage fragment -entry main + +//WGSL-DAG: @builtin(front_facing) +//WGSL-DAG: @fragment + +float4 main(bool isFront : SV_IsFrontFace) : SV_Target +{ + return float4(1,1,1,1); +} diff --git a/tests/wgsl/semantic-position.slang b/tests/wgsl/semantic-position.slang new file mode 100644 index 000000000..28c047a04 --- /dev/null +++ b/tests/wgsl/semantic-position.slang @@ -0,0 +1,16 @@ +//TEST:SIMPLE(filecheck=WGSL): -target wgsl -stage vertex -entry main + +//WGSL-DAG: @builtin(position) +//WGSL-DAG: @vertex + +struct S +{ + float4 position : SV_Position; +}; + +S main() +{ + S output; + output.position = float4(0,0,0,1); + return output; +} diff --git a/tests/wgsl/semantic-sample-index.slang b/tests/wgsl/semantic-sample-index.slang new file mode 100644 index 000000000..bd347d94f --- /dev/null +++ b/tests/wgsl/semantic-sample-index.slang @@ -0,0 +1,9 @@ +//TEST:SIMPLE(filecheck=WGSL): -target wgsl -stage fragment -entry main + +//WGSL-DAG: @builtin(sample_index) +//WGSL-DAG: @fragment + +float4 main(uint sampleIndex : SV_SampleIndex) : SV_Target +{ + return float4(1,1,1,1); +} diff --git a/tests/wgsl/semantic-vertex-id.slang b/tests/wgsl/semantic-vertex-id.slang new file mode 100644 index 000000000..4120dc098 --- /dev/null +++ b/tests/wgsl/semantic-vertex-id.slang @@ -0,0 +1,9 @@ +//TEST:SIMPLE(filecheck=WGSL): -target wgsl -stage vertex -entry main + +//WGSL-DAG: @builtin(vertex_index) +//WGSL-DAG: @vertex + +float4 main(uint vertexID : SV_VertexID) : SV_Position +{ + return float4(1,1,1,1); +} |
