WebGPU specifies that it is possible to run a render pipeline without a fragment shader, but attempting to do so fails the WHLSL compiler in GPUDevice.createRenderPipeline. Test file, run from LayoutTests/webgpu/whlsl: <!DOCTYPE html> <meta charset=utf-8> <title>WebGPU/WHLSL Playground</title> <body> <script src="js/test-harness.js"></script> <script src="../js/webgpu-functions.js"></script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <script> const whlslSource = ` vertex float4 vertexMain() : SV_Position { return float4(0, 0, 0, 0); } fragment float4 fragmentMain() : SV_Target 0 { return float4(0, 0, 0, 0); } `; let tests = {}; tests["GPURenderPipeline creation succeeds with no errors."] = async device => { const goodModule = device.createShaderModule({ code: whlslSource, isWHLSL: true }); const goodRenderPipelineDescriptor = { vertexStage: { module: goodModule, entryPoint: "vertexMain" }, // fragmentStage: { module: goodModule, entryPoint: "fragmentMain" }, primitiveTopology: "triangle-list", colorStates: [{ format: "bgra8unorm", alphaBlend: {}, colorBlend: {} }], vertexInput: { vertexBuffers: [] } }; device.pushErrorScope("validation"); device.createRenderPipeline(goodRenderPipelineDescriptor); return popNullError(device); }; runTestsWithDevice(tests); </script> </body>
Oh. This depends on https://bugs.webkit.org/show_bug.cgi?id=200046
WHLSL is no longer relevant.