pub unsafe trait PipelineShaderData<T>: PipelineBase + ShaderData<T> {
type BoundShaderDataRepr;
unsafe fn bind_shader_data(
pipeline: &Self::PipelineRepr,
shader_data: &Self::ShaderDataRepr
) -> Result<Self::BoundShaderDataRepr, PipelineError>;
unsafe fn shader_data_binding(bound: &Self::BoundShaderDataRepr) -> u32;
}
Expand description
Operations that can be run on pipelines and shader data.
This trait requires PipelineBase
and ShaderData
.
Required Associated Types
Representation of a bound ShaderData
on the backend.
Required Methods
unsafe fn bind_shader_data(
pipeline: &Self::PipelineRepr,
shader_data: &Self::ShaderDataRepr
) -> Result<Self::BoundShaderDataRepr, PipelineError>
unsafe fn bind_shader_data(
pipeline: &Self::PipelineRepr,
shader_data: &Self::ShaderDataRepr
) -> Result<Self::BoundShaderDataRepr, PipelineError>
Bind a ShaderData
to the current Pipeline
.
This method must bind the shader data on the backend and return an object representing the bound shader data. Must
of the time, this bound representation will also implement Drop
so that backend resources are freed and
recycled on the next bind.
unsafe fn shader_data_binding(bound: &Self::BoundShaderDataRepr) -> u32
unsafe fn shader_data_binding(bound: &Self::BoundShaderDataRepr) -> u32
Get the u32
representation of the bound shader data, also known as binding.