Struct spirv_cross2::compile::CommonOptions
source · pub struct CommonOptions {
pub force_temporary: bool,
pub flatten_multidimensional_arrays: bool,
pub flip_vertex_y: bool,
pub fixup_clipspace: bool,
pub emit_line_directives: bool,
pub force_zero_initialized_variables: bool,
pub enable_storage_image_qualifier_deduction: bool,
pub relax_nan_checks: bool,
}Expand description
Compile options common to all backends.
Fields§
§force_temporary: boolDebug option to always emit temporary variables for all expressions.
flatten_multidimensional_arrays: boolFlattens multidimensional arrays, e.g. float foo[a][b][c] into single-dimensional arrays,
e.g. float foo[a * b * c].
This function does not change the actual type of any object.
Only the generated code, including declarations of interface variables
are changed to be single array dimension.
flip_vertex_y: boolIn vertex-like shaders, inverts gl_Position.y or equivalent.
fixup_clipspace: boolGLSL: In vertex-like shaders, rewrite [0, w] depth (Vulkan/D3D style) to [-w, w] depth (GL style). MSL: In vertex-like shaders, rewrite [-w, w] depth (GL style) to [0, w] depth. HLSL: In vertex-like shaders, rewrite [-w, w] depth (GL style) to [0, w] depth.
emit_line_directives: boolEmit OpLine directives if present in the module. May not correspond exactly to original source, but should be a good approximation.
force_zero_initialized_variables: boolOn some targets (WebGPU), uninitialized variables are banned. If this is enabled, all variables (temporaries, Private, Function) which would otherwise be uninitialized will now be initialized to 0 instead.
enable_storage_image_qualifier_deduction: boolIn cases where readonly/writeonly decoration are not used at all, we try to deduce which qualifier(s) we should actually used, since actually emitting read-write decoration is very rare, and older glslang/HLSL compilers tend to just emit readwrite as a matter of fact. The default (true) is to enable automatic deduction for these cases, but if you trust the decorations set by the SPIR-V, it’s recommended to set this to false.
relax_nan_checks: boolFor opcodes where we have to perform explicit additional nan checks, very ugly code is generated. If we opt-in, ignore these requirements. In opcodes like NClamp/NMin/NMax and FP compare, ignore NaN behavior. Use FClamp/FMin/FMax semantics for clamps and lets implementation choose ordered or unordered compares.