pub(crate) fn load_shader(
    this: &Arc<RwLock<Self>>, code: &ShaderCode, shader_type: ShaderType,
  ) -> SarektResult<ShaderHandle<SL>> {
    let mut shader_store = this
      .write()
      .expect("Could not unlock ShaderStore due to previous panic");

    let shader_backend_handle = shader_store.shader_loader.load_shader(code)?;
    let inner_key = shader_store
      .loaded_shaders
      .insert(Shader::new(shader_backend_handle, shader_type));

    Ok(ShaderHandle {
      inner_key,
      shader_store: this.clone(),
    })
  }
/// Load a shader into the driver and return a handle.
Load a shader into the driver and return a handle.
Load a shader into the driver and return a handle .
pub(crate) fn load_shader(
    this: &Arc<RwLock<Self>>, code: &ShaderCode, shader_type: ShaderType,
  ) -> SarektResult<ShaderHandle<SL>> {
    let mut shader_store = this
      .write()
      .expect("Could not unlock ShaderStore due to previous panic");
    let shader_backend_handle = shader_store.shader_loader.load_shader(code)?;
    let inner_key = shader_store
      .loaded_shaders
      .insert(Shader::new(shader_backend_handle, shader_type));
    Ok(ShaderHandle {
      inner_key,
      shader_store: this.clone(),
    })
  }
pub ( crate ) fn load_shader ( this : & Arc < RwLock < Self > > , code : & ShaderCode , shader_type : ShaderType , ) -> SarektResult < ShaderHandle < SL > > { let mut shader_store = this . write ( ) . expect ( " " ) ; let shader_backend_handle = shader_store . shader_loader . load_shader ( code ) ? ; let inner_key = shader_store . loaded_shaders . insert ( Shader :: new ( shader_backend_handle , shader_type ) ) ; Ok ( ShaderHandle { inner_key , shader_store : this . clone ( ) , } ) }
Load a shader into the driver and return a handle.
Load a shader into the driver and return a handle .
this
&Arc<RwLock<Self>>
code
&ShaderCode
shader_type
ShaderType
this
&Arc<RwLock<Self>>
code
&ShaderCode
shader_type
ShaderType