pub struct BindTarget {
pub space: u8,
pub register: u32,
pub binding_array_size: Option<u32>,
pub dynamic_storage_buffer_offsets_index: Option<u32>,
pub restrict_indexing: bool,
}
Expand description
Direct3D 12 binding information for a global variable.
This type provides the HLSL-specific information Naga needs to declare and
access an HLSL global variable that cannot be derived from the Module
itself.
An HLSL global variable declaration includes details that the Direct3D API will use to refer to it. For example:
RWByteAddressBuffer s_sasm : register(u0, space2);
This defines a global s_sasm
that a Direct3D root signature would refer to
as register 0
in register space 2
in a UAV
descriptor range. Naga can
infer the register’s descriptor range type from the variable’s address class
(writable Storage
variables are implemented by Direct3D Unordered Access
Views, the u
register type), but the register number and register space
must be supplied by the user.
The back::hlsl::Options
structure provides BindTarget
s for various
situations in which Naga may need to generate an HLSL global variable, like
binding_map
for Naga global variables, or push_constants_target
for
a module’s sole PushConstant
variable. See those fields’ documentation
for details.
Fields§
§space: u8
§register: u32
For regular bindings this is the register number.
For sampler bindings, this is the index to use into the bind group’s sampler index buffer.
binding_array_size: Option<u32>
If the binding is an unsized binding array, this overrides the size.
dynamic_storage_buffer_offsets_index: Option<u32>
This is the index in the buffer at Options::dynamic_storage_buffer_offsets_targets
.
restrict_indexing: bool
This is a hint that we need to restrict indexing of vectors, matrices and arrays.
If Options::restrict_indexing
is also true
, we will restrict indexing.
Trait Implementations§
Source§impl Clone for BindTarget
impl Clone for BindTarget
Source§fn clone(&self) -> BindTarget
fn clone(&self) -> BindTarget
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for BindTarget
impl Debug for BindTarget
Source§impl Default for BindTarget
impl Default for BindTarget
Source§fn default() -> BindTarget
fn default() -> BindTarget
Source§impl<'de> Deserialize<'de> for BindTarget
impl<'de> Deserialize<'de> for BindTarget
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Hash for BindTarget
impl Hash for BindTarget
Source§impl PartialEq for BindTarget
impl PartialEq for BindTarget
Source§impl Serialize for BindTarget
impl Serialize for BindTarget
impl Copy for BindTarget
impl Eq for BindTarget
impl StructuralPartialEq for BindTarget
Auto Trait Implementations§
impl Freeze for BindTarget
impl RefUnwindSafe for BindTarget
impl Send for BindTarget
impl Sync for BindTarget
impl Unpin for BindTarget
impl UnwindSafe for BindTarget
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.