pub struct StageSource {
pub source: String,
pub sources: Option<BTreeMap<String, String>>,
}Expand description
Source declaration for one stage of a Shader.
Provide either source (single platform) or sources (multi-platform).
When both are present, sources takes priority for the current platform.
Platform keys: "metal" (macOS), "hlsl" (Windows), "glsl" (Linux/Vulkan).
Fields§
§source: StringSingle-platform source path; used when sources is absent or lacks the current platform key.
sources: Option<BTreeMap<String, String>>Per-platform source paths keyed by "metal", "hlsl", or "glsl". Takes priority over source.
Implementations§
Source§impl StageSource
impl StageSource
Sourcepub fn source_for(&self, platform: Platform) -> Option<String>
pub fn source_for(&self, platform: Platform) -> Option<String>
Resolve the source filename platform selects from this stage’s
declared source / sources. Mirrors the build-time selection
(concinnity-cook authoring::source_args) so the hot-reload subsystem
picks the same source the build read. Returns None when the stage
declares nothing for that platform (e.g. a glsl-only stage asked for
Metal, which loads the embedded GLSL fallback at init and has no
on-disk file to hot-reload).
Trait Implementations§
Source§impl Clone for StageSource
impl Clone for StageSource
Source§fn clone(&self) -> StageSource
fn clone(&self) -> StageSource
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StageSource
impl Debug for StageSource
Source§impl Default for StageSource
impl Default for StageSource
Source§fn default() -> StageSource
fn default() -> StageSource
Source§impl<'de> Deserialize<'de> for StageSource
impl<'de> Deserialize<'de> for StageSource
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<StageSource, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<StageSource, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for StageSource
impl Serialize for StageSource
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for StageSource
impl RefUnwindSafe for StageSource
impl Send for StageSource
impl Sync for StageSource
impl Unpin for StageSource
impl UnsafeUnpin for StageSource
impl UnwindSafe for StageSource
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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 moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().