mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-08 04:08:32 +09:00
[Refactor] (MG_Backend/DirectVulkan, trace-replay): extract dump-image capture out of MobileGL backend
Moves snapshot capture entirely into the apitrace retrace layer (glReadPixels + PNG encode). Drops the MOBILEGL_PRESENT_DUMP_PATH / MOBILEGL_PRESENT_STATS / MOBILEGL_PRESENT_DUMP_CALL / MOBILEGL_PRESENT_CURRENT_CALL / MOBILEGL_TRACE_CURRENT_CALL_OVERRIDE plumbing from Config, ConfigLoader, VulkanRenderer (GetPresentedDumpPixel/WritePresentedDumpPpm + present-stats readback), the EGL/GLX/Android ws shims, and the Android trace_replay_core PPM reader. DirectVulkan ReadPixels on the default framebuffer now remaps raw swapchain pixels (top-left origin, preTransform-rotated) to GL orientation (bottom-left origin) so the retrace snapshot matches the golden; SwapchainObject also resizes the default-FBO stencil attachment to the swapchain extent to fix GL_INVALID_FRAMEBUFFER_OPERATION under the glReadPixels completeness check.
This commit is contained in:
@@ -183,22 +183,8 @@ public:
|
||||
void swapBuffers() override {
|
||||
if (surface != EGL_NO_SURFACE) {
|
||||
char callNo[32];
|
||||
const char *overrideCallNo = getenv("MOBILEGL_TRACE_CURRENT_CALL_OVERRIDE");
|
||||
if (overrideCallNo != nullptr && overrideCallNo[0] != '\0') {
|
||||
snprintf(callNo, sizeof(callNo), "%s", overrideCallNo);
|
||||
} else {
|
||||
snprintf(callNo, sizeof(callNo), "%u", retrace::callNo);
|
||||
}
|
||||
const char *targetCall = getenv("MOBILEGL_PRESENT_DUMP_CALL");
|
||||
const char *presentStats = getenv("MOBILEGL_PRESENT_STATS");
|
||||
if (targetCall != nullptr && targetCall[0] != '\0' &&
|
||||
presentStats != nullptr && presentStats[0] != '\0' && strcmp(presentStats, "0") != 0) {
|
||||
std::cerr << "MOBILEGL_TRACE_SWAP call=" << callNo
|
||||
<< " target=" << targetCall << "\n";
|
||||
}
|
||||
setenv("MOBILEGL_PRESENT_CURRENT_CALL", callNo, 1);
|
||||
snprintf(callNo, sizeof(callNo), "%u", retrace::callNo);
|
||||
gEgl.swapBuffers(gDisplay, surface);
|
||||
unsetenv("MOBILEGL_PRESENT_CURRENT_CALL");
|
||||
HoldAfterTargetPresent(callNo);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user