plasma-arc / wgpu-state.js
p3nGu1nZz's picture
state to state
9905bd0
raw
history blame
851 Bytes
export function createState(config) {
return {
webgpu: {
device: null,
pipeline: null,
vertexBuffer: null,
indexBuffer: null,
uniformBuffer: null,
texture: null,
sampler: null,
bindGroup: null,
context: null,
presentationFormat: null,
},
matrices: {
uniformValues: new Float32Array(config.uniformBufferSize / 4),
matrix: null,
},
glyphs: {
numGlyphs: 0,
width: 0,
height: 0,
},
canvas: null,
timing: {
time: 0,
fixedDeltaTime: 1 / 60,
maxFrameTime: 0.25,
targetFps: 60,
frameDuration: 1000 / 60,
accumulator: 0,
}
};
}