1 <!-- This demo loosely based off of https://github.com/d3dcoder/d3d12book/tree/master/Chapter%2013%20The%20Compute%20Shader/Blur -->
5 <meta name="viewport" content="width=600">
6 <meta http-equiv="Content-type" content="text/html; charset=utf-8">
7 <title>WebGPU Compute</title>
8 <link rel="stylesheet" href="css/style.css">
11 font-family: system-ui;
13 background-color: rgb(13, 77, 153);
26 -webkit-appearance: none;
33 -webkit-transition: .2s;
34 transition: opacity .2s;
41 .slider::-webkit-slider-thumb {
42 -webkit-appearance: none;
47 background: rgb(66, 200, 255);
51 .slider::-moz-range-thumb {
55 background: rgb(66, 200, 255);
64 This demo uses the WebGPU compute pipeline to perform a Gaussian blur of the source image data. Use the slider to set the blur radius.
67 <div class="slidecontainer">
69 <input type="range" min="0" max="32" value="0" class="slider" id="radiusSlider">
77 <h2>WebGPU not available</h2>
79 Make sure you are on a system with WebGPU enabled. In
80 Safari, first make sure the Developer Menu is visible (Preferences →
81 Advanced), then Develop → Experimental Features → WebGPU.
84 <script src="scripts/compute-blur.js"></script>