Web Inspector: REGRESSION (r238602): Elements: deleting the last child of a collapsed...
[WebKit-https.git] / LayoutTests / webgpu / render-command-encoding.html
1 <!DOCTYPE html><!-- webkit-test-runner [ experimental:WebGPUEnabled=true ] -->
2 <meta charset=utf-8>
3 <title>Get the WebGPUDevice and ask for the WebGPUQueue</title>
4 <body>
5 <script src="../resources/testharness.js"></script>
6 <script src="../resources/testharnessreport.js"></script>
7 <script src="js/webgpu-functions.js"></script>
8 <script>
9 const shaders = `
10 #include <metal_stdlib>
11     
12 using namespace metal;
13
14 struct Vertex
15 {
16     float4 position [[position]];
17 };
18
19 vertex Vertex vertex_main()
20 {
21     return Vertex { float4(0, 0, 0, 1) };
22 }
23
24 fragment float4 fragment_main(Vertex vertexIn [[stage_in]])
25 {
26     return vertexIn.position;
27 }
28 `
29 promise_test(async () => {
30     const device = await getBasicDevice();
31
32     const canvas = document.createElement("canvas");
33     const swapChain = createBasicSwapChain(canvas, device);
34     const shaderModule = device.createShaderModule({ code: shaders });
35     const pipeline = createBasicPipeline(shaderModule, device);
36
37     const commandEncoder = device.createCommandEncoder();
38     assert_true(commandEncoder instanceof GPUCommandEncoder, "createCommandEncoder returned a GPUCommandEncoder");
39
40     const encoder = beginBasicRenderPass(swapChain, commandEncoder);
41     assert_true(encoder instanceof WebGPURenderPassEncoder, "beginRenderPass() returned a WebGPURenderPassEncoder");
42
43     encoder.setPipeline(pipeline);
44     encoder.endPass();
45 }, "WebGPURenderPassEncoder created and successfully ended");
46
47 </script>
48 </body>