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:
@@ -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();
|
||||
|
||||
@@ -133,10 +133,12 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
||||
DispatchMessageW(&msg);
|
||||
} else {
|
||||
if (frameCount == targetFrameCount - 1) {
|
||||
Log("[INFO] Starting RenderDoc capture at frame %d", frameCount + 1);
|
||||
wglMakeCurrent(device.GetDC(), device.GetContext());
|
||||
RenderDocCapture::Get().BeginCapture("OpenGL_Minimal_Test");
|
||||
Log("[INFO] IsCapturing after BeginCapture: %s", RenderDocCapture::Get().IsCapturing() ? "true" : "false");
|
||||
if (RenderDocCapture::Get().BeginCapture("OpenGL_Minimal_Test")) {
|
||||
Log("[INFO] RenderDoc capture started at frame %d", frameCount + 1);
|
||||
} else {
|
||||
Log("[ERROR] Failed to start RenderDoc capture");
|
||||
}
|
||||
}
|
||||
|
||||
// Set viewport and clear color using encapsulated command list
|
||||
@@ -148,9 +150,17 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
||||
frameCount++;
|
||||
|
||||
if (frameCount >= targetFrameCount) {
|
||||
Log("[INFO] Ending RenderDoc capture at frame %d", frameCount);
|
||||
RenderDocCapture::Get().EndCapture();
|
||||
Log("[INFO] NumCaptures: %u", RenderDocCapture::Get().GetNumCaptures());
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user