Original link: http://www.concentric.net/~Ttwang/tech/inthash.htm
Taken from: http://web.archive.org/web/20071223173210/http://www.concentric.net/~Ttwang/tech/inthash.htm
Reformatted using pandoc
Thomas Wang, Jan 1997
last update Mar 2007
“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.” – Tom Cargill | |
“In order to understand recursion, one must first understand recursion.” – Author Unknown | |
“I have always wished for my computer to be as easy to use as my telephone; my wish has come true because I can no longer figure out how to use my telephone.” – Bjarne Stroustrup | |
“A computer lets you make more mistakes faster than any other invention in human history, with the possible exceptions of handguns and tequila.” – Mitch Ratcliffe | |
“There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.” -C.A.R. Hoare | |
“The gap between theory and practice is not as wide in theory as it is in practice.” – Author Unknown | |
“If builders built buildings the way progra |
Original link: http://www.concentric.net/~Ttwang/tech/inthash.htm
Taken from: http://web.archive.org/web/20071223173210/http://www.concentric.net/~Ttwang/tech/inthash.htm
Reformatted using pandoc
Thomas Wang, Jan 1997
last update Mar 2007
// World's Tiniest* Marching Tetrahedron | |
// by Leonard Ritter (leonard.ritter@duangle.com) | |
// this code is public domain | |
// 0 | |
// + | |
// / | \ | |
// 3 +-----+ 1 | |
// \ | / |
Achievement | Engine/Game | Why it's bad |
---|---|---|
storing world space positions in gbuffer | STALKER, F.E.A.R. | Depth buffer can be used to derive position saving a lot of memory bandwidth |
uploaded texture upside down | Various engines, mostly Quake derived. | Difficult to debug with tools like apitrace, nsight, pix, renderdoc, etc |
A full OpenGL profile requires X to be running. For X to run, it requires a display to be connected to the machine. Given that most server machines do not have this, it becomes difficult to run OpenGL.
This document details how to get OpenGL and X up and running without having a display connected to the sevrer.
You will need access to the remote system over SSH.
To run the tool, you will need libGL.so
and libX11.so
. These are installed when X and the NVIDIA Drivers are installed. So there is nothing special required to install these.
Another tool I would recommend strongly is glewinfo. Most linux distributions ship this with the glew-utils package. An alternate to glewinfo is glxinfo which is present on all systems with X. You can substitute glewinfo with glxinfo in all the commands below if needed.
#ifdef _WIN32 | |
// Use discrete GPU by default. | |
extern "C" { | |
// http://developer.download.nvidia.com/devzone/devcenter/gamegraphics/files/OptimusRenderingPolicies.pdf | |
__declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; | |
| |
// http://developer.amd.com/community/blog/2015/10/02/amd-enduro-system-for-developers/ | |
__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; | |
} | |
#endif |
- loadkeys de-latin1 | |
- setfont Lat2-Terminus16 | |
- cgdisk /dev/sda | |
- new -> default -> 32M -> ef02 -> bios -> new -> default -> default -> 8300 -> linux -> write -> yes -> quit | |
- mkfs.ext4 /dev/sda2 | |
- mount /dev/sda2 /mnt | |
- export LANG="en_US.UTF-8" | |
- export LC_COLLATE="C" | |
- pacman -Syy | |
- pacstrap /mnt base base-devel git zsh vim |
// The following code is licensed under the MIT license: https://gist.github.com/TheRealMJP/bc503b0b87b643d3505d41eab8b332ae | |
// Samples a texture with Catmull-Rom filtering, using 9 texture fetches instead of 16. | |
// See http://vec3.ca/bicubic-filtering-in-fewer-taps/ for more details | |
float4 SampleTextureCatmullRom(in Texture2D<float4> tex, in SamplerState linearSampler, in float2 uv, in float2 texSize) | |
{ | |
// We're going to sample a a 4x4 grid of texels surrounding the target UV coordinate. We'll do this by rounding | |
// down the sample location to get the exact center of our "starting" texel. The starting texel will be at | |
// location [1, 1] in the grid, where [0, 0] is the top left corner. | |
float2 samplePos = uv * texSize; |
Latency Comparison Numbers | |
-------------------------- | |
L1 cache reference/hit 1.5 ns 4 cycles | |
Floating-point add/mult/FMA operation 1.5 ns 4 cycles | |
L2 cache reference/hit 5 ns 12 ~ 17 cycles | |
Branch mispredict 6 ns 15 ~ 20 cycles | |
L3 cache hit (unshared cache line) 16 ns 42 cycles | |
L3 cache hit (shared line in another core) 25 ns 65 cycles | |
Mutex lock/unlock 25 ns | |
L3 cache hit (modified in another core) 29 ns 75 cycles |