(bytes: Uint8Array)
| 308 | * - _pad1: u32 (bytes 44-47) |
| 309 | */ |
| 310 | export 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. |
no test coverage detected