Moved the WebGPU code off of "std140" and onto gpu-uniforms.

This commit is contained in:
Rezmason
2021-11-08 02:23:33 -08:00
parent 8f226be368
commit 61a3a6d783
10 changed files with 82 additions and 202 deletions

View File

@@ -1,4 +1,4 @@
import std140 from "./std140.js";
import uniforms from "/lib/gpu-uniforms.js";
import { loadTexture, loadShader, makeUniformBuffer, makePassFBO, makePass } from "./utils.js";
// Multiplies the rendered rain and bloom by a loaded in image
@@ -10,9 +10,6 @@ export default (context, getInputs) => {
const { config, adapter, device, canvasContext } = context;
const ditherMagnitude = 0.05;
const configLayout = std140(["f32", "vec3<f32>"]);
const configBuffer = makeUniformBuffer(device, configLayout, [ditherMagnitude, config.backgroundColor]);
const linearSampler = device.createSampler({
magFilter: "linear",
minFilter: "linear",