RD-APA (RenderDoc Auto Performance Analyzer) 是一套基于 RenderDoc Python API 的自动化帧性能诊断系统。它能重放 RDC 文件,提取显存、绘制调用、几何体等关键指标,并生成 AI 性能报告
RD-APA: RenderDoc Auto Performance Analyzer v1.0
Developer Note: Graphics environment configuration is tricky. Please spend 5 minutes reading [Section 4: Core Environment Configuration] to save yourself hours of debugging time.
1. Introduction
RD-APA is an automated frame performance diagnostic system built on top of the RenderDoc Python API. It replays RDC files to extract critical metrics—such as VRAM usage, Draw Call distribution, and geometry complexity—and generates professional, localized HTML performance insights.
2. Key Features
- Multi-API Support: Fully compatible with D3D11, D3D12, and Vulkan captures.
- Intelligent Render Pass Detection: Automatically parses nested Markers (e.g., GBuffer, ShadowMap) to provide granular pass statistics.
- VRAM Deep Audit: Precisely calculates texture memory footprint and identifies uncompressed high-res assets.
- Automated Performance Diagnosis: Generates specific findings and actionable optimization suggestions (LOD, Batching, Compression) in plain language.
3. Project Structure
renderdoc-mcp-analyzer/
├── server/ # Core analysis & report generation engine
├── captures/ # Folder for your .rdc files
├── output/ # Output folder for generated HTML reports
├── docs/ # Detailed documentation
├── setup.bat # Path configuration script
└── verify.bat # Environment validation script
4. Core Environment Configuration (CRITICAL!)
RenderDoc's official binary builds often target older Python versions (like 3.6). If you use a modern Python environment (3.10/3.11+), you will likely encounter ImportError or DLL load failures. You MUST recompile the Python binding module for your specific version.
Step 1: Clone RenderDoc Source
- Clone the official repository:
git clone https://github.com/baldurk/renderdoc.git - Open
renderdoc.slnusing Visual Studio 2019 or 2022.
Step 2: Align Python Version (The "Magic" Step)
To ensure the compiled module works with your local Python:
- In VS Solution Explorer, right-click the
renderdocproject -> Properties. - Navigate to VC++ Directories:
- Include Directories: Add your local Python
includepath. - Library Directories: Add your local Python
libspath.
- Include Directories: Add your local Python
- Check
renderdoc/api/replay/renderdoc_types.hto ensure no hardcoded legacy Python macros are active. - Build Solution: Select the
x64platform and choose theDevelopmentorReleaseconfiguration.
Step 3: Locate the Build Artifacts
Upon successful compilation, check the x64/Development/ or x64/Release/ directory:
renderdoc.dll(The core library)pymodules/renderdoc.pyd(Your custom Python binding module)
Step 4: Run setup.bat
- Return to the RD-APA project directory and run
setup.bat. - When prompted for the
renderdoc.pydpath, manually input the path to the folder you just compiled. - This ensures the analyzer correctly loads the RenderDoc module tailored to your environment.
5. Quick Start
- Install Dependencies:
pip install mcp - Validate Environment: Run
verify.bat. If it displays "OK renderdoc imports successfully", you have cleared the biggest hurdle. - Batch Analysis:
Place your RDC files in
captures/and trigger thebatch_analyze_capturestool via the MCP interface.
6. Technical Overview
- Active Stack Tracking: Uses a stack-based logic to handle D3D12 nested markers, ensuring no draw calls or vertices are "lost" in sub-passes.
- VRAM Auditing: Includes a comprehensive BPP mapping table for modern formats (BC7, R16G16B16A16, etc.) to simulate hardware-level memory allocation.
© 2026 RD-APA Performance Team. Good luck with your project and may your frames be smooth!