diff options
| -rw-r--r-- | .github/workflows/ci.yml | 30 | ||||
| -rw-r--r-- | tests/render/check-backend-support-on-ci.slang | 20 |
2 files changed, 50 insertions, 0 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d9d0af87..4a2a76011 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -188,6 +188,36 @@ jobs: - name: Test Slang if: steps.filter.outputs.should-run == 'true' && matrix.platform != 'wasm' && (matrix.platform != 'aarch64' || matrix.os == 'macos') run: | + smokeResult=$("$bin_dir/slang-test" tests/render/check-backend-support-on-ci.slang) + supportedBackends="$(echo "$smokeResult" | grep 'Supported backends: ')" + + # LLVM is required to run the filecheck + echo "Checking llvm ..." && echo "$supportedBackends" | grep -q llvm + + if [[ "${{matrix.full-gpu-tests}}" == "true" ]] + then + for backend in fxc dxc glslang visualstudio genericcpp nvrtc metal tint # clang gcc + do + echo "Checking $backend ..." && echo "$supportedBackends" | grep -q "$backend" + done + for api in 'vk,vulkan' 'dx12,d3d12' 'dx11,d3d11' 'cuda' 'wgpu,webgpu' + do + echo "Checking $api ..." && echo "$smokeResult" | grep -q "Check $api: Supported" + done + fi + + if [[ "${{matrix.os}}" == "macos" ]] + then + for backend in metal + do + echo "Checking $backend ..." && echo "$supportedBackends" | grep -q "$backend" + done + for api in 'mtl,metal' + do + echo "Checking $api ..." && echo "$smokeResult" | grep -q "Check $api: Supported" + done + fi + export SLANG_RUN_SPIRV_VALIDATION=1 export SLANG_USE_SPV_SOURCE_LANGUAGE_UNKNOWN=1 if [[ "${{matrix.full-gpu-tests}}" == "true" ]]; then diff --git a/tests/render/check-backend-support-on-ci.slang b/tests/render/check-backend-support-on-ci.slang new file mode 100644 index 000000000..c0e2fbae3 --- /dev/null +++ b/tests/render/check-backend-support-on-ci.slang @@ -0,0 +1,20 @@ +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHK): -shaderobj -output-using-type + +//TEST_INPUT:ubuffer(data=[1.0 2.0 3.0 4.0], stride=4):name=gInput +RWStructuredBuffer<float> gInput; + +//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=gOutput +RWStructuredBuffer<float> gOutput; + +//CHK:1 +//CHK-NEXT:2 +//CHK-NEXT:3 +//CHK-NEXT:4 + +[Shader("compute")] +[NumThreads(4, 1, 1)] +void computeMain(int3 dispatchThreadID : SV_DispatchThreadID) +{ + uint tid = dispatchThreadID.x; + gOutput[tid] = gInput[tid]; +} |
