test_set_bind_group_null.html (1054B)
1 <!doctype html> 2 <html> 3 <head> 4 <meta charset="utf-8" /> 5 <script src="/tests/SimpleTest/SimpleTest.js"></script> 6 <link rel="stylesheet" href="/tests/SimpleTest/test.css" /> 7 </head> 8 <body> 9 <script> 10 ok( 11 SpecialPowers.getBoolPref("dom.webgpu.enabled"), 12 "Pref should be enabled." 13 ); 14 15 const set_bind_group_null = async function () { 16 const adapter = await navigator.gpu.requestAdapter(); 17 ok(adapter !== undefined, "adapter !== undefined"); 18 const device = await adapter.requestDevice(); 19 ok(device !== undefined, "device !== undefined"); 20 21 const bundleEncoder = device.createRenderBundleEncoder({ 22 colorFormats: ["rgba8unorm"], 23 }); 24 bundleEncoder.setBindGroup(1, null); 25 ok(true, "Was able to set a bindGroup to null."); 26 }; 27 28 SimpleTest.waitForExplicitFinish(); 29 30 set_bind_group_null() 31 .catch(e => ok(false, `Unhandled exception ${e}`)) 32 .finally(() => SimpleTest.finish()); 33 </script> 34 </body> 35 </html>