Skip to content

Instantly share code, notes, and snippets.


Thom Chiovoloni thomcc

View GitHub Profile
thomcc / gist:d23fbed230f5e06d91409f31a2fc9985
Created Nov 5, 2020 — forked from rygorous/gist:2203834
float->sRGB8 using SSE2 (and a table)
View gist:d23fbed230f5e06d91409f31a2fc9985
// float->sRGB8 conversions - two variants.
// by Fabian "ryg" Giesen
// I hereby place this code in the public domain.
// Both variants come with absolute error bounds and a reversibility and monotonicity
// guarantee (see test driver code below). They should pass D3D10 conformance testing
// (not that you can verify this, but still). They are verified against a clean reference
// implementation provided below, and the test driver checks all floats exhaustively.
View insert-many-scratchpad.js
async function addBookmarks() {
let buf = await{
path: ":memory:",
recordTelemetryEvent() {},
let menu = {
id: "menu",