Examples: GLFW+WebGPU: added support for WebGPU-native/Dawn (#7435, #7132)

This commit is contained in:
Elias Daler
2024-03-24 14:18:10 +01:00
committed by ocornut
parent b475309fa1
commit f9df6bf662
4 changed files with 188 additions and 16 deletions

View File

@@ -63,6 +63,10 @@
// Initialize the graphics adapter
{
if (!navigator.gpu) {
throw Error("WebGPU not supported.");
}
const adapter = await navigator.gpu.requestAdapter();
const device = await adapter.requestDevice();
Module.preinitializedWebGPUDevice = device;