Trait gfx::pso::DataLink

source ·
pub trait DataLink<'a>: Sized {
    type Init: 'a;

    // Required methods
    fn new() -> Self;
    fn is_active(&self) -> bool;

    // Provided methods
    fn link_vertex_buffer(
        &mut self,
        _: BufferIndex,
        _: &Self::Init
    ) -> Option<VertexBufferDesc> { ... }
    fn link_input(
        &mut self,
        _: &AttributeVar,
        _: &Self::Init
    ) -> Option<Result<AttributeDesc, Format>> { ... }
    fn link_constant_buffer<'b>(
        &mut self,
        _: &'b ConstantBufferVar,
        _: &Self::Init
    ) -> Option<Result<ConstantBufferDesc, ElementError<&'b str>>> { ... }
    fn link_global_constant(
        &mut self,
        _: &ConstVar,
        _: &Self::Init
    ) -> Option<Result<(), CompatibilityError>> { ... }
    fn link_output(
        &mut self,
        _: &OutputVar,
        _: &Self::Init
    ) -> Option<Result<ColorTargetDesc, Format>> { ... }
    fn link_depth_stencil(&mut self, _: &Self::Init) -> Option<DepthStencilDesc> { ... }
    fn link_resource_view(
        &mut self,
        _: &TextureVar,
        _: &Self::Init
    ) -> Option<Result<ResourceViewDesc, Format>> { ... }
    fn link_unordered_view(
        &mut self,
        _: &UnorderedVar,
        _: &Self::Init
    ) -> Option<Result<UnorderedViewDesc, Format>> { ... }
    fn link_sampler(
        &mut self,
        _: &SamplerVar,
        _: &Self::Init
    ) -> Option<SamplerDesc> { ... }
    fn link_scissor(&mut self) -> bool { ... }
}
Expand description

The “link” logic portion of a PSO component. Defines the input data for the component.

Required Associated Types§

source

type Init: 'a

The assotiated “init” type - a member of the PSO “init” struct.

Required Methods§

source

fn new() -> Self

Create a new empty data link.

source

fn is_active(&self) -> bool

Check if this link is actually used by the shader.

Provided Methods§

Attempt to link with a vertex buffer containing multiple attributes.

Attempt to link with a vertex attribute.

Attempt to link with a constant buffer.

Attempt to link with a global constant.

Attempt to link with an output render target (RTV).

Attempt to link with a depth-stencil target (DSV).

Attempt to link with a shader resource (SRV).

Attempt to link with an unordered access (UAV).

Attempt to link with a sampler.

Attempt to enable scissor test.

Implementors§

source§

impl<'a> DataLink<'a> for RawConstantBuffer

§

type Init = &'a str

source§

impl<'a> DataLink<'a> for RawGlobal

§

type Init = &'a str

source§

impl<'a> DataLink<'a> for RawVertexBuffer

§

type Init = (&'a [(&'a str, Element<Format>)], u8, u8)

source§

impl<'a> DataLink<'a> for RawShaderResource

§

type Init = &'a str

source§

impl<'a> DataLink<'a> for Sampler

§

type Init = &'a str

source§

impl<'a> DataLink<'a> for BlendRef

§

type Init = ()

source§

impl<'a> DataLink<'a> for RawRenderTarget

source§

impl<'a> DataLink<'a> for Scissor

§

type Init = ()

source§

impl<'a, T> DataLink<'a> for ShaderResource<T>

§

type Init = &'a str

source§

impl<'a, T> DataLink<'a> for TextureSampler<T>

§

type Init = &'a str

source§

impl<'a, T> DataLink<'a> for UnorderedAccess<T>

§

type Init = &'a str

source§

impl<'a, T: BlendFormat> DataLink<'a> for BlendTarget<T>

§

type Init = (&'a str, ColorMask, Blend)

source§

impl<'a, T: DepthFormat> DataLink<'a> for DepthTarget<T>

§

type Init = Depth

source§

impl<'a, T: DepthStencilFormat> DataLink<'a> for DepthStencilTarget<T>

§

type Init = (Depth, Stencil)

source§

impl<'a, T: RenderFormat> DataLink<'a> for RenderTarget<T>

§

type Init = &'a str

source§

impl<'a, T: StencilFormat> DataLink<'a> for StencilTarget<T>

source§

impl<'a, T: ToUniform + Default> DataLink<'a> for Global<T>

§

type Init = &'a str

source§

impl<'a, T: Structure<Format>, I: ToInstanceRate + 'a> DataLink<'a> for VertexBufferCommon<T, I>

§

type Init = <I as ToInstanceRate>::Init

source§

impl<'a, T: Structure<ConstFormat>> DataLink<'a> for ConstantBuffer<T>

§

type Init = &'a str