WebGPUStorageBuffer.js 469 B

12345678910111213141516171819202122
  1. import WebGPUBinding from './WebGPUBinding.js';
  2. class WebGPUStorageBuffer extends WebGPUBinding {
  3. constructor ( name, attribute ) {
  4. super( name );
  5. this.type = 'storage-buffer';
  6. this.usage = GPUBufferUsage.VERTEX | GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST;
  7. this.attribute = attribute;
  8. this.bufferGPU = null; // set by the renderer
  9. Object.defineProperty( this, 'isStorageBuffer', { value: true } );
  10. }
  11. }
  12. export default WebGPUStorageBuffer;