Skip to content

Instantly share code, notes, and snippets.

View NateTheGreatt's full-sized avatar

Nate Martin NateTheGreatt

View GitHub Profile
@CodyJasonBennett
CodyJasonBennett / index.ts
Last active May 31, 2023 07:59
WebGL 2 Compute via Transform Feedback
/**
* Matches against GLSL shader outputs.
*/
const VARYING_REGEX = /[^\w](?:varying|out)\s+\w+\s+(\w+)\s*;/g
/**
* Adds line numbers to a string with an optional starting offset.
*/
const lineNumbers = (source: string, offset = 0): string => source.replace(/^/gm, () => `${offset++}:`)
// Summary of Flecs data structures
// This is a non-exhaustive overview of flecs datastructures. Things have been ommitted/have different names for clarity.
// --- DATASTRUCTURES
// A sparse set is a map-like structure that guarantees O(1) lookup times (as opposed to O(1) on average for maps) at the cost of
// requiring more RAM (more info on the general idea of sparse sets: https://www.geeksforgeeks.org/sparse-set/)
struct ecs_sparse_t { };
@gnif
gnif / vega-10-reset.c
Last active July 2, 2020 10:02
Experimental NON FUNCTIONAL vega 10 reset
static int reset_amdgpu_vega(struct pci_dev *dev, int probe) {
#define AMDGPU_MAX_USEC_TIMEOUT 100000
#define MP0_BASE 0x16000
#define mmMP0_SMN_C2PMSG_33 ((MP0_BASE + 0x0061) * 4)
#define mmMP0_SMN_C2PMSG_64 ((MP0_BASE + 0x0080) * 4)
#define mmMP0_SMN_C2PMSG_81 ((MP0_BASE + 0x0091) * 4)
resource_size_t rmmio_base, rmmio_size;
void __iomem *rmmio;
int ret;
@numinit
numinit / 0-index.md
Last active April 6, 2024 21:54
patch -p0 < fix-vega-reset.patch
@dmnsgn
dmnsgn / WebGL-WebGPU-frameworks-libraries.md
Last active July 18, 2024 10:09
A collection of WebGL and WebGPU frameworks and libraries

A non-exhaustive list of WebGL and WebGPU frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are wip/outdated/not maintained anymore.

Engines and libraries ⚙️

Name Stars Last Commit Description
three.js ![GitHub
@mikaelbr
mikaelbr / destructuring.js
Last active April 25, 2024 13:21
Complete collection of JavaScript destructuring. Runnable demos and slides about the same topic: http://git.mikaelb.net/presentations/bartjs/destructuring
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];