3 Comments
User's avatar
Caden Parker's avatar

Zero as a default value is such an underrated technique. Vulkan is the perfect example of how not to do this. Oh, you forgot to set literally every single field in a struct? Congrats, your screen is black now.

Expand full comment
Nicholas Wilt's avatar

Vulkan requires zero initialization of structures? Anyone writing developer education materials around such interfaces needs to point out that it is valid 1970s-era K&R C to write:

CUDA_MEMCPY3D cp = {0};

Expand full comment
Caden Parker's avatar

No, I meant how zero is not typically a reasonable default value, so if you do zero out structures, you'll probably end up with something you didn't want

Expand full comment