MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / parseDrawlistRecord

Function parseDrawlistRecord

packages/core/src/debug/parsers.ts:310–346  ·  view source on GitHub ↗
(bytes: Uint8Array)

Source from the content-addressed store, hash-verified

308 * - _pad1: u32 (bytes 44-47)
309 */
310export function parseDrawlistRecord(bytes: Uint8Array): DebugParseResult<DrawlistRecord> {
311 if (bytes.byteLength < DEBUG_DRAWLIST_RECORD_SIZE) {
312 return fail(
313 "ZR_TRUNCATED",
314 0,
315 `need ${DEBUG_DRAWLIST_RECORD_SIZE} bytes for drawlist record but only ${bytes.byteLength} available`,
316 );
317 }
318
319 const r = new BinaryReader(bytes);
320
321 const frameId = readU64(r);
322 const totalBytes = r.readU32();
323 const cmdCount = r.readU32();
324 const version = r.readU32();
325 const validationResult = r.readU32();
326 const executionResult = r.readU32();
327 const clipStackMaxDepth = r.readU32();
328 const textRuns = r.readU32();
329 const fillRects = r.readU32();
330 // Skip _pad0, _pad1
331
332 return {
333 ok: true,
334 value: {
335 frameId,
336 totalBytes,
337 cmdCount,
338 version,
339 validationResult,
340 executionResult,
341 clipStackMaxDepth,
342 textRuns,
343 fillRects,
344 },
345 };
346}
347
348/**
349 * Parse a performance record payload.

Callers 2

parsePayloadFunction · 0.85
parsers.test.tsFile · 0.85

Calls 3

readU32Method · 0.95
readU64Function · 0.85
failFunction · 0.70

Tested by

no test coverage detected