-
Notifications
You must be signed in to change notification settings - Fork 1
Commit 1833cf3
committed
Implement wgpu-hal bridge for Bevy zero-copy integration (Phase 3.1)
Created wgpu-hal bridge infrastructure for Bevy plugin:
**New Dependencies**
- wgpu-hal 27: Hardware abstraction layer
- wgpu-types 27: Type definitions for format/usage conversion
- bevy: Moved to main dependencies under 'bevy' feature
**New Module: src/bevy_plugin/wgpu_bridge.rs**
- Format conversion: Geyser TextureFormat ↔ wgpu_types::TextureFormat
- Usage conversion: Geyser TextureUsage ↔ wgpu_types::TextureUsages
- WgpuTextureHandle: Safe wrapper for imported textures
- WgpuBackendType: Platform discrimination (Vulkan/Metal/D3D12/GL)
- Bidirectional format mapping with 20+ texture formats
- 8-bit: RGBA8, BGRA8, sRGB variants, R8, RG8
- 16-bit: R16/RG16/RGBA16 float, R16 uint/sint
- 32-bit: R32/RG32/RGBA32 float/uint/sint
- Depth: Depth32Float, Depth24Plus, Depth24PlusStencil8
- HDR: RGB10A2, RG11B10
- Comprehensive unit tests for format/usage roundtrips
**Bridge Architecture**
- Platform-agnostic type system bridging Geyser ↔ wgpu
- External memory import foundation (marked NotImplemented)
- Designed for zero-copy texture sharing with Bevy render backend
**Updated Bevy Plugin**
- Export WgpuTextureHandle and WgpuBackendType
- Fixed Bevy 0.14 compatibility issues
- Image creation without RenderAssetUsages
- Extract system with proper types
- Removed unused imports
**Error Handling**
- Added GeyserError::UnsupportedFormat for unknown formats
- Added GeyserError::NotImplemented for WIP features
**Status: Phase 3.1 - Foundation Complete**
- ✅ wgpu-hal integration scaffolding
- ✅ Format/usage conversion layer
- ✅ Safe handle wrapper types
- ⏳ External memory import (next: actual wgpu device integration)
- ⏳ Bevy render resource bridging (next step)
Compiles cleanly with --features bevy,vulkan
All format conversion tests pass1 parent e6c27df commit 1833cf3Copy full SHA for 1833cf3
File tree
Expand file treeCollapse file tree
5 files changed
+379
-60
lines changedOpen diff view settings
Filter options
- src
- bevy_plugin
Expand file treeCollapse file tree
5 files changed
+379
-60
lines changedOpen diff view settings
0 commit comments