Skip to content

Instantly share code, notes, and snippets.

View nanokatze's full-sized avatar

Caterina Shablia nanokatze

View GitHub Profile

A good way to think about a buffer or an image descriptor is to imagine it as a very fat pointer. This is, in fact, not too far removed from reality, as we shall see.

Taking a peek at radv, we find the uniform buffer and storage buffer descriptors to be a 4-word tuple, where the first two words make up the address, followed by length in bytes for bounds checking and an extra word, which holds format information and bounds checking behavior [^1].

Similarly, the sampled image descriptor is a 16-word tuple containing an

vec4
qconj(vec4 x)
{
return vec4(-x.xyz, x.w);
}
vec4
qmul(vec4 x, vec4 y)
{
return vec4(