Make GPU duration metrics more accurate for Vulkan
In the Vulkan pipeline, the GPU start time was measured to be when swapBuffers starts. But the command queue has already been submitted at this point, which means that the GPU work would already have begun. This means that it's possible to measure a negative time since for very light GPU workloads, the GPU fence can fire prior to CPU making it to swapBuffers(). To compensate, instead measure from after skia completed submitting GPU commands, until the GPU fence fires. Since it is theoretically possible for GPU work to complete if the render thread gets descheduled immediately after submitting the GPU, we also add some clamping to ensure that the duration from command submission -> completion of GPU work is nonnegative. Bug: 230713131 Test: atest android.view.cts.FrameMetricsListenerTest Change-Id: Ia30b7732eaab71e4e29766f788d5cd94ec63c38a
Loading
Please register or sign in to comment