[−][src]Macro vk_shader_macros::include_glsl
Compile a GLSL source file into a binary SPIR-V constant
use vk_shader_macros::include_glsl; const VERT: &[u32] = include_glsl!("example.vert");
Due to limitations of proc macros, paths are resolved relative to the crate root.
Options
Compile options may be specified as additional arguments. Supported options include:
kind: <kind>
- Specify shader kind. Valid kinds are the same as the recognized file extensions:vert
,frag
,comp
,geom
,tesc
, andtese
. If omitted, kind is inferred from the file's extension, or a pragma in the source.version: <version>
- Specify GLSL version. If omitted, version must be specified in the source with#version
strip
- Omit debug info (set as default by enabling thestrip
feature)debug
- Force debug info, even with thestrip
feature enableddefine: <name> ["value"]
- Define the preprocessor macro<name>
asvalue
optimize: <level>
- Specify optimization level. Supported values are:zero
,size
, andperformance
. If omitted, will default toperformance
.target: <target>
- Specify target environment. Supported values:vulkan1_0
,vulkan1_1
,vulkan1_2
. Defaults tovulkan1_0
.