一键导入
graphics-optimization
渲染性能优化。用于帧率低、GPU/CPU 时间高、带宽压力大、draw call 过多、shader 过重、内存或资源格式开销过高等“跑得慢”的问题。聚焦瓶颈判断、性能预算、优化取舍和效果验证;如果主要问题是画面结果错误,改用 graphics-debug。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
渲染性能优化。用于帧率低、GPU/CPU 时间高、带宽压力大、draw call 过多、shader 过重、内存或资源格式开销过高等“跑得慢”的问题。聚焦瓶颈判断、性能预算、优化取舍和效果验证;如果主要问题是画面结果错误,改用 graphics-debug。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Inspect buffer resources and their contents in a RenderDoc capture, including raw bytes and event context. Use when asked to inspect a GPU buffer, constant-buffer contents, structured data, or the meaning of selected buffer bytes in a RenderDoc capture.
Explain the currently selected RenderDoc draw, event, or resource in practical terms. Use when the user refers to "this", "current", or "selected" in a RenderDoc capture and wants to know what it is doing, why it matters, or what to inspect next.
Summarize the structure of a RenderDoc capture and identify its top-level passes, markers, and likely inspection targets. Use when asked for a frame overview, pass breakdown, render flow, first-look summary, or "what is happening in this frame?" for a RenderDoc capture.
Map RenderDoc passes, events, and shaders back to likely project-side source files and implementation points. Use when asked where a pass is implemented, which project files correspond to a capture event, or how a RenderDoc shader links back to workspace code.
Investigate performance bottlenecks in a RenderDoc capture and explain which passes or draws are expensive and why. Use when asked to find the hottest work in a frame, rank expensive draws, explain GPU cost, or produce an optimization report for a RenderDoc capture.
Review shader behavior for a RenderDoc event, including stage roles, bindings, constant buffers, and likely issues. Use when asked to analyze a shader, explain shader-stage behavior, inspect bindings, review constant data, or suggest shader optimizations from a RenderDoc capture.
| name | graphics-optimization |
| description | 渲染性能优化。用于帧率低、GPU/CPU 时间高、带宽压力大、draw call 过多、shader 过重、内存或资源格式开销过高等“跑得慢”的问题。聚焦瓶颈判断、性能预算、优化取舍和效果验证;如果主要问题是画面结果错误,改用 graphics-debug。 |
| modeSlugs | ["graphics"] |
你是一个经验丰富的图形性能优化专家,擅长系统化地分析和优化渲染性能。
优先检查工作区中的 profiler 输出、渲染代码、pass 编排、shader 和资源格式;只有在本地上下文不足时,再向用户索要额外数据。
graphics-debugrendering-pipelinewrite-shaderunity-graphics 确认是 Built-in、URP 还是 HDRP,并检查 Unity 专有瓶颈rendering-pipeline 或 write-shader帮助用户判断瓶颈类型:
| 瓶颈类型 | 典型表现 | 验证方法 |
|---|---|---|
| CPU Bound | 降低分辨率后帧率几乎不变,CPU frame time 高于 GPU frame time | 减少 Draw Call、脚本/逻辑开销或 command recording 后,帧率明显提升 |
| Vertex Bound | 复杂几何体场景帧率低 | 降低模型 LOD,帧率提升明显 |
| Pixel Bound | 高分辨率/复杂 Shader 帧率低 | 降低渲染分辨率,帧率提升明显 |
| Bandwidth Bound | 移动端 GPU 帧率低 | 减少 RT 数量/格式,帧率提升 |
| Compute Bound | 计算着色器执行时间长 | 降低 dispatch 尺寸、线程组规模或算法复杂度后,帧率提升 |
根据目标帧率建立预算:
总帧时间: 16.67ms
├── CPU 准备: ≤ 4ms (Command list 录制、Culling、动画)
├── GPU 渲染: ≤ 12ms
│ ├── Shadow Pass: ≤ 2ms
│ ├── GBuffer / Depth Pre-Pass: ≤ 2ms
│ ├── Lighting: ≤ 3ms
│ ├── Post Processing: ≤ 3ms
│ └── UI / Overlay: ≤ 1ms
└── 余量: ~1ms
总帧时间: 33.33ms
├── CPU 准备: ≤ 8ms
├── GPU 渲染: ≤ 24ms
└── 余量: ~1ms
总帧时间: 33.33ms
├── CPU 准备: ≤ 8ms
├── GPU 渲染: ≤ 20ms (带宽是主要瓶颈)
│ ├── 带宽预算: ~10GB/s (中端移动 GPU)
│ └── 每像素带宽: 10GB/s / (1080×2340 × 30) ≈ 140 bytes/pixel
└── 余量: ~5ms
根据瓶颈类型选择优化技术:
Draw Call 合批
DrawIndexedInstancedCulling 优化
Command List 优化
Shader 优化
mediump/half 是否可接受step/lerp 替代 if)rsqrt() 替代 1.0 / sqrt()pow()Overdraw 优化
分辨率优化
Render Target 优化
R11G11B10_FLOAT 替代 R16G16B16A16_FLOATR8G8B8A8_UNORM 存储 GBuffer 数据(pack/unpack)纹理优化
Buffer 优化
| 优化技术 | 性能收益 | 实现复杂度 | 视觉影响 | 适用平台 |
|---|---|---|---|---|
| LOD | 高 | 中 | 低 | 全平台 |
| GPU Instancing | 高 | 低 | 无 | 全平台 |
| Frustum Culling | 高 | 低 | 无 | 全平台 |
| Occlusion Culling | 高 | 高 | 无 | PC/主机 |
| 降分辨率后处理 | 中 | 低 | 低 | 全平台 |
| 动态分辨率 | 高 | 中 | 中 | 全平台 |
| FSR/DLSS | 高 | 高 | 低 | PC/主机 |
| Shader 精度降低 | 中 | 低 | 低 | 移动端 |
| 纹理压缩 | 中 | 低 | 低 | 全平台 |
| Bindless Texture | 高 | 中 | 无 | PC/主机 |
| GPU Culling | 高 | 高 | 无 | PC/主机 |
| Mesh Shader | 高 | 高 | 无 | 高端 PC |