Pulp
1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
device_quotas.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <
pulp/platform/device_capability.hpp
>
4
5
#include <compare>
6
#include <cstddef>
7
#include <cstdint>
8
29
namespace
pulp::format
{
30
32
enum class
PreviewQuality
: std::uint8_t {
34
Disabled
= 0,
36
Reduced
= 1,
38
Full
= 2,
39
};
40
54
struct
DeviceQuotas
{
56
std::uint32_t
max_voices
= 0;
58
std::uint32_t
max_nodes
= 0;
60
std::uint32_t
max_simultaneous_editors
= 0;
62
PreviewQuality
preview_quality
=
PreviewQuality::Disabled
;
63
64
constexpr
auto
operator<=>
(
const
DeviceQuotas
&)
const
=
default
;
65
};
66
67
namespace
detail
{
68
78
inline
constexpr
DeviceQuotas
79
kQuotaTable
[
platform::kDeviceCapabilityTierCount
][
platform::kThermalStateCount
] = {
80
// Constrained: Nominal, Fair, Serious, Critical
81
{
82
{16, 48, 1,
PreviewQuality::Reduced
},
83
{12, 40, 1,
PreviewQuality::Reduced
},
84
{8, 32, 1,
PreviewQuality::Reduced
},
85
{4, 16, 1,
PreviewQuality::Disabled
},
86
},
87
// Standard: Nominal, Fair, Serious, Critical
88
{
89
{64, 192, 2,
PreviewQuality::Full
},
90
{48, 160, 2,
PreviewQuality::Full
},
91
{32, 112, 1,
PreviewQuality::Reduced
},
92
{16, 64, 1,
PreviewQuality::Disabled
},
93
},
94
// Full: Nominal, Fair, Serious, Critical
95
{
96
{256, 768, 4,
PreviewQuality::Full
},
97
{192, 640, 3,
PreviewQuality::Full
},
98
{128, 448, 2,
PreviewQuality::Reduced
},
99
{64, 256, 1,
PreviewQuality::Disabled
},
100
},
101
};
102
103
}
// namespace detail
104
110
[[nodiscard]]
constexpr
DeviceQuotas
device_quotas
(
platform::DeviceCapabilityTier
tier,
111
platform::ThermalState
thermal) {
112
std::size_t tier_index =
static_cast<
std::size_t
>
(tier);
113
if
(tier_index >=
platform::kDeviceCapabilityTierCount
) {
114
tier_index = 0;
115
}
116
std::size_t thermal_index =
static_cast<
std::size_t
>
(thermal);
117
if
(thermal_index >=
platform::kThermalStateCount
) {
118
thermal_index =
platform::kThermalStateCount
- 1;
119
}
120
return
detail::kQuotaTable
[tier_index][thermal_index];
121
}
122
123
}
// namespace pulp::format
device_capability.hpp
pulp::format::detail
The plugin processor interface.
Definition
device_quotas.hpp:67
pulp::format::detail::kQuotaTable
constexpr DeviceQuotas kQuotaTable[platform::kDeviceCapabilityTierCount][platform::kThermalStateCount]
The quota table, indexed [tier][thermal state].
Definition
device_quotas.hpp:79
pulp::format
What the product grants a device: the quota table indexed by capability tier and live thermal state.
Definition
aax_editor.hpp:31
pulp::format::device_quotas
constexpr DeviceQuotas device_quotas(platform::DeviceCapabilityTier tier, platform::ThermalState thermal)
Returns the quotas granted at one tier under one live thermal state.
Definition
device_quotas.hpp:110
pulp::format::PreviewQuality
PreviewQuality
How much work a preview render may do, ascending in cost.
Definition
device_quotas.hpp:32
pulp::format::PreviewQuality::Reduced
@ Reduced
Decimated previews: coarser resolution, fewer passes.
Definition
device_quotas.hpp:36
pulp::format::PreviewQuality::Disabled
@ Disabled
Previews are not rendered; consumers show authored geometry only.
Definition
device_quotas.hpp:34
pulp::format::PreviewQuality::Full
@ Full
Full-detail previews.
Definition
device_quotas.hpp:38
pulp::platform::kDeviceCapabilityTierCount
constexpr std::size_t kDeviceCapabilityTierCount
Definition
device_capability.hpp:49
pulp::platform::DeviceCapabilityTier
DeviceCapabilityTier
How much of the product a device can carry, on one ascending ladder.
Definition
device_capability.hpp:43
pulp::platform::ThermalState
ThermalState
Live thermal pressure, ascending in heat.
Definition
device_capability.hpp:64
pulp::platform::kThermalStateCount
constexpr std::size_t kThermalStateCount
Definition
device_capability.hpp:71
pulp::format::DeviceQuotas
Ceilings a consumer may grant at one (tier, thermal state) cell.
Definition
device_quotas.hpp:54
pulp::format::DeviceQuotas::operator<=>
constexpr auto operator<=>(const DeviceQuotas &) const =default
pulp::format::DeviceQuotas::preview_quality
PreviewQuality preview_quality
Detail budget for preview rendering.
Definition
device_quotas.hpp:62
pulp::format::DeviceQuotas::max_nodes
std::uint32_t max_nodes
Nodes in the compiled render graph.
Definition
device_quotas.hpp:58
pulp::format::DeviceQuotas::max_voices
std::uint32_t max_voices
Simultaneously sounding voices across all instruments.
Definition
device_quotas.hpp:56
pulp::format::DeviceQuotas::max_simultaneous_editors
std::uint32_t max_simultaneous_editors
Editing surfaces held open against one document at once.
Definition
device_quotas.hpp:60
core
format
include
pulp
format
device_quotas.hpp
Generated by
1.15.0