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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Estimating CPU frequency... | |
// CPU frequency: 4.52 GHz | |
// sum1: value = 15182118497126522709, 0.31 secs, 5.14 cycles/elem | |
// sum2: value = 15182118497126522709, 0.17 secs, 2.93 cycles/elem | |
#define RW(x) asm("" : "+r"(x)) | |
typedef struct Node { | |
u64 value; | |
struct Node *next; |
There is sometimes a situation in which one needs to get the relative offset of a structure field, common examples of this include serialization frameworks which aid to serialize objects, vertex attributes for rendering (D3D, GL.), etc.
The most common technique for getting this information is through the offsetof
macro defined in stddef.h
. Unfortunately using the macro in C++ comes with a
new set of restrictions that prevent some (subjectively valid) uses of it.