mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-17 13:59:30 -07:00
Driving more uniforms.read calls from the actual shaders.
This commit is contained in:
@@ -13,10 +13,6 @@ const numVerticesPerQuad = 2 * 3;
|
||||
|
||||
export default (context, getInputs) => {
|
||||
const { config, adapter, device, canvasContext, timeBuffer } = context;
|
||||
const ditherMagnitude = 0.05;
|
||||
|
||||
const configUniforms = uniforms.read(`struct Config { ditherMagnitude : f32; backgroundColor: vec3<f32>; };`).Config;
|
||||
const configBuffer = makeUniformBuffer(device, configUniforms, { ditherMagnitude, backgroundColor: config.backgroundColor });
|
||||
|
||||
const linearSampler = device.createSampler({
|
||||
magFilter: "linear",
|
||||
@@ -36,6 +32,7 @@ export default (context, getInputs) => {
|
||||
const presentationFormat = canvasContext.getPreferredFormat(adapter);
|
||||
|
||||
let renderPipeline;
|
||||
let configBuffer;
|
||||
let output;
|
||||
|
||||
const assets = [loadShader(device, "shaders/wgsl/resurrectionPass.wgsl")];
|
||||
@@ -58,6 +55,9 @@ export default (context, getInputs) => {
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
const configUniforms = uniforms.read(resurrectionShader.code).Config;
|
||||
configBuffer = makeUniformBuffer(device, configUniforms, { ditherMagnitude: 0.05, backgroundColor: config.backgroundColor });
|
||||
})();
|
||||
|
||||
const setSize = (width, height) => {
|
||||
|
||||
Reference in New Issue
Block a user