pub trait StreamMemory {
// Required methods
fn failure(&self, binding: &BufferBinding) -> Option<FailureId>;
fn taint(
&mut self,
binding: &BufferBinding,
failure: FailureId,
failures: &mut ErrorGraph,
);
fn written(&mut self, binding: &BufferBinding, failures: &mut ErrorGraph);
}Expand description
The memory a stream’s kernels see, for the taint bookkeeping.
Whether a buffer can be trusted lives on its allocation, inside one of the
stream’s memory managers. A backend supplies only which manager that is —
the one whose allocations back BufferBindings, never the auxiliary
staging or uniform managers — and everything the drivers do with the
answer lives on the shared wrappers.
The whole binding is passed rather than its memory handle because a
binding names a byte range of its allocation (BufferBinding::range),
and the claim is exactly that range: a launch that failed writing one
region of a buffer says nothing about the rest of it.
Required Methods§
Sourcefn failure(&self, binding: &BufferBinding) -> Option<FailureId>
fn failure(&self, binding: &BufferBinding) -> Option<FailureId>
The failure claiming any byte the binding names, if one does.
Sourcefn taint(
&mut self,
binding: &BufferBinding,
failure: FailureId,
failures: &mut ErrorGraph,
)
fn taint( &mut self, binding: &BufferBinding, failure: FailureId, failures: &mut ErrorGraph, )
Point the bytes binding names at failure.
Sourcefn written(&mut self, binding: &BufferBinding, failures: &mut ErrorGraph)
fn written(&mut self, binding: &BufferBinding, failures: &mut ErrorGraph)
The bytes binding names have a writer again: release every claim on
them, and only on them.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".