Drawlist Format (ZRDL v1/v2)¶
ZRDL v1 and v2 share the same 64-byte header layout plus a command stream. String/blob tables are no longer carried per frame.
Header¶
All header fields are little-endian u32.
magic:0x4C44525A(ZRDL)version:ZR_DRAWLIST_VERSION_V1(1) orZR_DRAWLIST_VERSION_V2(2)header_size:64total_size: full buffer sizecmd_offset: offset to command stream (normally64)cmd_bytes: command stream byte lengthcmd_count: command countstrings_span_offset:0strings_count:0strings_bytes_offset:0strings_bytes_len:0blobs_span_offset:0blobs_count:0blobs_bytes_offset:0blobs_bytes_len:0reserved0:0
Command Header¶
Every command starts with:
opcode(u16)flags(u16, must be0)size(u32, includes header + payload)
Commands are 4-byte aligned.
Opcodes¶
1ZR_DL_OP_CLEAR(size8)2ZR_DL_OP_FILL_RECT(size52)3ZR_DL_OP_DRAW_TEXT(size60)4ZR_DL_OP_PUSH_CLIP(size24)5ZR_DL_OP_POP_CLIP(size8)6ZR_DL_OP_DRAW_TEXT_RUN(size24)7ZR_DL_OP_SET_CURSOR(size20)8ZR_DL_OP_DRAW_CANVAS(size32)9ZR_DL_OP_DRAW_IMAGE(size40)10ZR_DL_OP_DEF_STRING(base size16+ aligned bytes)11ZR_DL_OP_FREE_STRING(size12)12ZR_DL_OP_DEF_BLOB(base size16+ aligned bytes)13ZR_DL_OP_FREE_BLOB(size12)14ZR_DL_OP_BLIT_RECT(size32, v2 only)
Persistent Resource Semantics¶
DEF_* commands define or overwrite engine-owned resources.
DEF_STRING:id,byte_len,bytes, 0-padding to 4-byte alignmentFREE_STRING:idDEF_BLOB:id,byte_len,bytes, 0-padding to 4-byte alignmentFREE_BLOB:id
DRAW_TEXT references string_id + byte_off + byte_len.
DRAW_TEXT_RUN, DRAW_CANVAS, and DRAW_IMAGE reference blob IDs.
Unknown resource IDs at execute time are format errors.
Validation Notes¶
Validator checks:
- magic/version/header size
- section offsets/sizes/alignment
- command framing (
cmd_bytes,cmd_count, per-commandsize) - zeroed reserved fields
- opcode-specific payload constraints
Executor is no-partial-effects at frame submit boundaries.