INNER CODE UNIT · JavaScript
BufferFactory
electronicarts/pbmpm · src/buffer_factory.js:19
export class BufferFactory
{
constructor(name, mode)
{
this.name = name;
this.mode = mode;
this.elements = []
this.compiled = false;
this.paddingCount = 0;
this.totalCount = 0;
}
// Add a parameter with the given name and type.
// The name is used as a key for binding data on the js side and
// also in the generated wgsl code.
add(name, type)
{
console.assert(!this.compiled);