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: bool

Debug option to always emit temporary variables for all expressions.

§flatten_multidimensional_arrays: bool

Flattens 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: bool

In vertex-like shaders, inverts gl_Position.y or equivalent.

§fixup_clipspace: bool

GLSL: 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: bool

Emit OpLine directives if present in the module. May not correspond exactly to original source, but should be a good approximation.

§force_zero_initialized_variables: bool

On 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: bool

In 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: bool

For 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.

Trait Implementations§

source§

impl Debug for CommonOptions

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for CommonOptions

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl CompilerOptions for CommonOptions

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.