Considerations on using the PVRCarbon Player#
The primary goal of PVRCarbon is to be able to record an application’s stream of API calls on any given platform or implementation and play it back on another platform or implementation, putting emphasis on being able to debug the application’s behaviour on a given target platform.
PVRCarbon can be used to analyse performance and memory bandwidth, but these use cases are not part of the core design of the Player. The PVRCarbon Recorder and Player have some nuances that are required in order for them to achieve their desired functionality, and these nuances have the potential to affect the performance metrics. This section outlines some of the additional processing that may occur as part of the Player’s functionality.
There are some additional tasks that the PVRCarbon Player performs when playing back Vulkan recordings. These may not always affect performance, but they are outlined here for clarity.
The first case to consider is if the Player fails to create a swapchain to match that of the recording (either because it was unable to acquire the same swapchain image, or if it cannot create a new swapchain with matching format and dimensions). In these instances, the queue present time may have a blit introduced to compensate. The Player may output a warning message when this happens.
The PVRCarbon format conversion layer (VK_LAYER_POWERVR_format_emulation
) adds compute work to decompress PVRTC and ETC2 textures if the playback device doesn’t natively support these formats.
The PVRCarbon Player’s ray tracing support may introduce additional compute work into the playback stream to ensure the successful playback of ray tracing workloads; primarily by switching recorded handles with playback handles. In both cases, this extra work is wrapped in labels through the VK_EXT_debug_utils
extension. These labels are prefixed with “PVRCarbon” for identification in other graphics development tools.
The additional processing from ray tracing support is required for remapping acceleration structures and shader group handles within buffers. This only happens if PVRCarbon cannot make use of Vulkan’s capture replay features. There is a different feature for capture replay of acceleration structure handles and another for capture replay of shader group handles.
For use in automated testing, we recommend PVRCarbon recordings to be captured on a platform as similar as possible to the playback/testing platform. This will help to minimise any variations that may cause the extra processing to occur.
One method of reducing the performance impact from the Player itself is to use the --mode=profile
option from the command line. This enables features in the player that allows the PVRCarbon data to be preloaded, which can help reduce I/O stalls that would otherwise affect profiling information.
There are also considerations that can be made when taking a recording. By default, PVRCarbon will attempt to override some of the alignment values during recording in order to improve the portability of the capture. Disabling these overrides using this method will make the recordings less portable, but may help to produce memory profiles closer to the original application when played back.