Swift ports of Apple's Objective-C / C++ sample code

Last update: Jul 20, 2022

MetalSampleCodeSwift

Swift ports of Apple's Objective-C / C++ sample code

Metal is a great API, but it can feel inaccessible for Swift developers due to all the samples being written in C++ or Objective-C.

Swift's more concise syntax and reduced boilerplate can also make the code a lot more readable.

Most game developers are coming from C++ so I understand why the samples are in C++ / Objective-C, but the goal of this project is to port all of the Metal samples so that App developers can also learn metal without such a large barrier to entry.

In the first pass only the macOS targets will be ported as the other targets add a lot of clutter, and the code is being tested on Apple Silicon and may not work on Intel.

Samples ported so far Original sample
Performing Calculations on a GPU link
Using Metal to Draw a View’s Contents link
Using a Render Pipeline to Render Primitives link
Synchronizing CPU and GPU Work link
Creating and Sampling Textures link
Calculating Primitive Visibility Using Depth Testing link
Customizing Render Pass Setup link
Encoding Indirect Command Buffers on the CPU link
Encoding Indirect Command Buffers on the GPU link
Managing groups of resources with argument buffers link
Adjusting the level of detail using Metal mesh shaders link
Accelerating ray tracing using Metal link

GitHub

https://github.com/jonmhobson/MetalSampleCodeSwift
You might also like...

Source code for iOS app "Photos for VK" — albums and photos manager for social network VKontakte

Source code for iOS app

VK Photos (formally Photos for VK) VK Photos is an iOS app for manage albums and photos in social network VKontakte (vk.com) Screenshots Disclaimer ⚠️

Feb 10, 2022

A very useful and unique iOS library to open image picker in just few lines of code.

A very useful and unique iOS library to open image picker in just few lines of code.

ImagePickerEasy A very simple solution to implement UIImagePickerController() in your application. Requirements Swift 4.2 and above Installation Image

May 13, 2022

The frontend (phone) code for the e-mission server

e-mission phone app This is the phone component of the e-mission system. ✨ This has now been upgraded to cordova [email protected] and [email protected] (details)

Jun 22, 2022

API surface for Swift plug-ins using the Swift Plugin Manager

SwiftPlugin The minimal API surface required for the Swift Plugin Manager to create instances from a loaded plugin. Additional documentation and refer

Mar 25, 2022

Contentful.swift : Swift Delivery SDK for Contentful

Contentful.swift : Swift Delivery SDK for Contentful

contentful.swift - Swift Delivery SDK for Contentful Swift SDK for the Contentfu

Jan 6, 2022

Swift Package Manager command plugin for Swift-DocC

Swift-DocC Plugin The Swift-DocC plugin is a Swift Package Manager command plugin that supports building documentation for SwiftPM libraries and execu

Aug 5, 2022

Agrume - 🍋 An iOS image viewer written in Swift with support for multiple images.

Agrume - 🍋 An iOS image viewer written in Swift with support for multiple images.

Agrume An iOS image viewer written in Swift with support for multiple images. Requirements Swift 5.0 iOS 9.0+ Xcode 10.2+ Installation Use Swift Packa

Aug 1, 2022

BlockiesSwift - Unique blocky identicons generator for Swift

BlockiesSwift - Unique blocky identicons generator for Swift

⚗️ BlockiesSwift This library is a Swift implementation of the Ethereum fork of Blockies which is intended to be used in iOS, watchOS, tvOS and macOS

Jul 18, 2022
Related tags
AirPodsMotionAPI - Test Swift's AirPods Motion API in this sample project

AirPods Motion API Overview Swift provides an AirPods motion API that works on s

Jul 18, 2022
Sample app to open parking lot gates by phone calls
Sample app to open parking lot gates by phone calls

DouzePointCinq - Test app Sample iOS app to open parking lot gates by phone calls. Screenshots (dark & light modes) How to use Clone the project git c

Oct 29, 2021
FlightTicketBrowser - A SwiftUI sample app for flight ticket browser
FlightTicketBrowser - A SwiftUI sample app for flight ticket browser

FlightTicketBrowser This app is a SwiftUI sample app for flight ticket browser.

May 23, 2022
BeatboxiOS - A sample implementation for merging multiple video files and/or image files using AVFoundation

MergeVideos This is a sample implementation for merging multiple video files and

Feb 24, 2022
SwiftGen is a tool to automatically generate Swift code for resources of your projects (like images, localised strings, etc), to make them type-safe to use.
SwiftGen is a tool to automatically generate Swift code for resources of your projects (like images, localised strings, etc), to make them type-safe to use.

SwiftGen is a tool to automatically generate Swift code for resources of your projects (like images, localised strings, etc), to make them type-safe to use.

Aug 7, 2022
A simple macOS app to read code from images, written purely in Swift using Vision Framework.
A simple macOS app to read code from images, written purely in Swift using Vision Framework.

CodeReader A simple macOS app to read code from images, written purely in Swift using Vision Framework. Usage Drag an image Click the convert button R

Jul 31, 2022
A better way to operate QR Code in Swift, support iOS, macOS, watchOS and tvOS.
A better way to operate QR Code in Swift, support iOS, macOS, watchOS and tvOS.

EFQRCode is a lightweight, pure-Swift library for generating stylized QRCode images with watermark or icon, and for recognizing QRCode from images, in

Aug 8, 2022
Scan the MRZ code of a passport and extract the firstname, lastname, passport number, nationality, date of birth, expiration date and personal numer.
Scan the MRZ code of a passport and extract the firstname, lastname, passport number, nationality, date of birth, expiration date and personal numer.

PassportScanner Works with 2 and 3 line identity documents. What is this With PassportScanner you can use your camera to scan the MRZ code of a passpo

Apr 17, 2022
Code examples for Depth APIs in iOS
Code examples for Depth APIs in iOS

iOS-Depth-Sampler Code examples of Depth APIs in iOS Requirement Use devices which has a dual camera (e.g. iPhone 8 Plus) or a TrueDepth camera (e.g.

Aug 2, 2022
Source code for the iOS app Screenshotter, on the App Store

Screenshotter This is the source code for the iOS app Screenshotter, available on the App Store. General Project Info Screenshotter is an Objective C

Mar 25, 2022