pub trait BindSemantics<H = NoUniformBinder, C = Option<()>, U = Box<[u8]>, P = Box<[u8]>>where
C: Copy,
U: Deref<Target = [u8]> + DerefMut,
P: Deref<Target = [u8]> + DerefMut,
H: BindUniform<C, f32, Self::DeviceContext> + BindUniform<C, u32, Self::DeviceContext> + BindUniform<C, i32, Self::DeviceContext> + for<'b> BindUniform<C, &'b [f32; 4], Self::DeviceContext> + for<'b> BindUniform<C, &'b [f32; 16], Self::DeviceContext>,{
type InputTexture: TextureInput;
type SamplerSet;
type DescriptorSet<'a>;
type DeviceContext;
type UniformOffset: ContextOffset<H, C, Self::DeviceContext>;
// Required method
fn bind_texture<'a>(
descriptors: &mut Self::DescriptorSet<'a>,
samplers: &Self::SamplerSet,
binding: &TextureBinding,
texture: &Self::InputTexture,
device: &Self::DeviceContext,
);
// Provided method
fn bind_semantics<'a>(
device: &Self::DeviceContext,
sampler_set: &Self::SamplerSet,
uniform_storage: &mut UniformStorage<H, C, U, P, Self::DeviceContext>,
descriptor_set: &mut Self::DescriptorSet<'a>,
uniform_inputs: UniformInputs<'_>,
original: &Self::InputTexture,
source: &Self::InputTexture,
uniform_bindings: &FastHashMap<UniformBinding, Self::UniformOffset>,
texture_meta: &FastHashMap<Semantic<TextureSemantics>, TextureBinding>,
pass_outputs: impl Iterator<Item = Option<impl AsRef<Self::InputTexture>>>,
pass_feedback: impl Iterator<Item = Option<impl AsRef<Self::InputTexture>>>,
original_history: impl Iterator<Item = Option<impl AsRef<Self::InputTexture>>>,
lookup_textures: impl Iterator<Item = (usize, impl AsRef<Self::InputTexture>)>,
parameter_defaults: &FastHashMap<ShortString, ShaderParameter>,
runtime_parameters: &RuntimeParameters,
) { ... }
}
Expand description
Trait that abstracts binding of semantics to shader uniforms.
Required Associated Types§
Sourcetype InputTexture: TextureInput
type InputTexture: TextureInput
The type of the input texture used for semantic binding.
Sourcetype SamplerSet
type SamplerSet
The set of texture samplers available.
Sourcetype DescriptorSet<'a>
type DescriptorSet<'a>
The descriptor set or object that holds sampler and texture bindings.
Sourcetype DeviceContext
type DeviceContext
The device context containing the state of the graphics processor.
Sourcetype UniformOffset: ContextOffset<H, C, Self::DeviceContext>
type UniformOffset: ContextOffset<H, C, Self::DeviceContext>
The type of uniform offsets to use.
Required Methods§
Sourcefn bind_texture<'a>(
descriptors: &mut Self::DescriptorSet<'a>,
samplers: &Self::SamplerSet,
binding: &TextureBinding,
texture: &Self::InputTexture,
device: &Self::DeviceContext,
)
fn bind_texture<'a>( descriptors: &mut Self::DescriptorSet<'a>, samplers: &Self::SamplerSet, binding: &TextureBinding, texture: &Self::InputTexture, device: &Self::DeviceContext, )
Bind a texture to the input descriptor set
Provided Methods§
Sourcefn bind_semantics<'a>(
device: &Self::DeviceContext,
sampler_set: &Self::SamplerSet,
uniform_storage: &mut UniformStorage<H, C, U, P, Self::DeviceContext>,
descriptor_set: &mut Self::DescriptorSet<'a>,
uniform_inputs: UniformInputs<'_>,
original: &Self::InputTexture,
source: &Self::InputTexture,
uniform_bindings: &FastHashMap<UniformBinding, Self::UniformOffset>,
texture_meta: &FastHashMap<Semantic<TextureSemantics>, TextureBinding>,
pass_outputs: impl Iterator<Item = Option<impl AsRef<Self::InputTexture>>>,
pass_feedback: impl Iterator<Item = Option<impl AsRef<Self::InputTexture>>>,
original_history: impl Iterator<Item = Option<impl AsRef<Self::InputTexture>>>,
lookup_textures: impl Iterator<Item = (usize, impl AsRef<Self::InputTexture>)>,
parameter_defaults: &FastHashMap<ShortString, ShaderParameter>,
runtime_parameters: &RuntimeParameters,
)
fn bind_semantics<'a>( device: &Self::DeviceContext, sampler_set: &Self::SamplerSet, uniform_storage: &mut UniformStorage<H, C, U, P, Self::DeviceContext>, descriptor_set: &mut Self::DescriptorSet<'a>, uniform_inputs: UniformInputs<'_>, original: &Self::InputTexture, source: &Self::InputTexture, uniform_bindings: &FastHashMap<UniformBinding, Self::UniformOffset>, texture_meta: &FastHashMap<Semantic<TextureSemantics>, TextureBinding>, pass_outputs: impl Iterator<Item = Option<impl AsRef<Self::InputTexture>>>, pass_feedback: impl Iterator<Item = Option<impl AsRef<Self::InputTexture>>>, original_history: impl Iterator<Item = Option<impl AsRef<Self::InputTexture>>>, lookup_textures: impl Iterator<Item = (usize, impl AsRef<Self::InputTexture>)>, parameter_defaults: &FastHashMap<ShortString, ShaderParameter>, runtime_parameters: &RuntimeParameters, )
Write uniform and texture semantics to the provided storages.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.