Struct gfx::handle::Manager
[−]
[src]
pub struct Manager<R> where R: Resources {
// some fields omitted
}
Stores reference-counted resources used in a command buffer. Seals actual resource names behind the interface, automatically referencing them both by the Factory on resource creation and the Renderer during CommandBuffer population.
Methods
impl<R> Manager<R> where R: Resources
fn new() -> Manager<R>
Create a new handle manager
fn clear(&mut self)
Clear all references
fn extend(&mut self, other: &Manager<R>)
Extend with all references of another handle manager
fn count(&self) -> usize
Count the total number of referenced resources
fn ref_buffer(&mut self, handle: &'a RawBuffer<R>) -> &'a R::Buffer
Reference a buffer
fn ref_shader(&mut self, handle: &'a Shader<R>) -> &'a R::Shader
Reference a shader
fn ref_program(&mut self, handle: &'a Program<R>) -> &'a R::Program
Reference a program
fn ref_pso(&mut self, handle: &'a RawPipelineState<R>) -> (&'a R::PipelineStateObject, &'a R::Program)
Reference a pipeline state object
fn ref_texture(&mut self, handle: &'a RawTexture<R>) -> &'a R::Texture
Reference a texture
fn ref_srv(&mut self, handle: &'a RawShaderResourceView<R>) -> &'a R::ShaderResourceView
Reference a shader resource view
fn ref_uav(&mut self, handle: &'a RawUnorderedAccessView<R>) -> &'a R::UnorderedAccessView
Reference an unordered access view
fn ref_rtv(&mut self, handle: &'a RawRenderTargetView<R>) -> &'a R::RenderTargetView
Reference an RTV
fn ref_dsv(&mut self, handle: &'a RawDepthStencilView<R>) -> &'a R::DepthStencilView
Reference a DSV
fn ref_sampler(&mut self, handle: &'a Sampler<R>) -> &'a R::Sampler
Reference a sampler
fn ref_fence(&mut self, fence: &'a Fence<R>) -> &'a R::Fence
Reference a fence
Trait Implementations
impl<R> Producer<R> for Manager<R> where R: Resources
fn make_buffer(&mut self, res: R::Buffer, info: BufferInfo) -> RawBuffer<R>
fn make_shader(&mut self, res: R::Shader) -> Shader<R>
fn make_program(&mut self, res: R::Program, info: ProgramInfo) -> Program<R>
fn make_pso(&mut self, res: R::PipelineStateObject, program: &Program<R>) -> RawPipelineState<R>
fn make_texture(&mut self, res: R::Texture, desc: Descriptor) -> RawTexture<R>
fn make_buffer_srv(&mut self, res: R::ShaderResourceView, buf: &RawBuffer<R>) -> RawShaderResourceView<R>
fn make_texture_srv(&mut self, res: R::ShaderResourceView, tex: &RawTexture<R>) -> RawShaderResourceView<R>
fn make_buffer_uav(&mut self, res: R::UnorderedAccessView, buf: &RawBuffer<R>) -> RawUnorderedAccessView<R>
fn make_texture_uav(&mut self, res: R::UnorderedAccessView, tex: &RawTexture<R>) -> RawUnorderedAccessView<R>
fn make_rtv(&mut self, res: R::RenderTargetView, tex: &RawTexture<R>, dim: (u16, u16, u16, AaMode)) -> RawRenderTargetView<R>
fn make_dsv(&mut self, res: R::DepthStencilView, tex: &RawTexture<R>, dim: (u16, u16, u16, AaMode)) -> RawDepthStencilView<R>
fn make_sampler(&mut self, res: R::Sampler, info: SamplerInfo) -> Sampler<R>
fn make_fence(&mut self, res: R::Fence) -> Fence<R>
fn clean_with<T, A, B, C, D, E, F, G, H, I, J, K>(&mut self, param: &mut T, fa: A, fb: B, fc: C, fd: D, fe: E, ff: F, fg: G, fh: H, fi: I, fj: J, fk: K) where A: Fn(&mut T, &R::Buffer) -> (), B: Fn(&mut T, &R::Shader) -> (), C: Fn(&mut T, &R::Program) -> (), D: Fn(&mut T, &R::PipelineStateObject) -> (), E: Fn(&mut T, &R::Texture) -> (), F: Fn(&mut T, &R::ShaderResourceView) -> (), G: Fn(&mut T, &R::UnorderedAccessView) -> (), H: Fn(&mut T, &R::RenderTargetView) -> (), I: Fn(&mut T, &R::DepthStencilView) -> (), J: Fn(&mut T, &R::Sampler) -> (), K: Fn(&mut T, &R::Fence) -> ()
Walk through all the handles, keep ones that are reference elsewhere and call the provided delete function (resource-specific) for others Read more