Platform

aether-platform

Multi-platform support with capability detection and quality profiles

The aether-platform crate provides multi-platform client support for Aether, including platform detection, capability profiling, quality presets, feature flags, performance budgets, and store compliance checks.

Overview

Aether runs on VR headsets, desktop, and mobile. This crate adapts the experience to each platform:

  • Platform detection that identifies the current device and its capabilities.
  • Quality profiles with preset configurations for different hardware tiers.
  • Feature flags to toggle platform-specific behavior at runtime.
  • Performance budgets that cap resource usage per platform class.
  • GPU tier classification for automatic graphics quality selection.
  • Store compliance checks for platform-specific distribution requirements.
  • WASM execution profiles for scripting on constrained devices.

Key Types

PlatformRuntime

The top-level runtime that evaluates platform capabilities and selects appropriate profiles.

use aether_platform::{PlatformRuntime, PlatformRuntimeConfig};

let config = PlatformRuntimeConfig::default();
let runtime = PlatformRuntime::new(config);

Platform

Represents a detected platform with its properties.

use aether_platform::{detect_platform, Platform, all_platforms};

let current = detect_platform();
let all = all_platforms(); // All known platform definitions

PlatformProfile

Describes a platform's input backend, quality class, and kind.

use aether_platform::{PlatformProfile, PlatformKind, QualityClass, InputBackend};

let profile = PlatformProfile {
    kind: PlatformKind::StandaloneVR,
    quality: QualityClass::Medium,
    input: InputBackend::OpenXR,
};

QualityProfile

A named collection of rendering and simulation quality settings.

use aether_platform::QualityProfile;

let profile = QualityProfile::medium();
// Includes render resolution, shadow quality, draw distance, etc.

FeatureFlags

Runtime-togglable feature flags for platform-specific behavior.

use aether_platform::{FeatureFlags, Feature};

let mut flags = FeatureFlags::new();
flags.enable(Feature::FoveatedRendering);
flags.disable(Feature::RayTracedShadows);
assert!(flags.is_enabled(Feature::FoveatedRendering));

PerformanceBudget

Defines resource limits for a platform tier.

use aether_platform::{PerformanceBudget, BudgetUsage, BudgetReport};

let budget = PerformanceBudget {
    max_draw_calls: 2000,
    max_triangles: 1_000_000,
    max_texture_memory_mb: 512,
    target_frame_time_ms: 11.1,
};

PlatformCapabilities

Describes hardware capabilities including GPU tier and supported features.

use aether_platform::{PlatformCapabilities, GpuTier};

let caps = PlatformCapabilities {
    gpu_tier: GpuTier::Mid,
    supports_compute: true,
    max_texture_size: 4096,
    supports_hand_tracking: false,
};

StoreCompliance

Checks compliance with platform store requirements for distribution.

use aether_platform::{StoreCompliance, StoreRegion};

let compliance = StoreCompliance::check(StoreRegion::Meta)?;

Usage Examples

Platform-Adaptive Configuration

use aether_platform::{
    detect_platform, PlatformProfile, QualityProfile,
    PerformanceBudget, FeatureFlags,
};

let platform = detect_platform();
let quality = QualityProfile::for_platform(&platform);
let budget = PerformanceBudget::for_platform(&platform);

let mut features = FeatureFlags::new();
if platform.capabilities.supports_hand_tracking {
    features.enable(Feature::HandTracking);
}

WASM Execution Mode

use aether_platform::{WasmProfile, WasmExecutionMode};

let wasm = WasmProfile {
    mode: WasmExecutionMode::Interpreted, // For constrained devices
    max_memory_mb: 64,
};