/// Same as above but keeps the buffer in cpu accessible memory.  Useful for
/// things updated frequently like MVP uniforms.
Same as above but keeps the buffer in cpu accessible memory.  Useful for
things updated frequently like MVP uniforms.
Same as above but keeps the buffer in cpu accessible memory . Useful for things updated frequently like MVP uniforms .
pub(crate) fn load_buffer_without_staging<BufElem: Sized + Copy>(
    this: &Arc<RwLock<Self>>, buffer_type: BufferType, buffer: &[BufElem],
  ) -> SarektResult<(BufferImageHandle<BL>, BufferOrImage<BL::BackendHandle>)> {
    let mut buffer_store = this
      .write()
      .expect("Could not unlock BufferStore due to previous panic");
    let buffer_backend_handle = buffer_store
      .buffer_image_loader
      .load_buffer_without_staging(buffer_type, buffer)?;
    let buffer_or_image =
      BufferOrImage::new(buffer_backend_handle, ResourceType::Buffer(buffer_type));
    let inner_key = buffer_store
      .loaded_buffers_and_images
      .insert(buffer_or_image);
    Ok((
      BufferImageHandle {
        inner_key,
        resource_type: ResourceType::Buffer(buffer_type),
        buffer_store: Arc::downgrade(this),
      },
      buffer_or_image,
    ))
  }
pub ( crate ) fn load_buffer_without_staging < BufElem : Sized + Copy > ( this : & Arc < RwLock < Self > > , buffer_type : BufferType , buffer : & [ BufElem ] , ) -> SarektResult < ( BufferImageHandle < BL > , BufferOrImage < BL :: BackendHandle > ) > { let mut buffer_store = this . write ( ) . expect ( " " ) ; let buffer_backend_handle = buffer_store . buffer_image_loader . load_buffer_without_staging ( buffer_type , buffer ) ? ; let buffer_or_image = BufferOrImage :: new ( buffer_backend_handle , ResourceType :: Buffer ( buffer_type ) ) ; let inner_key = buffer_store . loaded_buffers_and_images . insert ( buffer_or_image ) ; Ok ( ( BufferImageHandle { inner_key , resource_type : ResourceType :: Buffer ( buffer_type ) , buffer_store : Arc :: downgrade ( this ) , } , buffer_or_image , ) ) }
Same as above but keeps the buffer in cpu accessible memory.
Same as above but keeps the buffer in cpu accessible memory .
this
&Arc<RwLock<Self>>
buffer_type
BufferType
buffer
&[BufElem]