Struct Options

Source
pub struct Options {
    pub shader_model: ShaderModel,
    pub binding_map: BindingMap,
    pub fake_missing_bindings: bool,
    pub special_constants_binding: Option<BindTarget>,
    pub push_constants_target: Option<BindTarget>,
    pub sampler_heap_target: SamplerHeapBindTargets,
    pub sampler_buffer_binding_map: SamplerIndexBufferBindingMap,
    pub dynamic_storage_buffer_offsets_targets: DynamicStorageBufferOffsetsTargets,
    pub external_texture_binding_map: ExternalTextureBindingMap,
    pub zero_initialize_workgroup_memory: bool,
    pub restrict_indexing: bool,
    pub force_loop_bounding: bool,
}
Expand description

Configuration used in the Writer.

Fields§

§shader_model: ShaderModel

The hlsl shader model to be used

§binding_map: BindingMap

HLSL binding information for each Naga global variable.

This maps Naga GlobalVariable’s ResourceBindings to a BindTarget specifying its register number and space, along with other details necessary to generate a full HLSL declaration for it, or to access its value.

This must provide a BindTarget for every GlobalVariable in the Module that has a binding.

§fake_missing_bindings: bool

Don’t panic on missing bindings, instead generate any HLSL.

§special_constants_binding: Option<BindTarget>

Add special constants to SV_VertexIndex and SV_InstanceIndex, to make them work like in Vulkan/Metal, with help of the host.

§push_constants_target: Option<BindTarget>

HLSL binding information for the PushConstant global, if present.

If a module contains a global in the PushConstant address space, the dx12 backend stores its value directly in the root signature as a series of D3D12_ROOT_PARAMETER_TYPE_32BIT_CONSTANTS, whose binding information is given here.

§sampler_heap_target: SamplerHeapBindTargets

HLSL binding information for the sampler heap and comparison sampler heap.

§sampler_buffer_binding_map: SamplerIndexBufferBindingMap

Mapping of each bind group’s sampler index buffer to a bind target.

§dynamic_storage_buffer_offsets_targets: DynamicStorageBufferOffsetsTargets

Bind target for dynamic storage buffer offsets

§external_texture_binding_map: ExternalTextureBindingMap

HLSL binding information for External image global variables.

See ExternalTextureBindTarget for details.

§zero_initialize_workgroup_memory: bool

Should workgroup variables be zero initialized (by polyfilling)?

§restrict_indexing: bool

Should we restrict indexing of vectors, matrices and arrays?

§force_loop_bounding: bool

If set, loops will have code injected into them, forcing the compiler to think the number of iterations is bounded.

Implementations§

Trait Implementations§

Source§

impl Clone for Options

Source§

fn clone(&self) -> Options

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 Debug for Options

Source§

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

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

impl Default for Options

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for Options

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Hash for Options

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Options

Source§

fn eq(&self, other: &Options) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Options

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for Options

Source§

impl StructuralPartialEq for Options

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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,

Source§

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

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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,