WebGPUUniformBuffer constructor

WebGPUUniformBuffer(
  1. dynamic name, [
  2. dynamic buffer
])

Implementation

WebGPUUniformBuffer(name, [buffer]) : super(name) {
  this.bytesPerElement = Float32List.bytesPerElement;
  this.type = GPUBindingType.UniformBuffer;
  this.visibility = GPUShaderStage.Vertex | GPUShaderStage.Fragment;

  this.usage = GPUBufferUsage.Uniform | GPUBufferUsage.Storage | GPUBufferUsage.CopyDst;

  this.buffer = buffer;
  this.bufferGPU = null; // set by the renderer
}