feat(platform): Xbox GDK feasibility PoC - #658
Conversation
Add `xbox-gdk` feature flag and PoC infrastructure for Xbox GDK console support. This validates the engine's console porting approach using wgpu's DX12 backend with a custom platform backend. Changes: - New `xbox-gdk` Cargo feature (depends on wgpu-backend) - `XboxGdkPlatform` implementing `PlatformBackend` trait - `XboxWindowHandle` with raw-window-handle traits for wgpu DX12 surface - `WgpuBackend::new_from_raw_handle()` forcing DX12 backend - `WindowBackendKind::XboxGdk` variant and runtime pair validation - Expanded cfg gates to include xbox-gdk alongside native+wgpu-backend - Findings report documenting feasibility, blocking issues, and next steps On non-MSVC targets the platform constructor returns BackendNotSupported, allowing the full type system to be validated during cross-platform dev. Closes #334 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Prevent detect_best_backend from returning XboxGdk on non-MSVC hosts when both xbox-gdk and desktop-native features are enabled. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add #[allow(dead_code)] to XboxGdkPlatform struct and window_handle() - Add constructor test for non-MSVC BackendNotSupported error path - Narrow xbox_surface module visibility to pub(crate) - Add TODO(xbox-gdk) comment noting shared init refactor needed Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Claude finished @aram-devdocs's task in 2m 6s —— View job PR Review: feat(platform): Xbox GDK feasibility PoCTasks:
Verdict: APPROVED with warningsThe PoC is well-structured, properly feature-gated, and safe to merge. The architecture validates cleanly against the 5-layer model. No blockers. Phase 1 — Context
Phase 2 — Architecture Validation✅ Dependency flow is downward only. All new code lives in Layer 2 ( Phase 3 — Anti-Pattern Scan✅ No Phase 4 — Quality AssessmentPositive patterns:
Concerns noted in warnings below. Phase 5 — Security Review✅ All Phase 6 — Scope Verification✅ Changes match PR description precisely. BLOCKERS
WARNINGS
Positive Callouts
|
- Extract Xbox wgpu init into dedicated xbox_init.rs (init.rs: 613→336) - Add dispatch! macro to native_resources.rs (510→228 lines) - Regenerate ARCHITECTURE.md with xbox-gdk feature flag Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Overview
Type: feature
Summary:
Add Xbox GDK feasibility PoC infrastructure behind the
xbox-gdkfeature flag. Validates the engine's console porting approach using wgpu's DX12 backend with a custom platform backend and raw window handle wrapper. Includes a findings report documenting feasibility, blocking issues, and next steps.Related Issues: Closes #334
Changes Made
Engine Core (
goud_engine/src/)xbox-gdkfeature flag depending onwgpu-backendWindowBackendKindenum withXboxGdkvariant (behind#[cfg(feature = "xbox-gdk")])validate_native_backend_pairto accept(XboxGdk, Wgpu)pairdetect_best_backendwithtarget_env = "msvc"guard for Xbox auto-detectionnative_backend/submodules to includexbox-gdkas alternative tonative + wgpu-backendXboxGdkPlatformimplementingPlatformBackendtrait (stub constructors returnBackendNotSupportedpending GDK SDK)XboxWindowHandlewithraw-window-handletraits for wgpu DX12 surface creationWgpuBackend::new_from_raw_handle()forcing DX12 backend for XboxFFI Layer (
goud_engine/src/ffi/)No changes
C# SDK (
sdks/csharp/)No changes
Python SDK (
sdks/python/)No changes
TypeScript SDK (
sdks/typescript/)No changes
Codegen Pipeline (
codegen/)No changes
Proc Macros (
goud_engine_macros/)No changes
Tools (
tools/)No changes
WASM (
goud_engine/src/wasm/)No changes
Examples (
examples/)No changes
Documentation
docs/findings/xbox-gdk-poc.mdcovering feasibility assessment, blocking issues (DX12 linking, audio, input, shader signing), and recommended next stepsArchitectural Compliance
unsafeblocks have// SAFETY:commentsTesting
cargo testpasses (4722 tests, 0 failures)cargo clippy -- -D warningsis cleancargo clippy --features xbox-gdk -- -D warningsis cleancargo fmt --all -- --checkpassescargo check --features xbox-gdkpassescargo check(default features) unaffectedCode Quality
todo!()orunimplemented!()in production code#[allow(unused)]without justification commentResult, notunwrap()/expect()in library codeDocumentation
AGENTS.mdfiles — N/AREADME.md— N/ABreaking Changes
None
Version Bump
Bump type: none
Justification: Feature-gated PoC code, no public API surface change
Security
unsafeblocks each have a// SAFETY:comment and are necessaryPerformance
N/A — Feature-gated PoC code behind
xbox-gdkflag, not active in standard builds.Deployment
Reviewer Notes
new_xbox_asyncfunction ininit.rsintentionally duplicatesnew_asyncfor the PoC to avoid refactoring the existing init path. ATODO(xbox-gdk)comment marks this for extraction before promotion.XboxGdkPlatform::new()always returnsBackendNotSupported, allowing full type-checking on macOS/Linux.docs/findings/xbox-gdk-poc.mdidentifies 6 blocking issues with severity ratings, the most critical being wgpu'sd3d12.dllvs Xbox'sd3d12_xs.dlllinking gap.