pub struct FormatCostKey {
pub pixel_format: Option<PixelFormat>,
pub pixel_format_modifier: Option<PixelFormatModifier>,
pub buffer_usage_bits: Option<BufferUsage>,
/* private fields */
}
Expand description
Entries which have the same pixel_format, pixel_format_modifier, and required_usage_bits as a previous entry will override that previous entry. For matching purposes, an absent pixel_format_modifier matches LINEAR, and an absent required_buffer_usage_bits matches all-0 usage bits.
Fields§
§pixel_format: Option<PixelFormat>
The pixel_format and pixel_format_modifier are the format to which this FormatCost entry applies.
Must be set.
pixel_format_modifier: Option<PixelFormatModifier>
The pixel_format and pixel_format_modifier are the format to which this FormatCost entry applies.
Un-set is equivalent to LINEAR.
buffer_usage_bits: Option<BufferUsage>
If set, this entry is only considered if the buffer collection has at least these usage bits set.
The buffer collection has an aggregated BufferUsage which is the union of per-participant BufferUsage bits. FormatCost entries with additional set bits are ignored. Among the rest, the one with matching format and the most usage bits set determines the cost of that format for that buffer collection.
Then the lowest-cost format is chosen for that buffer collection among the formats that are mutually suppored by all the participants of that buffer collection.
The main intent of this field is to allow “waving off” a format that works, but doesn’t perform well, for a particular combination of usages. In that case the cost can be set high when the problematic combination of usage bits is set. The format will still be chosen if this format is the only mutually-supported format among the participants of the buffer collection.
Un-set is equivalent to zero usage bits set, meaning the entry applies to the format unless another entry with more specific usage applies.
It can be reasonable in some cases for all entries to omit this field, when/if format selection based on format cost alone, ignoring usage, is sufficient.
Trait Implementations§
Source§impl Clone for FormatCostKey
impl Clone for FormatCostKey
Source§fn clone(&self) -> FormatCostKey
fn clone(&self) -> FormatCostKey
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for FormatCostKey
impl Debug for FormatCostKey
Source§impl<D: ResourceDialect> Decode<FormatCostKey, D> for FormatCostKey
impl<D: ResourceDialect> Decode<FormatCostKey, D> for FormatCostKey
Source§impl Default for FormatCostKey
impl Default for FormatCostKey
Source§fn default() -> FormatCostKey
fn default() -> FormatCostKey
Source§impl<D: ResourceDialect> Encode<FormatCostKey, D> for &FormatCostKey
impl<D: ResourceDialect> Encode<FormatCostKey, D> for &FormatCostKey
Source§impl PartialEq for FormatCostKey
impl PartialEq for FormatCostKey
Source§impl TypeMarker for FormatCostKey
impl TypeMarker for FormatCostKey
Source§type Owned = FormatCostKey
type Owned = FormatCostKey
Source§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
Source§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align
.§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned
to a single memcpy. Read more§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned
to a single memcpy.Source§impl ValueTypeMarker for FormatCostKey
impl ValueTypeMarker for FormatCostKey
Source§type Borrowed<'a> = &'a FormatCostKey
type Borrowed<'a> = &'a FormatCostKey
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read moreimpl Persistable for FormatCostKey
impl StructuralPartialEq for FormatCostKey
Auto Trait Implementations§
impl Freeze for FormatCostKey
impl RefUnwindSafe for FormatCostKey
impl Send for FormatCostKey
impl Sync for FormatCostKey
impl Unpin for FormatCostKey
impl UnwindSafe for FormatCostKey
Blanket Implementations§
§impl<T> Body for Twhere
T: Persistable,
impl<T> Body for Twhere
T: Persistable,
§type MarkerAtTopLevel = T
type MarkerAtTopLevel = T
§type MarkerInResultUnion = T
type MarkerInResultUnion = T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)