Update minimal tests to use improved RenderDocCapture API

- OpenGL test: Use BeginCapture/EndCapture with bool return values
- D3D12 test: Use BeginCapture/EndCapture with bool return values
- Both tests: Use GetCapture() to log capture file info
- Added capture file path and size logging after capture
This commit is contained in:
2026-03-23 18:44:12 +08:00
parent 1acea6bf69
commit effc969ad3
2 changed files with 32 additions and 9 deletions

View File

@@ -278,8 +278,17 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
frameCount++;
if (frameCount >= targetFrameCount) {
Log("[INFO] Reached target frame count %d - ending capture and taking screenshot!", targetFrameCount);
RenderDocCapture::Get().EndCapture();
if (RenderDocCapture::Get().EndCapture()) {
Log("[INFO] RenderDoc capture ended, NumCaptures: %u", RenderDocCapture::Get().GetNumCaptures());
if (RenderDocCapture::Get().GetNumCaptures() > 0) {
RenderDocCaptureInfo info;
if (RenderDocCapture::Get().GetCapture(0, &info)) {
Log("[INFO] Capture file: %s (%u bytes)", info.filename, info.length);
}
}
} else {
Log("[ERROR] Failed to end RenderDoc capture");
}
ExecuteCommandList();
WaitForGPU();
Log("[INFO] GPU idle, taking screenshot...");
@@ -299,7 +308,11 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
}
if (frameCount == targetFrameCount - 1) {
RenderDocCapture::Get().BeginCapture("Minimal_Test_Frame30");
if (RenderDocCapture::Get().BeginCapture("D3D12_Minimal_Test")) {
Log("[INFO] RenderDoc capture started at frame %d", frameCount + 1);
} else {
Log("[ERROR] Failed to start RenderDoc capture");
}
}
EndRender();