Created
January 29, 2026 18:22
-
-
Save greggman/61eb5e34a5de57aba7271e5b9934b5b6 to your computer and use it in GitHub Desktop.
WebGPU: Crash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*bug-in-github-api-content-can-not-be-empty*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*bug-in-github-api-content-can-not-be-empty*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const device = await (await navigator.gpu.requestAdapter()).requestDevice() | |
| device.addEventListener('uncapturederror', e => console.error(e.error.message)); | |
| const canvas = document.createElement('canvas'); | |
| const context = canvas.getContext('webgpu'); | |
| context.configure({device, format: 'rgba8unorm'}) | |
| const texture = context.getCurrentTexture(); | |
| texture.label = 'canvas texture'; | |
| await new Promise(resolve => setTimeout(resolve, 500)); | |
| device.queue.writeTexture({texture},new Uint8Array(4), {}, [1]); | |
| await new Promise(resolve => setTimeout(resolve, 500)); | |
| device.queue.writeTexture({texture},new Uint8Array(4), {}, [1]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {"name":"WebGPU: Crash","settings":{},"filenames":["index.html","index.css","index.js"]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment