cli-anything-renderdoc

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

RenderDoc CLI Skill

RenderDoc CLI工具

Headless command-line analysis of RenderDoc GPU frame captures (
.rdc
files).
对RenderDoc GPU帧捕获文件(
.rdc
文件)进行无界面命令行分析。

Capabilities

功能

  • Capture inspection: metadata, sections, thumbnails, format conversion
  • Action tree: list/search/filter draw calls, clears, dispatches, markers
  • Texture operations: list, inspect, export (PNG/JPG/DDS/HDR/EXR), pixel picking
  • Pipeline state: full shader/RT/viewport state at any event
  • Shader analysis: export shader in human-readable form (HLSL/GLSL/disasm), constant buffer readback
  • Resource inspection: buffer/texture enumeration, raw data reading
  • Mesh data: vertex shader input/output decoding
  • GPU counters: enumerate and fetch hardware performance counters
  • 捕获检查:元数据、片段、缩略图、格式转换
  • 动作树:列出/搜索/筛选绘制调用、清除操作、调度任务、标记
  • 纹理操作:列出、检查、导出(PNG/JPG/DDS/HDR/EXR)、像素拾取
  • 管线状态:任意事件的完整着色器/渲染目标/视口状态
  • 着色器分析:以人类可读形式导出着色器(HLSL/GLSL/反汇编)、常量缓冲区回读
  • 资源检查:缓冲区/纹理枚举、原始数据读取
  • 网格数据:顶点着色器输入/输出解码
  • GPU计数器:枚举并获取硬件性能计数器

Command Groups

命令组

capture

capture

bash
cli-anything-renderdoc -c frame.rdc capture info          # Metadata + sections
cli-anything-renderdoc -c frame.rdc capture thumb -o t.png # Extract thumbnail
cli-anything-renderdoc -c frame.rdc capture convert -o out.rdc --format rdc
bash
cli-anything-renderdoc -c frame.rdc capture info          # 元数据 + 片段
cli-anything-renderdoc -c frame.rdc capture thumb -o t.png # 提取缩略图
cli-anything-renderdoc -c frame.rdc capture convert -o out.rdc --format rdc

actions

actions

bash
cli-anything-renderdoc -c frame.rdc actions list           # All actions
cli-anything-renderdoc -c frame.rdc actions list --draws-only  # Draw calls only
cli-anything-renderdoc -c frame.rdc actions summary        # Counts by type
cli-anything-renderdoc -c frame.rdc actions find "Shadow"  # Search by name
cli-anything-renderdoc -c frame.rdc actions get 42         # Single action
bash
cli-anything-renderdoc -c frame.rdc actions list           # 所有动作
cli-anything-renderdoc -c frame.rdc actions list --draws-only  # 仅绘制调用
cli-anything-renderdoc -c frame.rdc actions summary        # 按类型统计数量
cli-anything-renderdoc -c frame.rdc actions find "Shadow"  # 按名称搜索
cli-anything-renderdoc -c frame.rdc actions get 42         # 获取单个动作

textures

textures

bash
cli-anything-renderdoc -c frame.rdc textures list
cli-anything-renderdoc -c frame.rdc textures get <id>
cli-anything-renderdoc -c frame.rdc textures save <id> -o out.png --format png
cli-anything-renderdoc -c frame.rdc textures save-outputs 42 -o ./renders/
cli-anything-renderdoc -c frame.rdc textures pick <id> 100 200
bash
cli-anything-renderdoc -c frame.rdc textures list
cli-anything-renderdoc -c frame.rdc textures get <id>
cli-anything-renderdoc -c frame.rdc textures save <id> -o out.png --format png
cli-anything-renderdoc -c frame.rdc textures save-outputs 42 -o ./renders/
cli-anything-renderdoc -c frame.rdc textures pick <id> 100 200

pipeline

pipeline

bash
cli-anything-renderdoc -c frame.rdc pipeline state 42
bash
cli-anything-renderdoc -c frame.rdc pipeline state 42

Export shader in human-readable form

以人类可读形式导出着色器

Text shaders (GLSL/HLSL) → saved directly

文本着色器(GLSL/HLSL)→ 直接保存

Binary shaders (DXBC/SPIR-V) → embedded source (HLSL/GLSL) or disassembly

二进制着色器(DXBC/SPIR-V)→ 嵌入的源代码(HLSL/GLSL)或反汇编代码

cli-anything-renderdoc -c frame.rdc pipeline shader-export 42 --stage Fragment cli-anything-renderdoc -c frame.rdc pipeline shader-export 42 --stage Vertex -o ./shaders/
cli-anything-renderdoc -c frame.rdc pipeline cbuffer 42 --stage Vertex --index 0
cli-anything-renderdoc -c frame.rdc pipeline shader-export 42 --stage Fragment cli-anything-renderdoc -c frame.rdc pipeline shader-export 42 --stage Vertex -o ./shaders/
cli-anything-renderdoc -c frame.rdc pipeline cbuffer 42 --stage Vertex --index 0

Compare pipeline state between two events

比较两个事件之间的管线状态

Default output: same directory as the capture file ; use -o to override

