pub struct Shader {
pub entry_name: String,
pub specialization_info: Option<SpecializationInfo>,
pub spirv: Vec<u8>,
pub stage: ShaderStageFlags,
/* private fields */
}Fields
entry_name: Stringspecialization_info: Option<SpecializationInfo>spirv: Vec<u8>stage: ShaderStageFlagsImplementations
sourceimpl Shader
impl Shader
pub fn new(stage: ShaderStageFlags, spirv: impl ShaderCode) -> ShaderBuilder
sourcepub fn new_any_hit(spirv: impl ShaderCode) -> ShaderBuilder
pub fn new_any_hit(spirv: impl ShaderCode) -> ShaderBuilder
Creates a new ray trace shader.
NOTE: May panic if the shader code is invalid.
sourcepub fn new_callable(spirv: impl ShaderCode) -> ShaderBuilder
pub fn new_callable(spirv: impl ShaderCode) -> ShaderBuilder
Creates a new ray trace shader.
NOTE: May panic if the shader code is invalid.
sourcepub fn new_closest_hit(spirv: impl ShaderCode) -> ShaderBuilder
pub fn new_closest_hit(spirv: impl ShaderCode) -> ShaderBuilder
Creates a new ray trace shader.
NOTE: May panic if the shader code is invalid.
sourcepub fn new_compute(spirv: impl ShaderCode) -> ShaderBuilder
pub fn new_compute(spirv: impl ShaderCode) -> ShaderBuilder
Creates a new compute shader.
NOTE: May panic if the shader code is invalid.
sourcepub fn new_fragment(spirv: impl ShaderCode) -> ShaderBuilder
pub fn new_fragment(spirv: impl ShaderCode) -> ShaderBuilder
Creates a new fragment shader.
NOTE: May panic if the shader code is invalid.
sourcepub fn new_geometry(spirv: impl ShaderCode) -> ShaderBuilder
pub fn new_geometry(spirv: impl ShaderCode) -> ShaderBuilder
Creates a new geometry shader.
NOTE: May panic if the shader code is invalid.
sourcepub fn new_intersection(spirv: impl ShaderCode) -> ShaderBuilder
pub fn new_intersection(spirv: impl ShaderCode) -> ShaderBuilder
Creates a new ray trace shader.
NOTE: May panic if the shader code is invalid.
sourcepub fn new_miss(spirv: impl ShaderCode) -> ShaderBuilder
pub fn new_miss(spirv: impl ShaderCode) -> ShaderBuilder
Creates a new ray trace shader.
NOTE: May panic if the shader code is invalid.
sourcepub fn new_ray_gen(spirv: impl ShaderCode) -> ShaderBuilder
pub fn new_ray_gen(spirv: impl ShaderCode) -> ShaderBuilder
Creates a new ray trace shader.
NOTE: May panic if the shader code is invalid.
sourcepub fn new_tesselation_ctrl(spirv: impl ShaderCode) -> ShaderBuilder
pub fn new_tesselation_ctrl(spirv: impl ShaderCode) -> ShaderBuilder
Creates a new tesselation control shader.
NOTE: May panic if the shader code is invalid.
sourcepub fn new_tesselation_eval(spirv: impl ShaderCode) -> ShaderBuilder
pub fn new_tesselation_eval(spirv: impl ShaderCode) -> ShaderBuilder
Creates a new tesselation evaluation shader.
NOTE: May panic if the shader code is invalid.
sourcepub fn new_vertex(spirv: impl ShaderCode) -> ShaderBuilder
pub fn new_vertex(spirv: impl ShaderCode) -> ShaderBuilder
Creates a new vertex shader.
NOTE: May panic if the shader code is invalid.
sourcepub fn attachments(
&self
) -> (impl Iterator<Item = u32> + '_, impl Iterator<Item = u32> + '_)
pub fn attachments(
&self
) -> (impl Iterator<Item = u32> + '_, impl Iterator<Item = u32> + '_)
Returns the input and write attachments of a shader.
pub fn descriptor_bindings(
&self,
device: &Device<impl SharedPointerKind>
) -> DescriptorBindingMap
pub fn merge_descriptor_bindings(
descriptor_bindings: impl IntoIterator<Item = DescriptorBindingMap>
) -> DescriptorBindingMap
pub fn push_constant_range(&self) -> Option<PushConstantRange>
pub fn vertex_input(&self) -> VertexInputState
Trait Implementations
sourceimpl From<ShaderBuilder> for Shader
impl From<ShaderBuilder> for Shader
sourcefn from(shader: ShaderBuilder) -> Self
fn from(shader: ShaderBuilder) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl RefUnwindSafe for Shader
impl Send for Shader
impl Sync for Shader
impl Unpin for Shader
impl UnwindSafe for Shader
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more