Unifying the interfaces of regl and webgpu makePass and makePipeline.

This commit is contained in:
Rezmason
2021-11-09 09:17:01 -08:00
parent 6586badf42
commit 87c2093281
14 changed files with 55 additions and 68 deletions

View File

@@ -8,7 +8,7 @@ import { loadText, make1DTexture, makePassFBO, makePass } from "./utils.js";
// Downward-flowing glyphs should be tinted slightly blue on top and golden on the bottom
// Cheat a lens blur, interpolating between the texture and bloom at the edges
export default (regl, config, inputs) => {
export default ({ regl, config }, inputs) => {
const output = makePassFBO(regl, config.useHalfFloat);
const { backgroundColor } = config;
const resurrectionPassFrag = loadText("shaders/glsl/resurrectionPass.frag.glsl");
@@ -29,8 +29,8 @@ export default (regl, config, inputs) => {
{
primary: output,
},
() => render({ frag: resurrectionPassFrag.text() }),
null,
resurrectionPassFrag.loaded
resurrectionPassFrag.loaded,
(w, h) => output.resize(w, h),
() => render({ frag: resurrectionPassFrag.text() })
);
};