pub struct ValidatorOptions {
    pub relax_struct_store: bool,
    pub relax_logical_pointer: bool,
    pub before_legalization: bool,
    pub relax_block_layout: Option<bool>,
    pub uniform_buffer_standard_layout: bool,
    pub scalar_block_layout: bool,
    pub skip_block_layout: bool,
    pub max_limits: Vec<(ValidatorLimits, u32)>,
}

Fields§

§relax_struct_store: bool

Record whether or not the validator should relax the rules on types for stores to structs. When relaxed, it will allow a type mismatch as long as the types are structs with the same layout. Two structs have the same layout if

  1. the members of the structs are either the same type or are structs with same layout, and

  2. the decorations that affect the memory layout are identical for both types. Other decorations are not relevant.

§relax_logical_pointer: bool

Records whether or not the validator should relax the rules on pointer usage in logical addressing mode.

When relaxed, it will allow the following usage cases of pointers:

  1. OpVariable allocating an object whose type is a pointer type
  2. OpReturnValue returning a pointer value
§before_legalization: bool

Records whether or not the validator should relax the rules because it is expected that the optimizations will make the code legal.

When relaxed, it will allow the following:

  1. It will allow relaxed logical pointers. Setting this option will also set that option.
  2. Pointers that are pass as parameters to function calls do not have to match the storage class of the formal parameter.
  3. Pointers that are actaul parameters on function calls do not have to point to the same type pointed as the formal parameter. The types just need to logically match.
§relax_block_layout: Option<bool>

Records whether the validator should use “relaxed” block layout rules. Relaxed layout rules are described by Vulkan extension VK_KHR_relaxed_block_layout, and they affect uniform blocks, storage blocks, and push constants.

This is enabled by default when targeting Vulkan 1.1 or later. Relaxed layout is more permissive than the default rules in Vulkan 1.0.

§uniform_buffer_standard_layout: bool

Records whether the validator should use standard block layout rules for uniform blocks.

§scalar_block_layout: bool

Records whether the validator should use “scalar” block layout rules. Scalar layout rules are more permissive than relaxed block layout.

See Vulkan extnesion VK_EXT_scalar_block_layout. The scalar alignment is defined as follows:

  • scalar alignment of a scalar is the scalar size
  • scalar alignment of a vector is the scalar alignment of its component
  • scalar alignment of a matrix is the scalar alignment of its component
  • scalar alignment of an array is the scalar alignment of its element
  • scalar alignment of a struct is the max scalar alignment among its members

For a struct in Uniform, StorageClass, or PushConstant:

  • a member Offset must be a multiple of the member’s scalar alignment
  • ArrayStride or MatrixStride must be a multiple of the array or matrix scalar alignment
§skip_block_layout: bool

Records whether or not the validator should skip validating standard uniform/storage block layout.

§max_limits: Vec<(ValidatorLimits, u32)>

Applies a maximum to one or more Universal limits

Trait Implementations§

source§

impl Clone for ValidatorOptions

source§

fn clone(&self) -> ValidatorOptions

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for ValidatorOptions

source§

fn default() -> ValidatorOptions

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

impl From<ValidatorOptions> for Options

source§

fn from(vo: ValidatorOptions) -> Self

Converts to this type from the input type.

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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.