Skip to content

Instantly share code, notes, and snippets.

View timdecode's full-sized avatar
👁️‍🗨️

Timothy Davison timdecode

👁️‍🗨️
View GitHub Profile
@timdecode
timdecode / simd_partition.metal
Created June 23, 2023 18:11
Metal implementation of subgroupPartitionNV
// Created by Timothy Davison on 2023-06-21.
//
// This is a Metal implementation of subgroupPartitionNV. You use it to find a mask of
// the other threads in a simd-group with the same value (a partition of the simd-group about
// a set of values).
//
// Feel free to use this in your code. Please share any fixes or ideas to make it faster.
//
// Khronos docs on subgroup partitioning:
// - https://github.com/KhronosGroup/GLSL/blob/master/extensions/nv/GL_NV_shader_subgroup_partitioned.txt
@timdecode
timdecode / CellPackParser.mm
Last active April 26, 2023 22:24
cellPACK C++ Parser (for an Objective-C project, hence the Objective-C++ code)
// (Objective-C header)
// CellPackParser.h
// Frameworks
//
// Created by Timothy Davison on 2022-05-11.
//
#pragma once
#import <Foundation/Foundation.h>
2017-06-08 19:00:19.601254-0600 UE4Editor[6486:34786] Compiler failed to build request
2017-06-08 19:00:19.602167-0600 UE4Editor[6486:35042] [2017.06.09-01.00.19:602][ 2]LogMetal:Error: Failed to generate a pipeline state object: Error Domain=CompilerError Code=1 "Unhandled atom in intrinsic: llvm.bswap.i32" UserInfo={NSLocalizedDescription=Unhandled atom in intrinsic: llvm.bswap.i32}
2017-06-08 19:00:19.602267-0600 UE4Editor[6486:35042] [2017.06.09-01.00.19:602][ 2]LogMetal:Error: Vertex shader: // Global/FScreenVS/ScreenVertexShader.usf:Main
#include <metal_stdlib>
using namespace metal;
struct FVSStageIn