Browser Platform

SiliconGhetto is a WebGPU-based browser game engine. WebGPU is the default renderer. WebGL2 exists only as an automatic fallback when hardware WebGPU is unavailable or unsuitable.

No URL flag, query parameter, or user setting is required. The engine chooses the correct renderer during initialization.

Minimum Requirements

FeatureRequiredFallback
WebAssemblyYesNone
WebGPUPrimary/default rendererWebGL2 fallback
WebGL2Required only for fallbackNone
Web WorkersYesMain thread mode
OffscreenCanvasPreferredMain thread rendering
SharedArrayBufferOptionalSingle-threaded

Rendering Tiers

Tier 1: WebGPU

CapabilityRequirementResult
GPU APIHardware WebGPU adapter exposed by the browserPrimary renderer
Shader pathWGSL through wgpuFull engine feature path
Advanced GPU featuresAvailable according to adapter limitsHighest quality tiers where supported

Tier 2: WebGL2 Fallback

CapabilityRequirementResult
GPU APIWebGL2 context availableFallback renderer
WebGPU stateUnavailable, rejected, or software/fallback adapterAutomatic fallback
Feature setWebGL2-compatible shader and buffer limitsReduced renderer features

Not Supported

  • Browsers without WebAssembly support
  • Browsers without hardware WebGPU or WebGL2 support

Feature Detection

The engine detects GPU capabilities at initialization:

1. Request a WebGPU adapter
   - Hardware adapter found: use WebGPU
   - No adapter, rejected adapter, or software adapter: use WebGL2 fallback
2. Query device limits and features
3. Configure rendering pipelines from the selected backend

WebGPU Feature Path

These features require WebGPU and are unavailable on WebGL2:

  • Compute shaders
  • Storage textures
  • Timestamp queries for GPU profiling
  • Indirect draw calls

WebGL2 Fallback Limits

When running on WebGL2:

  • No compute shader support
  • Limited texture format support
  • No storage buffers
  • Some shader features are restricted

Cross-Origin Isolation

SiliconGhetto requires cross-origin isolation headers for full functionality:

Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp

Without these headers:

  • SharedArrayBuffer is unavailable
  • High-resolution timers may be restricted
  • Memory measurement APIs are unavailable

All deployment configurations include these headers. See ADR-003.

Mobile Support

Mobile browsers follow the same automatic renderer policy: hardware WebGPU first, WebGL2 fallback only when needed.

Mobile-specific considerations:

  • Touch input: Handled via the sg_input crate’s touch abstraction
  • Screen orientation: Games should handle both portrait and landscape
  • GPU thermal throttling: Runtime quality tiers adapt to sustained pressure
  • Memory constraints: Mobile devices may use lower asset quality or shorter draw distances

Testing Platform

# Build a demo
wasm-pack build demos/stress-lab --target web --out-dir www/pkg

# Serve with isolation headers
# Open in a target browser and check console diagnostics for backend info

The runtime diagnostics report:

  • GPU backend selected by the automatic policy
  • Device capabilities
  • Frame rate and performance metrics
  • Quality tier selection

Known Constraints

  • WebGL2 fallback has reduced rendering features compared with WebGPU.
  • Software WebGPU adapters are treated as unsuitable for gameplay and fall back to WebGL2 when available.
  • Browser GPU support changes over time, so the engine relies on runtime capability detection instead of hard-coded browser lists.