pub struct Library(/* private fields */);
Expand description
A PICA200 Shader Library (commonly called DVLB). This can be comprised of
one or more Entrypoint
s, but most commonly has one vertex shader and an
optional geometry shader.
This is the result of parsing a shader binary (.shbin
), and the resulting
Entrypoint
s can be used as part of a Program
.
Implementations§
source§impl Library
impl Library
sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, Box<dyn Error>>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, Box<dyn Error>>
Parse a new shader library from input bytes.
§Errors
An error is returned if the input data does not have an alignment of 4
(cannot be safely converted to &[u32]
).
sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Get the number of Entrypoint
s in this shader library.
sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Whether the library has any Entrypoint
s or not.
sourcepub fn get(&self, index: usize) -> Option<Entrypoint<'_>>
pub fn get(&self, index: usize) -> Option<Entrypoint<'_>>
Get the Entrypoint
at the given index, if present.