Trait librashader_runtime::binding::BindSemantics
source · 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> + BindUniform<C, u32> + BindUniform<C, i32> + for<'b> BindUniform<C, &'b [f32; 4]> + for<'b> BindUniform<C, &'b [f32; 16]>,{
type InputTexture: TextureInput;
type SamplerSet;
type DescriptorSet<'a>;
type DeviceContext;
type UniformOffset: ContextOffset<H, C>;
// 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>,
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<String, ShaderParameter>,
runtime_parameters: &FastHashMap<String, f32>
) { ... }
}
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>
type UniformOffset: ContextOffset<H, C>
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>,
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<String, ShaderParameter>,
runtime_parameters: &FastHashMap<String, f32>
)
fn bind_semantics<'a>( device: &Self::DeviceContext, sampler_set: &Self::SamplerSet, uniform_storage: &mut UniformStorage<H, C, U, P>, 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<String, ShaderParameter>, runtime_parameters: &FastHashMap<String, f32> )
Write uniform and texture semantics to the provided storages.
Object Safety§
This trait is not object safe.