From 7aaf7009e2c6055a714ba4a93ab3dd73d2d2cdb7 Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Tue, 3 Dec 2024 03:45:04 +0800 Subject: Varying inputs and outputs for wgsl (#5669) Closes https://github.com/shader-slang/slang/issues/5067 New tests, covering what's declared supported in the WGSL support docs - tests/wgsl/semantic-coverage.slang - tests/wgsl/semantic-depth.slang - tests/wgsl/semantic-dispatch-thread-id.slang - tests/wgsl/semantic-group-id.slang - tests/wgsl/semantic-group-index.slang - tests/wgsl/semantic-group-thread-id.slang - tests/wgsl/semantic-instance-id.slang - tests/wgsl/semantic-is-front-face.slang - tests/wgsl/semantic-position.slang - tests/wgsl/semantic-sample-index.slang - tests/wgsl/semantic-vertex-id.slang WGSL enabled existing tests: - tests/compute/compile-time-loop.slang - tests/compute/constexpr.slang - tests/compute/discard-stmt.slang - tests/metal/nested-struct-fragment-input.slang - tests/metal/nested-struct-fragment-output.slang - tests/metal/nested-struct-multi-entry-point-vertex.slang - tests/metal/no-struct-vertex-output.slang - tests/metal/sv_target-complex-1.slang - tests/metal/sv_target-complex-2.slang - tests/bugs/texture2d-gather.hlsl - tests/render/cross-compile-entry-point.slang - tests/render/nointerpolation.hlsl - tests/render/render0.hlsl - tests/render/cross-compile0.hlsl - tests/render/imported-parameters.hlsl - tests/render/unused-discard.hlsl Can't be enabled due to missing wgsl features - tests/compute/texture-sampling.slang Co-authored-by: Yong He --- tests/metal/nested-struct-fragment-input.slang | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests/metal/nested-struct-fragment-input.slang') diff --git a/tests/metal/nested-struct-fragment-input.slang b/tests/metal/nested-struct-fragment-input.slang index 727b5b1e5..a8c94e888 100644 --- a/tests/metal/nested-struct-fragment-input.slang +++ b/tests/metal/nested-struct-fragment-input.slang @@ -1,5 +1,6 @@ //TEST:SIMPLE(filecheck=METAL): -target metal -stage fragment -entry fragmentMain //TEST:SIMPLE(filecheck=METALLIB): -target metallib -stage fragment -entry fragmentMain +//TEST:SIMPLE(filecheck=WGSL): -target wgsl -stage fragment -entry fragmentMain // METAL: COARSEVERTEX_7 // METAL: COARSEVERTEX_6 @@ -63,6 +64,16 @@ float4 fragmentMain(FragmentStageInput input) // METAL-DAG: {{.*}}->p3{{.*}}->p2{{.*}}->p1{{.*}}= // METAL-DAG: {{.*}}->p3{{.*}}->p3{{.*}}->p1{{.*}}= + // WGSL-DAG: {{.*}}._S{{.*}}= + + // WGSL-DAG: {{.*}}.p2{{.*}}._S{{.*}}= + // WGSL-DAG: {{.*}}.p2{{.*}}.p2{{.*}}._S{{.*}}= + // WGSL-DAG: {{.*}}.p2{{.*}}.p3{{.*}}._S{{.*}}= + + // WGSL-DAG: {{.*}}.p3{{.*}}._S{{.*}}= + // WGSL-DAG: {{.*}}.p3{{.*}}.p2{{.*}}._S{{.*}}= + // WGSL-DAG: {{.*}}.p3{{.*}}.p3{{.*}}._S{{.*}}= + outputBuffer[0] = input.coarseVertex.p1 + input.coarseVertex.p2.p1 + +input.coarseVertex.p3.p1; return float4(0, 0, 0, 0); } -- cgit v1.2.3