pub struct BindingRef<'a, B> {
pub slot: u32,
pub buffer: &'a B,
pub range: BufferRange,
pub access: AccessMode,
}Expand description
One borrowed program binding. The referenced buffer must remain alive until its event is reclaimed.
Program-visible buffers carry BufferProperties::DIRECT_BINDING. A backend must reject an
incompatible buffer/program combination instead of copying the range into a hidden bounce
allocation. Binding order is not semantic; command engines may present the slice in slot order.
Before Accelerator::submit, hosts must reject an AccessMode incompatible with the
buffer’s declared BufferUsage (see Self::validate_for_submit).
Fields§
§slot: u32§buffer: &'a B§range: BufferRange§access: AccessModeImplementations§
Source§impl<'a, B> BindingRef<'a, B>
impl<'a, B> BindingRef<'a, B>
Sourcepub fn validate_for_submit(
bindings: &[Self],
descs: &[BufferDesc],
max_bindings: u32,
) -> Result<(), BackendError>
pub fn validate_for_submit( bindings: &[Self], descs: &[BufferDesc], max_bindings: u32, ) -> Result<(), BackendError>
Slot/count checks plus BufferDesc::allows_access for each binding.
Hosts must call this before Accelerator::submit. descs[i] must be the
descriptor for the buffer behind bindings[i].buffer (equal length alone is
not enough). A usage mismatch returns BackendError::PermissionDenied.