Add a runtime-disabled dialog element skeleton
[WebKit-https.git] / LayoutTests / webgpu / whlsl / use-undefined-variable.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../js/webgpu-functions.js"></script>
5 <script src="../../resources/js-test-pre.js"></script>
6 </head>
7 <body>
8 <script>
9 const shaderSource = `
10 [numthreads(1, 1, 1)]
11 compute void computeShader(device float[] buffer : register(u0), float3 threadID : SV_DispatchThreadID) {
12     float foo;
13     if (foo) {
14         x = x + 1;
15     }
16 }
17 `;
18
19 async function start() {
20     const adapter = await navigator.gpu.requestAdapter();
21     const device = await adapter.requestDevice();
22
23     const shaderModule = device.createShaderModule({code: shaderSource, isWHLSL: true});
24     const computeStage = {module: shaderModule, entryPoint: "computeShader"};
25
26     const bindGroupLayoutDescriptor = {bindings: [{binding: 0, visibility: 7, type: "storage-buffer"}]};
27     const bindGroupLayout = device.createBindGroupLayout(bindGroupLayoutDescriptor);
28     const pipelineLayoutDescriptor = {bindGroupLayouts: [bindGroupLayout]};
29     const pipelineLayout = device.createPipelineLayout(pipelineLayoutDescriptor);
30
31     const computePipelineDescriptor = {computeStage, layout: pipelineLayout};
32     const computePipeline = device.createComputePipeline(computePipelineDescriptor);
33 }
34
35 window.jsTestIsAsync = true;
36 getBasicDevice().then(function(device) {
37     start(device).then(function() {
38     testPassed("");
39         finishJSTest();
40     }, function() {
41         testFailed("");
42         finishJSTest();
43     });
44 }, function() {
45     testPassed("");
46     finishJSTest();
47 });
48 </script>
49 <script src="../../resources/js-test-post.js"></script>
50 </body>
51 </html>