WebGPUStorageBuffer.js 514 B

1234567891011121314151617181920212223
  1. import WebGPUBinding from './WebGPUBinding.js';
  2. import { GPUBindingType } from './constants.js';
  3. class WebGPUStorageBuffer extends WebGPUBinding {
  4. constructor( name, attribute ) {
  5. super( name );
  6. this.type = GPUBindingType.StorageBuffer;
  7. this.usage = GPUBufferUsage.VERTEX | GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST;
  8. this.attribute = attribute;
  9. this.bufferGPU = null; // set by the renderer
  10. }
  11. }
  12. WebGPUStorageBuffer.prototype.isStorageBuffer = true;
  13. export default WebGPUStorageBuffer;