[][src]Trait rendy_shader::Shader

pub trait Shader {
    type Error: Debug;
    fn spirv(&self) -> Result<Cow<[u32]>, Self::Error>;
fn entry(&self) -> &str;
fn stage(&self) -> ShaderStageFlags; unsafe fn module<B>(
        &self,
        factory: &Factory<B>
    ) -> Result<B::ShaderModule, ShaderError>
    where
        B: Backend
, { ... } }

Interface to create shader modules from shaders. Implemented for static shaders via [compile_to_spirv!] macro.

Associated Types

type Error: Debug

The error type returned by the spirv function of this shader.

Loading content...

Required methods

fn spirv(&self) -> Result<Cow<[u32]>, Self::Error>

Get spirv bytecode.

fn entry(&self) -> &str

Get the entry point of the shader.

fn stage(&self) -> ShaderStageFlags

Get the rendy_core::hal representation of this shaders kind/stage.

Loading content...

Provided methods

unsafe fn module<B>(
    &self,
    factory: &Factory<B>
) -> Result<B::ShaderModule, ShaderError> where
    B: Backend, 

Create shader module.

Spir-V bytecode must adhere valid usage on this Vulkan spec page: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/VkShaderModuleCreateInfo.html

Loading content...

Implementors

impl Shader for SpirvShader[src]

type Error = ShaderError

Loading content...