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
The state is known in advance.
FixedViewport
Fields
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
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
sourceimpl ViewportState
impl ViewportState
sourcepub fn viewport_fixed_scissor_fixed(
data: impl IntoIterator<Item = (Viewport, Scissor)>
) -> Self
pub fn viewport_fixed_scissor_fixed(
data: impl IntoIterator<Item = (Viewport, Scissor)>
) -> Self
Creates a ViewportState
with fixed state from the given viewports and scissors.
sourcepub fn viewport_fixed_scissor_irrelevant(
data: impl IntoIterator<Item = Viewport>
) -> Self
pub fn viewport_fixed_scissor_irrelevant(
data: impl IntoIterator<Item = Viewport>
) -> Self
Creates a ViewportState
with fixed state from the given viewports, and matching scissors
that cover the whole viewport.
sourcepub fn viewport_dynamic_scissor_irrelevant() -> Self
pub fn viewport_dynamic_scissor_irrelevant() -> Self
Creates a ViewportState
with dynamic viewport, and a single scissor that always covers
the whole viewport.
sourcepub fn viewport_dynamic_scissor_dynamic(count: u32) -> Self
pub fn viewport_dynamic_scissor_dynamic(count: u32) -> Self
Creates a ViewportState
with dynamic viewports and scissors, but a fixed count.
sourcepub fn viewport_count_dynamic_scissor_count_dynamic() -> Self
pub fn viewport_count_dynamic_scissor_count_dynamic() -> Self
Creates a ViewportState
with dynamic viewport count and scissor count.
Trait Implementations
sourceimpl Clone for ViewportState
impl Clone for ViewportState
sourcefn clone(&self) -> ViewportState
fn clone(&self) -> ViewportState
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ViewportState
impl Debug for ViewportState
sourceimpl Default for ViewportState
impl Default for ViewportState
sourcefn default() -> Self
fn default() -> Self
Returns ViewportState::new()
.
Auto Trait Implementations
impl RefUnwindSafe for ViewportState
impl Send for ViewportState
impl Sync for ViewportState
impl Unpin for ViewportState
impl UnwindSafe for ViewportState
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more