forked from mirrors/gecko-dev
This is another WebGPU API update, it picks up a lot of changes that were made recently: - new bind group layout - new render pipeline descriptor - new vertex formats - limits - compressed texture formats - index format - query sets - and more small ones! It also brings in the updated `gfx/wgpu` to support these API changes. Differential Revision: https://phabricator.services.mozilla.com/D107013
43 lines
1.1 KiB
HTML
43 lines
1.1 KiB
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<meta charset='utf-8'>
|
|
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
|
</head>
|
|
<body>
|
|
<script>
|
|
|
|
ok(SpecialPowers.getBoolPref('dom.webgpu.enabled'), 'Pref should be enabled.');
|
|
|
|
const func = async function() {
|
|
const adapter = await navigator.gpu.requestAdapter();
|
|
const device = await adapter.requestDevice();
|
|
|
|
const texture = device.createTexture({
|
|
size: { width: 100, height: 100, depth: 1 },
|
|
format: "rgba8unorm",
|
|
usage: GPUTextureUsage.OUTPUT_ATTACHMENT,
|
|
});
|
|
const view = texture.createView();
|
|
|
|
const encoder = device.createCommandEncoder();
|
|
const pass = encoder.beginRenderPass({
|
|
colorAttachments: [{
|
|
attachment: view,
|
|
loadValue: { r: 0, g: 0, b: 0, a: 0 },
|
|
storeOp: "store",
|
|
}],
|
|
});
|
|
pass.endPass();
|
|
const command_buffer = encoder.finish();
|
|
device.queue.submit([command_buffer]);
|
|
ok(command_buffer !== undefined, 'command_buffer !== undefined');
|
|
};
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
func().finally(() => SimpleTest.finish());
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|