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

@@ -76,5 +76,5 @@ export default (context, getInputs) => {
renderPass.endPass();
};
return makePass(ready, setSize, getOutputs, execute);
return makePass(getOutputs, ready, setSize, execute);
};

View File

@@ -161,5 +161,5 @@ export default (context, getInputs) => {
renderPass.endPass();
};
return makePass(ready, setSize, getOutputs, execute);
return makePass(getOutputs, ready, setSize, execute);
};

View File

@@ -193,5 +193,5 @@ export default (context, getInputs) => {
renderPass.endPass();
};
return makePass(ready, setSize, getOutputs, execute);
return makePass(getOutputs, ready, setSize, execute);
};

View File

@@ -83,5 +83,5 @@ export default (context, getInputs) => {
renderPass.endPass();
};
return makePass(ready, setSize, getOutputs, execute);
return makePass(getOutputs, ready, setSize, execute);
};

View File

@@ -125,5 +125,5 @@ export default (context, getInputs) => {
renderPass.endPass();
};
return makePass(ready, setSize, getOutputs, execute);
return makePass(getOutputs, ready, setSize, execute);
};

View File

@@ -80,10 +80,10 @@ const makeBindGroup = (device, pipeline, index, entries) =>
})),
});
const makePass = (ready, setSize, getOutputs, execute) => ({
const makePass = (getOutputs, ready, setSize, execute) => ({
getOutputs: getOutputs ?? (() => ({})),
ready: ready ?? Promise.resolve(),
setSize: setSize ?? (() => {}),
getOutputs: getOutputs ?? (() => ({})),
execute: execute ?? (() => {}),
});