Skip to content

Instantly share code, notes, and snippets.

View RSDuck's full-sized avatar
🦢
stay cool!

Kemal Afzal RSDuck

🦢
stay cool!
  • Germany
View GitHub Profile
@RSDuck
RSDuck / deko3d_notes.md
Last active March 15, 2025 15:21
deko3d Notes

So you want to use deko3d for maximum speed and minimum bloat?

Great!

deko3d is fantastic, working on the same layer of abstraction or even lower than Vulkan, but (even without the C++ wrapper) you tend to only need half as much code to do the same thing.

I've used it for a while now and kind of done the same thing wrong one too many times, so here's a list of those things.

Some things listed here are also documented in the primer while others are not documented there.

import bitops
proc min*[T](s: set[T]): T =
let internalSet = cast[ptr UncheckedArray[byte]](unsafeAddr s)
const sizeNotByteAligned = ord(high(T)) - ord(low(T)) != 7
block done:
var i = 0
when sizeof(set[T]) >= 8:
var remaining = sizeof(set[T])