Skip to content

Instantly share code, notes, and snippets.

View peterwmwong's full-sized avatar

Peter Wong peterwmwong

View GitHub Profile
@peterwmwong
peterwmwong / index.html
Last active October 26, 2024 16:13
LYweeqL
<img src="https://bit.ly/48k1DQV">
@peterwmwong
peterwmwong / mesh.metal
Last active October 13, 2024 21:51
Ridiculous atomic-less, simd reduction mesh shader for itty-bitty 32v/32t meshlets...
[[mesh, max_total_threads_per_threadgroup(32)]]
void select_triangles(
object_data SelectedMeshlets const & selected_meshlets [[payload]],
ushort const t_in_sg [[thread_index_in_simdgroup]],
ushort const tg_in_g [[threadgroup_position_in_grid]],
constant Model const & model [[buffer(0)]],
Mesh out
) {
Meshlet const meshlet = selected_meshlets.meshlets[tg_in_g];
half2 cached_pos_2d;
evolve&10,13,16,19,21,23,27,30,37,41,46,48,50,52,56,58,69,77
evolve&13,16,19,50,52,58,66,69,79,84,133,161,163,165,167,170,179,180,183,187,209,216,218,228,255,258,259,263,265,268,273,283,287,300,316,329,355,363
evolve&10,13,16,19,32,48,69,74,92,133,138,161,183,187,216,263,265,293
@peterwmwong
peterwmwong / d8-macosx-with-matchAll.zip
Last active March 19, 2018 00:49
d8-macosx-with-matchAll
This file has been truncated, but you can view the full file.
@peterwmwong
peterwmwong / matchAll-spec-to-test.md
Last active March 19, 2018 00:44
An attempt to map the spec to proposed Test262 test

String.prototype.matchAll ( regexp )

Performs a regular expression match of the String representing the this value against regexp and returns an iterator. Each iteration result’s value is an Array object containing the results of the match, or null if the String did not match.

When the matchAll method is called, the following steps are taken:

  1. Let O be ? [RequireObjectCoercible][require-object-coercible](this value).
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
new file mode 100644
index 000000000..544721e31
--- /dev/null
+++ b/.vscode/tasks.json
@@ -0,0 +1,15 @@
+{
+ "version": "2.0.0",
+ "tasks": [
+ {
@peterwmwong
peterwmwong / map.js
Created July 7, 2017 14:23
Comparing for-loop vs Array.p.map
'use strict';
/*
Checked CL out using...
> git fetch https://chromium.googlesource.com/v8/v8 refs/changes/39/548639/17 && git checkout FETCH_HEAD
> d8 --turbo_inline_array_builtins --allow-natives-syntax map.js
doArrayMap 2194 ms