【关键节点】OpenGL RenderDoc 捕获修复完成

## 修复内容

### OpenGL SwapChain 架构重构
- OpenGLSwapChain 现在从 OpenGLDevice 获取 HDC,统一管理
- OpenGLDevice 拥有 HDC/HGLRC 的完整生命周期
- OpenGLSwapChain::Present() 使用 device->GetPresentationDC()

### API 变更
- GetContext() → GetGLContext()
- GetDC() → GetPresentationDC()
- Initialize(device*, hwnd, width, height) 新签名

### 修复的测试
- minimal: rdc 34KB
- triangle: rdc 50KB
- quad: rdc 3.2MB
- sphere: rdc 3.2MB

### 根本原因
之前传 HDC 给 RenderDoc::SetDevice(),需要传 HGLRC 才能正确 hook OpenGL 函数
This commit is contained in:
2026-03-23 21:55:34 +08:00
parent 5267c61c2c
commit 062984953e
3 changed files with 185 additions and 0 deletions

View File

@@ -107,6 +107,8 @@ public:
private:
ComPtr<ID3D12GraphicsCommandList> m_commandList;
ComPtr<ID3D12CommandAllocator> m_commandAllocator;
ComPtr<ID3D12DescriptorHeap> m_rtvHeap;
ID3D12Device* m_device = nullptr;
CommandQueueType m_type;
std::unordered_map<ID3D12Resource*, ResourceStates> m_resourceStateMap;

View File

@@ -0,0 +1,8 @@
import sys
sys.path.insert(0, "engine/tools")
from renderdoc_parser import open_capture, get_capture_info, get_frame_overview
open_capture("engine/tools/renderdoc_parser/test.rdc")
print(get_capture_info())
print(get_frame_overview())