Skip to main content

ShaderModule

Struct ShaderModule 

Source
pub struct ShaderModule {
    pub(crate) state: ResourceState<ShaderModuleState>,
    pub(crate) device: Arc<Device>,
    pub(crate) label: String,
    pub(crate) compilation_info: CompilationInfo,
}

Fields§

§state: ResourceState<ShaderModuleState>§device: Arc<Device>§label: String

The label from the descriptor used to create the resource.

§compilation_info: CompilationInfo

Implementations§

Source§

impl ShaderModule

Source

pub(crate) fn state(&self) -> Result<&ShaderModuleState, InvalidResourceError>

Source

pub(crate) fn invalid( device: Arc<Device>, label: String, compilation_info: CompilationInfo, ) -> Arc<Self>

Source

pub fn compilation_info(&self) -> &CompilationInfo

Source

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 resolves an Option<&str> ProgrammableStageDescriptor::entry_point value to the name of an entry point in self.

If entry_point is given, verify that self has an entry point by that name for stage, and then return the name as an owned String.

If entry_point is None, verify that self has exactly one entry point for stage, and return its name.

Passthrough modules do not record entry points’ stages, so for those, stage is ignored.

Trait Implementations§

Source§

impl Debug for ShaderModule

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for ShaderModule

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Labeled for ShaderModule

Source§

fn label(&self) -> &str

Returns a string identifying this resource for logging and errors. Read more
Source§

fn error_ident(&self) -> ResourceErrorIdent

Source§

impl ParentDevice for ShaderModule

Source§

fn device(&self) -> &Arc<Device>

Source§

fn is_equal(self: &Arc<Self>, other: &Arc<Self>) -> bool

Source§

fn same_device_as<O: ParentDevice>(&self, other: &O) -> Result<(), DeviceError>

Source§

fn same_device(&self, device: &Device) -> Result<(), DeviceError>

Source§

impl ResourceType for ShaderModule

Source§

const TYPE: &'static str = "ShaderModule"

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,