Integrate RenderDoc frame capture into D3D12 minimal test
- Add SetDevice() and GetNumCaptures() methods to RenderDocCapture - Fix initialization order: RenderDoc before D3D12, then SetDevice after - Use nullptr for window param in StartFrameCapture/EndFrameCapture - Add BeginCapture at frame 29, EndCapture at frame 30 - Set capture file path template to .\minimal_frame30 - Copy renderdoc.dll (26MB redistributable) to test output - Engine/third_party/renderdoc/ now contains working renderdoc.dll
This commit is contained in:
@@ -14,9 +14,11 @@ public:
|
||||
|
||||
bool Initialize(void* device, void* window = nullptr);
|
||||
void Shutdown();
|
||||
void SetDevice(void* device);
|
||||
|
||||
bool IsLoaded() const { return m_isLoaded; }
|
||||
bool IsCapturing() const;
|
||||
uint32_t GetNumCaptures() const;
|
||||
|
||||
void BeginCapture(const char* title = nullptr);
|
||||
void EndCapture();
|
||||
|
||||
@@ -46,6 +46,10 @@ void RenderDocCapture::Shutdown() {
|
||||
}
|
||||
}
|
||||
|
||||
void RenderDocCapture::SetDevice(void* device) {
|
||||
m_device = device;
|
||||
}
|
||||
|
||||
bool RenderDocCapture::LoadRenderDoc() {
|
||||
char exePath[MAX_PATH];
|
||||
GetModuleFileNameA(NULL, exePath, MAX_PATH);
|
||||
@@ -104,6 +108,13 @@ bool RenderDocCapture::IsCapturing() const {
|
||||
return m_api->IsFrameCapturing() != 0;
|
||||
}
|
||||
|
||||
uint32_t RenderDocCapture::GetNumCaptures() const {
|
||||
if (!m_isLoaded || !m_api) {
|
||||
return 0;
|
||||
}
|
||||
return m_api->GetNumCaptures();
|
||||
}
|
||||
|
||||
void RenderDocCapture::BeginCapture(const char* title) {
|
||||
if (!m_isLoaded || !m_api) {
|
||||
return;
|
||||
@@ -111,15 +122,14 @@ void RenderDocCapture::BeginCapture(const char* title) {
|
||||
if (title) {
|
||||
m_api->SetCaptureTitle(title);
|
||||
}
|
||||
m_api->SetActiveWindow(m_device, m_window);
|
||||
m_api->StartFrameCapture(m_device, m_window);
|
||||
m_api->StartFrameCapture(m_device, nullptr);
|
||||
}
|
||||
|
||||
void RenderDocCapture::EndCapture() {
|
||||
if (!m_isLoaded || !m_api) {
|
||||
return;
|
||||
}
|
||||
m_api->EndFrameCapture(m_device, m_window);
|
||||
m_api->EndFrameCapture(m_device, nullptr);
|
||||
}
|
||||
|
||||
void RenderDocCapture::TriggerCapture() {
|
||||
|
||||
BIN
engine/third_party/renderdoc/renderdoc.dll
vendored
Normal file
BIN
engine/third_party/renderdoc/renderdoc.dll
vendored
Normal file
Binary file not shown.
BIN
engine/third_party/renderdoc/renderdoc.pyd
vendored
Normal file
BIN
engine/third_party/renderdoc/renderdoc.pyd
vendored
Normal file
Binary file not shown.
Reference in New Issue
Block a user