Skip to content

Instantly share code, notes, and snippets.

View Jasper-Bekkers's full-sized avatar

Jasper Bekkers Jasper-Bekkers

View GitHub Profile
@jsimmons
jsimmons / frk.rs
Created January 2, 2022 22:30
Upgradable Atomic Ref Counting
/// Flexible Reference Kounting
use std::{
marker::PhantomData,
ops::Deref,
ptr::NonNull,
sync::atomic::{AtomicI32, Ordering},
};
struct Inner<T: ?Sized> {
// Number of strong references in addition to the current value.
@h3r2tic
h3r2tic / restir-meets-surfel-lighting-breakdown.md
Created November 23, 2021 02:15
A quick breakdown of lighting in the `restir-meets-surfel` branch of my renderer

A quick breakdown of lighting in the restir-meets-surfel branch of my renderer, where I revive some olde surfel experiments, and generously sprinkle ReSTIR on top.

General remarks

Please note that this is all based on work-in-progress experimental software, and represents a single snapshot in development history. Things will certainly change 😛

Due to how I'm capturing this, there's frame-to-frame variability, e.g. different rays being shot, TAA shimmering slightly. Some of the images come from a dedicated visualization pass, and are anti-aliased, and some show internal buffers which are not anti-aliased.

Final images

@meshula
meshula / usd-tbb-boost.md
Last active October 14, 2021 12:18
usd-tbb-boost.md

boost removal is an ongoing, low noise effort.

At this point, if you build without python, you can build the usd libraries treating boost as header only, without actually building boost. one or two of the command line tools use boost for command line options.

Porting those to (my suggestion) CLI11 would remove the last non-python boost dependency.

to be redundant and clear: you can manually cherrypick the boost headers

#include "../inc/math_const.hlsl"
#include "../inc/math.hlsl"
#include "../inc/frame_constants.hlsl"
#include "../inc/uv.hlsl"
#include "../inc/hash.hlsl"
#include "../inc/pack_unpack.hlsl"
#include "../inc/gbuffer.hlsl"
[[vk::binding(0)]] Texture2D<float4> gbuffer_tex;
[[vk::binding(1)]] Texture2D<float> half_depth_tex;
@dondragmer
dondragmer / PrefixSort.compute
Created January 20, 2021 23:32
An optimized GPU counting sort
#pragma use_dxc //enable SM 6.0 features, in Unity this is only supported on version 2020.2.0a8 or later with D3D12 enabled
#pragma kernel CountTotalsInBlock
#pragma kernel BlockCountPostfixSum
#pragma kernel CalculateOffsetsForEachKey
#pragma kernel FinalSort
uint _FirstBitToSort;
int _NumElements;
int _NumBlocks;
bool _ShouldSortPayload;
@travisdowns
travisdowns / cache-counters-rant.md
Created October 13, 2019 16:46
Discussion of x86 L1D related cache counters

The counters that are the easiest to understand and the best for making ratios that are internally consistent (i.e., always fall in the range 0.0 to 1.0) are the mem_load_retired events, e.g., mem_load_retired.l1_hit and mem_load_retired.l1_miss.

These count at the instruction level, i.e., the universe of retired instructions. For example, could make a reasonable hit ratio from mem_load_retired.l1_hit / mem_inst_retired.all_loads and it will be sane (never indicate a hit rate more than 100%, for example).

That one isn't perfect though, in that it may not reflect the true costs of cache misses and the behavior of the program for at least the following reasons:

  • It appplies only to loads and can't catch misses imposed by stores (AFAICT there is no event that counts store misses).
  • It only counts loads that retire - a lot of the load activity in your process may be due to loads on a speculative path that never retire. Loads on a speculative path may bring in data that is never used, causing misses and d
@jaceklaskowski
jaceklaskowski / Rough Notes about CQRS and ES.md
Last active June 13, 2024 02:32
Rough Notes about CQRS and ES

Rough Notes about CQRS and ES

Once upon a time…

I once took notes (almost sentence by sentence with not much editing) about the architectural design concepts - Command and Query Responsibility Segregation (CQRS) and Event Sourcing (ES) - from a presentation of Greg Young and published it as a gist (with the times when a given sentence was heard).

I then found other summaries of the talk and the gist has since been growing up. See the revisions to know the changes and where they came from (aka the sources).

It seems inevitable to throw Domain Driven Design (DDD) in to the mix.

@markusrt
markusrt / debug.bat
Created January 11, 2012 11:58
Enables debugging for a specified executable. This causes a debugger [vsjitdebugger.exe] to be launched each time the program starts.
@echo off
setlocal
REM Config section, change if required
set REG=C:\Windows\System32\reg.exe
set DEBUGGER=vsjitdebugger.exe
REM Config section end
set method=enable
set debugExe=
@jonah-williams
jonah-williams / build.sh
Created April 30, 2011 17:46
Command line iOS project builds and over-the-air distribution
#!/bin/bash
# https://gist.github.com/949831
# http://blog.carbonfive.com/2011/05/04/automated-ad-hoc-builds-using-xcode-4/
# command line OTA distribution references and examples
# http://nachbaur.com/blog/how-to-automate-your-iphone-app-builds-with-hudson
# http://nachbaur.com/blog/building-ios-apps-for-over-the-air-adhoc-distribution
# http://blog.octo.com/en/automating-over-the-air-deployment-for-iphone/
# http://www.neat.io/posts/2010/10/27/automated-ota-ios-app-distribution.html