Skip to content

Instantly share code, notes, and snippets.

// Gradient Shader for arbitrary gradient stops, three gradient types and rotation
// For the details please visit: https://mtldoc.com/metal/2022/08/04/shaders-explained-gradients.html
// MARK: - Gradient Texture
struct GradientTextureVertex {
float4 position [[ position ]];
float4 color;
};
@petertretyakov
petertretyakov / metal-library-builder.sh
Last active June 18, 2022 16:07
Build Metal Library from Shell
#!/bin/bash
# This is a gist from
# mtldoc.com
#
# If you want to know what the hell is happening here check
# https://mtldoc.com/metal/2022/06/18/build-swift-executable-with-metal-library.html
# Create intermediate representation from Metal files