pub struct ShaderModule {
pub(crate) state: ResourceState<ShaderModuleState>,
pub(crate) device: Arc<Device>,
pub(crate) label: String,
}Fields§
§state: ResourceState<ShaderModuleState>§device: Arc<Device>§label: StringThe label from the descriptor used to create the resource.
Implementations§
Source§impl ShaderModule
impl ShaderModule
pub(crate) fn state(&self) -> Result<&ShaderModuleState, InvalidResourceError>
pub(crate) fn invalid(device: Arc<Device>, label: String) -> Arc<Self>
Sourcepub(crate) fn finalize_entry_point_name(
&self,
stage: ShaderStage,
entry_point: Option<&str>,
) -> Result<String, StageError>
pub(crate) fn finalize_entry_point_name( &self, stage: ShaderStage, entry_point: Option<&str>, ) -> Result<String, StageError>
Select an entry point name, given an optional name and a shader stage.
This function takes care of turning the Option<&str>
ProgrammableStageDescriptor::entry_point into a specific name.
For non-passthrough shaders, if entry_point is Some, then return it
as a String. Otherwise, return the name of the unique entry point in
self’s module for stage; if there is not exactly one such entry
point, return an error.
The non-passthrough case counts on Interface::check_stage to verify
that an entry point with the given name actually exists.
For passthrough shaders, if entry_point is Some, verify that an
entry point by that name exists (returning an error if not), and return
it as a String. Otherwise, if entry_point is None, then check that
this module has exactly one entry point, and return its name.
Trait Implementations§
Source§impl Debug for ShaderModule
impl Debug for ShaderModule
Source§impl Drop for ShaderModule
impl Drop for ShaderModule
Source§impl Labeled for ShaderModule
impl Labeled for ShaderModule
Source§fn label(&self) -> &str
fn label(&self) -> &str
fn error_ident(&self) -> ResourceErrorIdent
Source§impl ParentDevice for ShaderModule
impl ParentDevice for ShaderModule
Source§impl ResourceType for ShaderModule
impl ResourceType for ShaderModule
Auto Trait Implementations§
impl Freeze for ShaderModule
impl !RefUnwindSafe for ShaderModule
impl Send for ShaderModule
impl Sync for ShaderModule
impl Unpin for ShaderModule
impl !UnwindSafe for ShaderModule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more