fn compile_shader(glsl: &str, shader_kind: ShaderKind) -> Vec<u32> {
    let mut compiler = shaderc::Compiler::new().unwrap();

    let compiled_shader = compiler
        .compile_into_spirv(glsl, shader_kind, "unnamed", "main", None)
        .expect("Failed to compile shader");

    compiled_shader.as_binary().to_vec()
}
/// Compile some GLSL shader source to SPIR-V.
///
/// We tend to write shaders in high-level languages, but the GPU doesn't
/// work with that directly. Instead, we can convert it to an intermediate
/// representation: SPIR-V. This is more easily interpreted and optimized
/// by your graphics card. As an added bonus, this allows us to use the
/// same shader code across different backends.
Compile some GLSL shader source to SPIR-V.
We tend to write shaders in high-level languages, but the GPU doesn't
work with that directly. Instead, we can convert it to an intermediate
representation: SPIR-V. This is more easily interpreted and optimized
by your graphics card. As an added bonus, this allows us to use the
same shader code across different backends.
Compile some GLSL shader source to SPIR - V . We tend to write shaders in high - level languages but the GPU doesn ' t work with that directly . Instead we can convert it to an intermediate representation : SPIR - V . This is more easily interpreted and optimized by your graphics card . As an added bonus this allows us to use the same shader code across different backends .
fn compile_shader(glsl: &str, shader_kind: ShaderKind) -> Vec<u32> {
    let mut compiler = shaderc::Compiler::new().unwrap();
    let compiled_shader = compiler
        .compile_into_spirv(glsl, shader_kind, "unnamed", "main", None)
        .expect("Failed to compile shader");
    compiled_shader.as_binary().to_vec()
}
fn compile_shader ( glsl : & str , shader_kind : ShaderKind ) -> Vec < u32 > { let mut compiler = shaderc :: Compiler :: new ( ) . unwrap ( ) ; let compiled_shader = compiler . compile_into_spirv ( glsl , shader_kind , " " , " " , None ) . expect ( " " ) ; compiled_shader . as_binary ( ) . to_vec ( ) }
Compile some GLSL shader source to SPIR-V.
We tend to write shaders in high-level languages, but the GPU doesn't
work with that directly.
Compile some GLSL shader source to SPIR - V . We tend to write shaders in high - level languages but the GPU doesn ' t work with that directly .
glsl
&str
shader_kind
ShaderKind