A little reorganization of methods in the passes.

This commit is contained in:
Rezmason
2021-11-10 18:10:26 -08:00
parent f4130013f4
commit dc4032e42a
4 changed files with 21 additions and 18 deletions

View File

@@ -30,6 +30,10 @@ export default (context, getInputs) => {
const bgURL = "bgURL" in config ? config.bgURL : defaultBGURL;
const assets = [loadTexture(device, bgURL), loadShader(device, "shaders/wgsl/imagePass.wgsl")];
const getOutputs = () => ({
primary: output,
});
const ready = (async () => {
const [bgTex, imageShader] = await Promise.all(assets);
@@ -57,10 +61,6 @@ export default (context, getInputs) => {
output = makePassFBO(device, width, height, canvasFormat);
};
const getOutputs = () => ({
primary: output,
});
const execute = (encoder) => {
const inputs = getInputs();
const tex = inputs.primary;