Skip to content

Instantly share code, notes, and snippets.

@ccincotti3
Created December 5, 2022 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ccincotti3/ee1de986e66c2547d1501ea5cf5e8fd4 to your computer and use it in GitHub Desktop.
Save ccincotti3/ee1de986e66c2547d1501ea5cf5e8fd4 to your computer and use it in GitHub Desktop.
This is the code that we worked on in part one of the WebGPU YouTube Series.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Carmen's Fun WebGPU Triangle</title>
</head>
<body>
<canvas id="canvas-container"></canvas>
</body>
<script>
const gpu = navigator.gpu
if(!gpu){
console.error("Hey I didn't find WebGPU in this browser.")
}
const canvas = document.getElementById("canvas-container")
const context = canvas.getContext("webgpu")
if(!context){
console.error("Hey NO CANVAS CONTEXT FOUND!")
}
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment