Skip to content

Weston-Wallace/zmw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zig Metal Wrapper

A Zig wrapper for Apple's Metal API, focusing on compute shaders.

Prerequisites

To use this library, you must have a macOS environment with Metal support.

Current Status

The wrapper provides a complete solution for Metal compute operations:

  • Metal initialization and cleanup
  • Device creation and name querying
  • Command queue creation
  • Buffer creation and memory management
  • Shader loading and compilation
  • Compute pipeline state creation
  • Command encoding and execution
  • Synchronous and asynchronous execution
  • Comprehensive error handling
  • Multiple example applications from simple to advanced

Usage Example (Current)

const std = @import("std");
const metal = @import("metal");

pub fn main() !void {
    var device = try metal.Device.createDefault();
    defer device.deinit();

    const name = try device.getName(allocator);
    defer allocator.free(name);

    std.debug.print("Metal device: {s}\n", .{name});
}

See the examples directory for more detailed examples.

About

Metal wrapper for the methods I need

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published