pub struct TransientImageDesc {
pub extent: (u32, u32),
pub format: Format,
pub usage: ImageUsage,
pub samples: u32,
pub mip_levels: u32,
}Expand description
What a graph-owned image should be.
Deliberately smaller than ImageDesc: a transient is always a
single-layer 2D image and never has a caller-chosen label — the graph names
it. Fewer fields is fewer ways for two “identical” transients to fail to
alias.
Fields§
§extent: (u32, u32)Size in pixels.
format: FormatTexel format.
usage: ImageUsagePermitted uses.
samples: u32Samples per pixel; 1 for everything the MVP renders.
mip_levels: u32Mip levels. 1 for a plain render target; more for anything a pass
addresses one level of.
The pool used to hard-code 1 while
PassBuilder::use_subresource
happily barriered level 3, so the graph and the image disagreed about
how many levels existed. It is a field for that reason: the graph now
rejects a subresource the image does not have, and it can only do that
if the description says.
Implementations§
Source§impl TransientImageDesc
impl TransientImageDesc
Sourcepub const fn new(
extent: (u32, u32),
format: Format,
usage: ImageUsage,
) -> TransientImageDesc
pub const fn new( extent: (u32, u32), format: Format, usage: ImageUsage, ) -> TransientImageDesc
A single-mip, single-sample 2D image.
Sourcepub const fn with_mip_levels(self, mip_levels: u32) -> TransientImageDesc
pub const fn with_mip_levels(self, mip_levels: u32) -> TransientImageDesc
The same description with mip_levels levels.
Trait Implementations§
Source§impl Clone for TransientImageDesc
impl Clone for TransientImageDesc
Source§fn clone(&self) -> TransientImageDesc
fn clone(&self) -> TransientImageDesc
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more