class FormatCostEntry
Defined at line 11076 of file fidling/gen/sdk/fidl/fuchsia.sysmem2/fuchsia.sysmem2/hlcpp/fuchsia/sysmem2/cpp/fidl.h
A FormatCostEntry can be used to influence which PixelFormatAndModifier is
chosen for a buffer collection, optionally taking BufferUsage into account.
The default cost is f32::MAX, so any specified cost with a non-MAX value
will prefer the specified format over any formats that don't have any
FormatCost entry.
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.
Board info sysmem_defaults entries are logically before platform sysmem
entries.
Sysmem uses the resulting aggregated list of FormatCostEntry(s) when
breaking ties among the set of formats which are supported by all
participants of a buffer collection. For each mutually-supported format,
entries with non-matching format are ignored, and entries with extra
buffer_usage_bits set are ignored. Among the remaining entries, the entry
with the most usage bits in common with the aggregated participant usages is
selected to determine the cost (if a tie, the later entry wins). Then the
format with the lowest cost is chosen. If it's still a tie (equal cost), the
tie is broken arbitrarily but not randomly.
This is not intended as a mechanism to disallow selection of a format that
is supported by all participants of a buffer collection. If a participant
claims support for a format but fails to handle that format correctly, it
should be fixed to handle that format correctly or changed to stop claiming
support for that format.
This mechanism is intended to influence format selection toward more
efficient formats with better performance, lower memory bandwidth usage,
etc, for a given set of usage bits, taking into account quirks that may be
unique to a given board or overall platform config.
Public Members
static const fidl_type_t * FidlType
Public Methods
bool IsEmpty ()
Returns whether no field is set.
const ::fuchsia::sysmem2::FormatCostKey & key ()
Must be set. If two entries have logically equal key (after field
defaults are applied), the later entry will override the earlier entry.
Defined at line 11084 of file fidling/gen/sdk/fidl/fuchsia.sysmem2/fuchsia.sysmem2/hlcpp/fuchsia/sysmem2/cpp/fidl.h
bool has_key ()
Defined at line 11088 of file fidling/gen/sdk/fidl/fuchsia.sysmem2/fuchsia.sysmem2/hlcpp/fuchsia/sysmem2/cpp/fidl.h
::fuchsia::sysmem2::FormatCostKey * mutable_key ()
Must be set. If two entries have logically equal key (after field
defaults are applied), the later entry will override the earlier entry.
Defined at line 11094 of file fidling/gen/sdk/fidl/fuchsia.sysmem2/fuchsia.sysmem2/hlcpp/fuchsia/sysmem2/cpp/fidl.h
void clear_key ()
Defined at line 11102 of file fidling/gen/sdk/fidl/fuchsia.sysmem2/fuchsia.sysmem2/hlcpp/fuchsia/sysmem2/cpp/fidl.h
const float & cost ()
Must be set. Lower costs win, but see also FormatCostKey fields re.
filtering entries by format and usage bits first.
When two entries (each with format supported by all the participants of
a buffer collection) have different costs, the lower cost entry (and its
format) is chosen.
For non-test scenarios, only use cost values > 0.0 (typically at least
1.0 as of this comment), with 0.0 and negative values reserved for
testing.
Defined at line 11120 of file fidling/gen/sdk/fidl/fuchsia.sysmem2/fuchsia.sysmem2/hlcpp/fuchsia/sysmem2/cpp/fidl.h
bool has_cost ()
Defined at line 11124 of file fidling/gen/sdk/fidl/fuchsia.sysmem2/fuchsia.sysmem2/hlcpp/fuchsia/sysmem2/cpp/fidl.h
float * mutable_cost ()
Must be set. Lower costs win, but see also FormatCostKey fields re.
filtering entries by format and usage bits first.
When two entries (each with format supported by all the participants of
a buffer collection) have different costs, the lower cost entry (and its
format) is chosen.
For non-test scenarios, only use cost values > 0.0 (typically at least
1.0 as of this comment), with 0.0 and negative values reserved for
testing.
Defined at line 11138 of file fidling/gen/sdk/fidl/fuchsia.sysmem2/fuchsia.sysmem2/hlcpp/fuchsia/sysmem2/cpp/fidl.h
void clear_cost ()
Defined at line 11146 of file fidling/gen/sdk/fidl/fuchsia.sysmem2/fuchsia.sysmem2/hlcpp/fuchsia/sysmem2/cpp/fidl.h
FormatCostEntry & set_key (::fuchsia::sysmem2::FormatCostKey _value)
FormatCostEntry & set_cost (float _value)
void FormatCostEntry ()
void FormatCostEntry (FormatCostEntry && other)
void ~FormatCostEntry ()
FormatCostEntry & operator= (FormatCostEntry && other)
::std::unique_ptr<FormatCostEntry> New ()
void Encode (::fidl::Encoder * _encoder, size_t _offset, std::optional< ::fidl::HandleInformation> maybe_handle_info)
void Decode (::fidl::Decoder * _decoder, FormatCostEntry * _value, size_t _offset)
zx_status_t Clone (FormatCostEntry * _result)