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
4
5#include <compare>
6#include <cstddef>
7#include <cstdint>
8
29namespace pulp::format {
30
32enum class PreviewQuality : std::uint8_t {
38 Full = 2,
39};
40
56 std::uint32_t max_voices = 0;
58 std::uint32_t max_nodes = 0;
60 std::uint32_t max_simultaneous_editors = 0;
63
64 constexpr auto operator<=>(const DeviceQuotas&) const = default;
65};
66
67namespace detail {
68
78inline constexpr DeviceQuotas
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
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
The plugin processor interface.
Definition device_quotas.hpp:67
constexpr DeviceQuotas kQuotaTable[platform::kDeviceCapabilityTierCount][platform::kThermalStateCount]
The quota table, indexed [tier][thermal state].
Definition device_quotas.hpp:79
What the product grants a device: the quota table indexed by capability tier and live thermal state.
Definition aax_editor.hpp:31
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
PreviewQuality
How much work a preview render may do, ascending in cost.
Definition device_quotas.hpp:32
@ Reduced
Decimated previews: coarser resolution, fewer passes.
Definition device_quotas.hpp:36
@ Disabled
Previews are not rendered; consumers show authored geometry only.
Definition device_quotas.hpp:34
@ Full
Full-detail previews.
Definition device_quotas.hpp:38
constexpr std::size_t kDeviceCapabilityTierCount
Definition device_capability.hpp:49
DeviceCapabilityTier
How much of the product a device can carry, on one ascending ladder.
Definition device_capability.hpp:43
ThermalState
Live thermal pressure, ascending in heat.
Definition device_capability.hpp:64
constexpr std::size_t kThermalStateCount
Definition device_capability.hpp:71
Ceilings a consumer may grant at one (tier, thermal state) cell.
Definition device_quotas.hpp:54
constexpr auto operator<=>(const DeviceQuotas &) const =default
PreviewQuality preview_quality
Detail budget for preview rendering.
Definition device_quotas.hpp:62
std::uint32_t max_nodes
Nodes in the compiled render graph.
Definition device_quotas.hpp:58
std::uint32_t max_voices
Simultaneously sounding voices across all instruments.
Definition device_quotas.hpp:56
std::uint32_t max_simultaneous_editors
Editing surfaces held open against one document at once.
Definition device_quotas.hpp:60