mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-18 22:29:28 -07:00
Unifying the interfaces of regl and webgpu makePass and makePipeline.
This commit is contained in:
@@ -4,7 +4,7 @@ import { loadImage, loadText, makePassFBO, makePass } from "./utils.js";
|
||||
|
||||
const defaultBGURL = "https://upload.wikimedia.org/wikipedia/commons/thumb/0/0a/Flammarion_Colored.jpg/917px-Flammarion_Colored.jpg";
|
||||
|
||||
export default (regl, config, inputs) => {
|
||||
export default ({ regl, config }, inputs) => {
|
||||
const output = makePassFBO(regl, config.useHalfFloat);
|
||||
const bgURL = "bgURL" in config ? config.bgURL : defaultBGURL;
|
||||
const background = loadImage(regl, bgURL);
|
||||
@@ -22,8 +22,8 @@ export default (regl, config, inputs) => {
|
||||
{
|
||||
primary: output,
|
||||
},
|
||||
() => render({ frag: imagePassFrag.text() }),
|
||||
null,
|
||||
[background.loaded, imagePassFrag.loaded]
|
||||
Promise.all([background.loaded, imagePassFrag.loaded]),
|
||||
(w, h) => output.resize(w, h),
|
||||
() => render({ frag: imagePassFrag.text() })
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user