source/dawn/BufferManagerDawn.cpp
bool RingBufferDawn::reset(size_t size) {
  if (size > mSize)
    return false;

  mHead = 0;
  mTail = 0;

  wgpu::BufferDescriptor descriptor;
  descriptor.usage = wgpu::BufferUsage::MapWrite | wgpu::BufferUsage::CopySrc;
  descriptor.size = mSize;
  descriptor.mappedAtCreation = true;
  mBuf = mBufferManager->mContext->createBuffer(descriptor);
  mPixels = mBuf.GetMappedRange();

  return true;
}
// Reset current buffer and reuse the buffer.
Reset current buffer and reuse the buffer.
Reset current buffer and reuse the buffer .
bool RingBufferDawn::reset(size_t size) {
  if (size > mSize)
    return false;
  mHead = 0;
  mTail = 0;
  wgpu::BufferDescriptor descriptor;
  descriptor.usage = wgpu::BufferUsage::MapWrite | wgpu::BufferUsage::CopySrc;
  descriptor.size = mSize;
  descriptor.mappedAtCreation = true;
  mBuf = mBufferManager->mContext->createBuffer(descriptor);
  mPixels = mBuf.GetMappedRange();
  return true;
}
bool RingBufferDawn :: reset ( size_t size ) { if ( size > mSize ) return false ; mHead = 0 ; mTail = 0 ; wgpu :: BufferDescriptor descriptor ; descriptor . usage = wgpu :: BufferUsage :: MapWrite | wgpu :: BufferUsage :: CopySrc ; descriptor . size = mSize ; descriptor . mappedAtCreation = true ; mBuf = mBufferManager -> mContext -> createBuffer ( descriptor ) ; mPixels = mBuf . GetMappedRange ( ) ; return true ; }
Reset current buffer and reuse the buffer.
Reset current buffer and reuse the buffer .