默认输出:捕获文件所在的同一目录;使用 -o 覆盖路径

cli-anything-renderdoc -c a.rdc pipeline diff 100 200 -b b.rdc cli-anything-renderdoc -c frame.rdc pipeline diff 100 200 # same capture cli-anything-renderdoc -c a.rdc pipeline diff 100 200 -b b.rdc -o result.json cli-anything-renderdoc -c a.rdc pipeline diff 100 200 -b b.rdc --no-compact
undefined
cli-anything-renderdoc -c a.rdc pipeline diff 100 200 -b b.rdc cli-anything-renderdoc -c frame.rdc pipeline diff 100 200 # 同一捕获文件 cli-anything-renderdoc -c a.rdc pipeline diff 100 200 -b b.rdc -o result.json cli-anything-renderdoc -c a.rdc pipeline diff 100 200 -b b.rdc --no-compact
undefined

resources

resources

bash
cli-anything-renderdoc -c frame.rdc resources list
cli-anything-renderdoc -c frame.rdc resources buffers
cli-anything-renderdoc -c frame.rdc resources read-buffer <id> --format float32
bash
cli-anything-renderdoc -c frame.rdc resources list
cli-anything-renderdoc -c frame.rdc resources buffers
cli-anything-renderdoc -c frame.rdc resources read-buffer <id> --format float32

mesh

mesh

bash
cli-anything-renderdoc -c frame.rdc mesh inputs 42 --max-vertices 10
cli-anything-renderdoc -c frame.rdc mesh outputs 42
bash
cli-anything-renderdoc -c frame.rdc mesh inputs 42 --max-vertices 10
cli-anything-renderdoc -c frame.rdc mesh outputs 42

counters

counters

bash
cli-anything-renderdoc -c frame.rdc counters list
cli-anything-renderdoc -c frame.rdc counters fetch --ids 1,2,3
bash
cli-anything-renderdoc -c frame.rdc counters list
cli-anything-renderdoc -c frame.rdc counters fetch --ids 1,2,3

JSON Mode

JSON模式

All commands support
--json
for machine-readable output:
bash
cli-anything-renderdoc -c frame.rdc --json actions summary
所有命令都支持
--json
参数以生成机器可读的输出:
bash
cli-anything-renderdoc -c frame.rdc --json actions summary

Environment Variables

环境变量

VariableDescription
RENDERDOC_CAPTURE
Default capture file path
PYTHONPATH
Must include RenderDoc path
变量名描述
RENDERDOC_CAPTURE
默认捕获文件路径
PYTHONPATH
必须包含RenderDoc的路径

Agent Usage Notes

Agent使用注意事项

  • Use
    pipeline shader-export
    to extract shaders
    — for binary shaders (DXBC/SPIR-V) it auto-exports embedded HLSL/GLSL source or falls back to disassembly; for text shaders (GLSL/HLSL) it saves the raw source directly
  • Shader formats by capture API:
    • D3D11 → DXBC binary, exported as embedded HLSL source (
      .hlsl
      ) or bytecode asm (
      .dxbc.asm
      )
    • OpenGL/GLES → GLSL source text (
      .glsl
      ), already human-readable
    • Vulkan → SPIR-V binary, exported as embedded GLSL source (
      .glsl
      ) or SPIR-V asm (
      .spv.asm
      )
  • Use
    pipeline diff
    to compare two events
    — it writes a JSON file and prints only the path; use
    -b
    for a second capture
  • Always specify
    --json
    for programmatic consumption
  • Use
    actions summary
    first to understand capture complexity
  • Use
    actions list --draws-only
    to focus on actual rendering
  • Pipeline state requires an event ID from the action list
  • Texture save supports: png, jpg, bmp, tga, hdr, exr, dds
  • Buffer data can be decoded as hex, float32, uint32, or raw bytes
  • 使用
    pipeline shader-export
    提取着色器
    ——对于二进制着色器(DXBC/SPIR-V),它会自动导出嵌入的HLSL/GLSL源代码,若失败则回退到反汇编;对于文本着色器(GLSL/HLSL),它会直接保存原始源代码
  • 按捕获API划分的着色器格式
    • D3D11 → DXBC二进制,导出为嵌入的HLSL源代码(
      .hlsl
      )或字节码汇编(
      .dxbc.asm
    • OpenGL/GLES → GLSL源代码文本(
      .glsl
      ),本身已具备可读性
    • Vulkan → SPIR-V二进制,导出为嵌入的GLSL源代码(
      .glsl
      )或SPIR-V汇编(
      .spv.asm
  • 使用
    pipeline diff
    比较两个事件
    ——它会写入一个JSON文件并仅打印路径;使用
    -b
    参数指定第二个捕获文件
  • 程序调用时始终指定
    --json
    参数
  • 先使用
    actions summary
    了解捕获内容的复杂度
  • 使用
    actions list --draws-only
    聚焦于实际渲染操作
  • 管线状态需要来自动作列表的事件ID
  • 纹理保存支持的格式:png、jpg、bmp、tga、hdr、exr、dds
  • 缓冲区数据可解码为十六进制、float32、uint32或原始字节