Add Metal GPU depth packet processor backend#1210
Open
mcakyurek wants to merge 1 commit intoOpenKinect:masterfrom
Open
Add Metal GPU depth packet processor backend#1210mcakyurek wants to merge 1 commit intoOpenKinect:masterfrom
mcakyurek wants to merge 1 commit intoOpenKinect:masterfrom
Conversation
Adds a new packet pipeline using Apple's Metal GPU compute framework for depth decoding on macOS, following the same structure as the existing OpenCL and CUDA backends. New files: - src/metal_depth_packet_processor.mm -- Host-side Objective-C++ implementation: device init, pipeline compilation, buffer management, and the four-stage dispatch loop (processPixelStage1, filterPixelStage1, processPixelStage2, filterPixelStage2). Loads default.metallib from alongside the dylib, falling back to the main bundle and device default library. - src/metal_depth_packet_processor.metal -- Metal Shading Language compute kernels ported from the OpenCL implementation. Uses non-uniform dispatchThreads for clean IMAGE_SIZE dispatch. Modified files: - CMakeLists.txt: ENABLE_METAL option (ON by default on Apple), xcrun metal/metallib custom commands to compile the Metal library, MetalShaders target, framework link flags, and install rule for default.metallib. - include/libfreenect2/config.h.in: LIBFREENECT2_WITH_METAL_SUPPORT cmake define. - include/libfreenect2/packet_pipeline.h: MetalPacketPipeline class declaration under LIBFREENECT2_WITH_METAL_SUPPORT guard. - include/internal/libfreenect2/depth_packet_processor.h: MetalDepthPacketProcessor class declaration. - src/packet_pipeline.cpp: MetalPacketPipeline constructor/destructor. - src/libfreenect2.cpp: "metal" pipeline name in createPacketPipelineByName(); Metal chosen as default on Apple when available. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a new packet pipeline using Apple's Metal GPU compute framework for depth decoding on macOS, following the same structure as the existing OpenCL and CUDA backends.
New files:
Modified files: