logo
pub enum ViewportState {
    Fixed {
        data: Vec<(Viewport, Scissor)>,
    },
    FixedViewport {
        viewports: Vec<Viewport>,
        scissor_count_dynamic: bool,
    },
    FixedScissor {
        scissors: Vec<Scissor>,
        viewport_count_dynamic: bool,
    },
    Dynamic {
        count: u32,
        viewport_count_dynamic: bool,
        scissor_count_dynamic: bool,
    },
}
Expand description

List of viewports and scissors that are used when creating a graphics pipeline object.

Note that the number of viewports and scissors must be the same.

Variants

Fixed

Fields

data: Vec<(Viewport, Scissor)>

State of the viewports and scissors.

The state is known in advance.

FixedViewport

Fields

viewports: Vec<Viewport>

State of the viewports.

scissor_count_dynamic: bool

Sets whether the scissor count is also dynamic, or only the scissors themselves.

If set to true, the device API version must be at least 1.3, or the extended_dynamic_state feature must be enabled on the device.

The state of viewports is known in advance, but the state of scissors is dynamic and will be set when drawing.

FixedScissor

Fields

scissors: Vec<Scissor>

State of the scissors.

viewport_count_dynamic: bool

Sets whether the viewport count is also dynamic, or only the viewports themselves.

If set to true, the device API version must be at least 1.3, or the extended_dynamic_state feature must be enabled on the device.

The state of scissors is known in advance, but the state of viewports is dynamic and will be set when drawing.

Dynamic

Fields

count: u32

Number of viewports and scissors.

This is ignored if both viewport_count_dynamic and scissor_count_dynamic are true.

viewport_count_dynamic: bool

Sets whether the viewport count is also dynamic, or only the viewports themselves.

If set to true, the device API version must be at least 1.3, or the extended_dynamic_state feature must be enabled on the device.

scissor_count_dynamic: bool

Sets whether the scissor count is also dynamic, or only the scissors themselves.

If set to true, the device API version must be at least 1.3, or the extended_dynamic_state feature must be enabled on the device.

The state of both the viewports and scissors is dynamic and will be set when drawing.

Implementations

Creates a ViewportState with fixed state and no viewports or scissors.

Creates a ViewportState with fixed state from the given viewports and scissors.

Creates a ViewportState with fixed state from the given viewports, and matching scissors that cover the whole viewport.

Creates a ViewportState with dynamic viewport, and a single scissor that always covers the whole viewport.

Creates a ViewportState with dynamic viewports and scissors, but a fixed count.

Creates a ViewportState with dynamic viewport count and scissor count.

Returns the number of viewports and scissors.

None is returned if both viewport_count_dynamic and scissor_count_dynamic are true.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.