GLSL (glslangValidator) and Slang shader compilation, pure-MoonBit SPIR-V reflection, and PPM/BMP image loading helpers for Tycho
pub suberror ShaderError {
CompileFailed(ShaderStage, String)
SlangFailed(String, String)
LoadFailed(String, String)
}pub(all) struct ReflectedBinding {
set : Int
binding : Int
kind : ReflectedDescriptorKind
count : Int
name : String
} derive(Eq, Debug)pub(all) struct ReflectedVertexInput {
location : Int
format : ReflectedVertexFormat
name : String
} derive(Eq, Debug)pub(all) struct SpirvReflection {
stage : ReflectedStage
entry_point : String
vertex_inputs : Array[ReflectedVertexInput]
bindings : Array[ReflectedBinding]
push_constant_size : Int
color_output_count : Int
local_size : (Int, Int, Int)
}fn compile_shader_checked(source : String, stage : ShaderStage) -> FixedArray[UInt] raise ShaderErrorfn compile_shader_env(source : String, stage : ShaderStage, target : ShaderTarget) -> FixedArray[UInt]fn compile_shader_file_checked(path : String, stage : ShaderStage) -> FixedArray[UInt] raise ShaderErrorfn compile_shader_file_env(path : String, stage : ShaderStage, target : ShaderTarget) -> FixedArray[UInt]fn compile_shader_file_env_checked(path : String, stage : ShaderStage, target : ShaderTarget) -> FixedArray[UInt] raise ShaderErrorfn last_error() -> Stringfn load_spirv(path : String) -> FixedArray[UInt]fn save_png(path : String, width : Int, height : Int, rgba : FixedArray[Byte], bgra? : Bool) -> BoolInstall
Download zipGLSL (glslangValidator) and Slang shader compilation, pure-MoonBit SPIR-V reflection, and PPM/BMP image loading helpers for Tycho