[][src]Trait rendy::shader::Shader

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

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

Required methods

fn spirv(&self) -> Result<Cow<[u8]>, Error>

Get spirv bytecode.

fn entry(&self) -> &str

Get the entry point of the shader.

fn stage(&self) -> ShaderStageFlags

Get the gfx_hal representation of this shaders kind/stage.

Loading content...

Provided methods

unsafe fn module<B>(
    &self,
    factory: &Factory<B>
) -> Result<<B as Backend>::ShaderModule, Error> 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]

Loading content...