Struct spirv_cross2::compile::glsl::CompilerOptions

source ·
#[non_exhaustive]
pub struct CompilerOptions {
Show 13 fields pub common: CommonOptions, pub version: GlslVersion, pub vulkan_semantics: bool, pub seperate_shader_objects: bool, pub enable_420pack_extension: bool, pub support_nonzero_base_instance: bool, pub es_default_float_precision_highp: bool, pub es_default_int_precision_highp: bool, pub emit_push_constant_as_uniform_buffer: bool, pub emit_uniform_buffer_as_plain_uniforms: bool, pub force_flattened_io_blocks: bool, pub enable_row_major_load_workaround: bool, pub ovr_multiview_view_count: u32,
}
Available on crate feature glsl only.
Expand description

GLSL compiler options.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§common: CommonOptions

Compile options common to GLSL, HLSL, and MSL.

§version: GlslVersion

The GLSL version to output. The default is #version 450.

§vulkan_semantics: bool

If true, Vulkan GLSL features are used instead of GL-compatible features. Mostly useful for debugging SPIR-V files.

§seperate_shader_objects: bool

If true, gl_PerVertex is explicitly redeclared in vertex, geometry and tessellation shaders. The members of gl_PerVertex is determined by which built-ins are declared by the shader. This option is ignored in ES versions, as redeclaration in ES is not required, and it depends on a different extension (EXT_shader_io_blocks) which makes things a bit more fuzzy.

§enable_420pack_extension: bool

For older desktop GLSL targets than version 420, the GL_ARB_shading_language_420pack extensions is used to be able to support layout(binding) on UBOs and samplers. If disabled on older targets, binding decorations will be stripped.

The default is true.

§support_nonzero_base_instance: bool

If true, the backend will assume that InstanceIndex will need to apply a base instance offset. Set to false if you know you will never use base instance functionality as it might remove some internal uniforms.

§es_default_float_precision_highp: bool

If true, sets the default float precision in ES targets to highp, otherwise the default is mediump.

§es_default_int_precision_highp: bool

If false, sets the default float precision in ES targets to mediump, otherwise the default is highp.

§emit_push_constant_as_uniform_buffer: bool

In non-Vulkan GLSL, emit push constant blocks as UBOs rather than plain uniforms.

§emit_uniform_buffer_as_plain_uniforms: bool

Always emit uniform blocks as plain uniforms, regardless of the GLSL version, even when UBOs are supported. Does not apply to shader storage or push constant blocks.

§force_flattened_io_blocks: bool

In GLSL, force use of I/O block flattening, similar to what happens on legacy GLSL targets for blocks and structs.

§enable_row_major_load_workaround: bool

Loading row-major matrices from UBOs on older AMD Windows OpenGL drivers is problematic. To load these types correctly, we must generate a wrapper. them in a dummy function which only purpose is to ensure row_major decoration is actually respected. This workaround may cause significant performance degeneration on some Android devices.

§ovr_multiview_view_count: u32

If non-zero, controls layout(num_views = N) in; in GL_OVR_multiview2.

Trait Implementations§

source§

impl Debug for CompilerOptions

source§

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

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

impl Default for CompilerOptions

source§

fn default() -> Self

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

impl CompilerOptions for CompilerOptions

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.