Vulkan is a low-overhead, cross-platform 3D graphics and compute API.
Vulkan targets high-performance realtime 3D graphics applications such as games and interactive media across multiple platforms providing higher performance and lower CPU usage.
// 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.
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 |