How the shaderc-rs compilation workflow works
mainThe shaderc crate provides a high-level interface for shader compilation through three main components:
Compiler: The primary interface used to compile GLSL/HLSL source code into SPIR-V binary modules or assembly code, or to assemble SPIR-V assembly.CompileOptions: Used to adjust default compilation behavior, such as adding macro definitions.CompilationArtifact: Holds the successful results of a compilation (e.g., the binary SPIR-V or the text assembly).
Common tasks include compiling source code into SPIR-V binaries using compile_into_spirv or into assembly text using compile_into_spirv_assembly.