WebGPUStorageBuffer.js 529 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. Object.defineProperty( this, 'isStorageBuffer', { value: true } );
  11. }
  12. }
  13. export default WebGPUStorageBuffer;