Skip to content

Instantly share code, notes, and snippets.

@sylefeb
sylefeb / dsp_debug_build.v
Created March 9, 2021 19:55
Repro for yosys issue report. Run script simul.sh, adjust path of cells_sim.v inside.
`define ICEBREAKER 1
`default_nettype none
module M_main (
out_leds,
out_result,
in_run,
out_done,
reset,
out_clock,
@sylefeb
sylefeb / wheel.lua
Last active May 7, 2022 19:21
Repairing a toy car with a new wheel, modeled in IceSL
-- A wheel
-- @sylefeb 2022-05-07
-- MIT license
-- model for https://icesl.loria.fr/
wdiam = 21.6
wh = 6
waxle = 2.1
wrimh = 1
dentsz = 1.8
-- fridge carriage and rail
-- @sylefeb 2023-06-17
-- MIT License
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
@sylefeb
sylefeb / boxfilter.js
Last active March 12, 2024 17:09
WebGPU test 1
async function main()
{
const adapter = await navigator.gpu?.requestAdapter();
const device = await adapter?.requestDevice();
if (!device) {
fail('need a browser that supports WebGPU');
return;
}
const module = device.createShaderModule({
-- brush exemple
hole = cylinder(2,10)
ring = difference(cylinder(4,10),hole)
plate = difference(cube(40,40,10),hole)
emit(plate,1)
emit(ring,0)
@sylefeb
sylefeb / class_2.js
Last active March 19, 2024 16:56
class 2 (webgpu)
async function main()
{
const adapter = await navigator.gpu?.requestAdapter();
const device = await adapter?.requestDevice();
if (!device) {
fail('need a browser that supports WebGPU');
return;
}
const module = device.createShaderModule({
@sylefeb
sylefeb / blur.js
Last active March 26, 2024 16:52
WebGPU class 3
async function main()
{
const adapter = await navigator.gpu?.requestAdapter();
const device = await adapter?.requestDevice();
if (!device) {
fail('need a browser that supports WebGPU');
return;
}
const module = device.createShaderModule({
@sylefeb
sylefeb / class_4_gof.js
Created April 4, 2024 13:02
Iterations
async function main()
{
const adapter = await navigator.gpu?.requestAdapter();
const device = await adapter?.requestDevice();
if (!device) {
fail('need a browser that supports WebGPU');
return;
}
const module = device.createShaderModule({
@sylefeb
sylefeb / reduce.js
Created April 9, 2024 13:47
Starting point for reduce
async function main()
{
const adapter = await navigator.gpu?.requestAdapter();
const device = await adapter?.requestDevice();
if (!device) {
fail('need a browser that supports WebGPU');
return;
}
const module = device.createShaderModule({
async function main()
{
const adapter = await navigator.gpu?.requestAdapter();
const device = await adapter?.requestDevice();
if (!device) {
fail('need a browser that supports WebGPU');
return;
}
const module = device.createShaderModule({