Bug 200056 - [WHLSL] A null fragment stage in GPURenderPipelineDescriptor should not fail WHLSL compilation
Summary: [WHLSL] A null fragment stage in GPURenderPipelineDescriptor should not fail ...
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGPU (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-23 16:17 PDT by Justin Fan
Modified: 2020-05-05 00:42 PDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Fan 2019-07-23 16:17:47 PDT
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>
Comment 1 Justin Fan 2019-07-23 16:18:25 PDT
Oh. This depends on https://bugs.webkit.org/show_bug.cgi?id=200046
Comment 2 Myles C. Maxfield 2020-05-05 00:42:46 PDT
WHLSL is no longer relevant.