Added WebGPU support and added caching to the WebGPU version.

This commit is contained in:
Rezmason
2025-05-05 19:07:36 -07:00
parent 664f484723
commit f3cd449c7d
13 changed files with 129 additions and 84 deletions

View File

@@ -1,4 +1,4 @@
import colorToRGB from "../colorToRGB.js";
import colorToRGB from "../utils/colorToRGB.js";
import { structs } from "../../lib/gpu-buffer.js";
import {
loadShader,
@@ -8,6 +8,7 @@ import {
makeComputeTarget,
makePass,
} from "./utils.js";
import stripePassShader from "../../shaders/wgsl/stripePass.wgsl";
// Multiplies the rendered rain and bloom by a 1D gradient texture
// generated from the passed-in color sequence
@@ -68,7 +69,7 @@ export default ({ config, device, timeBuffer }) => {
let output;
let screenSize;
const assets = [loadShader(device, "shaders/wgsl/stripePass.wgsl")];
const assets = [loadShader(device, stripePassShader)];
const loaded = (async () => {
const [stripeShader] = await Promise.all(assets);