Implements issue 3mi434slnsv2g
Changes #
metalmodule in theplatformcrate with Metal framework FFI bindings:MTLCreateSystemDefaultDevice()for obtaining the default GPUDevice,CommandQueue,CommandBuffer,RenderCommandEncoderwrapper typesMetalLayer(CAMetalLayer) with drawable size, pixel format, and device configurationmake_clear_pass_descriptor()helper for setting up render passesdrawable_texture()to extract the texture from a CAMetalDrawable
MetalViewinappkit.rs: customWeMetalViewNSView subclass using CAMetalLayer- Overrides
makeBackingLayerto provide CAMetalLayer - Overrides
updateLayerto render a clear-to-color pass via Metal - Full event handler support (key, mouse, scroll)
- Overrides
- Browser main.rs updated to try MetalView first, fall back to BitmapView
- Double-buffered presentation via
CAMetalLayer.nextDrawable - Drawable size updates on window resize
Tests #
6 new Metal tests covering:
- ClearColor and MetalSize struct construction
- Pixel format constants
- System default device creation
- Command queue creation
- CAMetalLayer creation and configuration
Dependencies #
Links Metal.framework and QuartzCore.framework. No external crate dependencies.
All new code is in the platform crate where unsafe is permitted.
Phase 12 — Metal GPU Compositor (1/7)