WebGPUStorageBuffer.js 417 B

1234567891011121314151617181920
  1. import WebGPUBuffer from './WebGPUBuffer.js';
  2. import { GPUBindingType } from './constants.js';
  3. class WebGPUStorageBuffer extends WebGPUBuffer {
  4. constructor( name, attribute ) {
  5. super( name, GPUBindingType.StorageBuffer, attribute.array );
  6. this.isStorageBuffer = true;
  7. this.usage |= GPUBufferUsage.VERTEX | GPUBufferUsage.STORAGE;
  8. this.attribute = attribute;
  9. }
  10. }
  11. export default WebGPUStorageBuffer;