You now label each registered buffer with a frame_number_tag. When Bink finishes decoding, it calls your sync_callback with that tag. This allows triple-buffered async decode without polling.
while (playing)
BinkWait(my_bink_handle); // Wait for next frame
// Bink writes directly to my_8bit_buffer, then calls callback
// Render pass uses buffer + palette texture
SubmitDraw();
The classic pipeline:
Decode video → write to frame buffer → wait for vblank → flip
The sync_flags field lets you insert hardware-specific memory barriers:
Historically, the signature looked something like this (pseudo-code from Bink v1.x):
void BinkRegisterFrameBuffer8(HBINK bink, void* buffer,
int width, int height,
int stride, int palette_handle);
You gave Bink a pointer to an 8bpp buffer, and Bink would decode frames directly into that memory. The palette_handle referenced a previously registered palette.
Allocate a CPU-visible, write-combined buffer for the 8-bit indices. Ensure it is aligned to cache lines (64 or 128 bytes).
void* my_8bit_buffer = vkAllocateMemory( ...,
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT |
VK_MEMORY_PROPERTY_HOST_COHERENT_BIT);