Vulkan SDK for Android 1.1.1 Mali Developer Center
MaliSDK::PNGSwapchain Class Reference

This class implements a swapchain outside the Vulkan API. Its main purpose is debugging without a screen since the swapchain will dump output directly to PNG files instead of displaying on-screen. More...

#include <png_swapchain.hpp>

Public Member Functions

Result init (const char *pBasePath, unsigned swapchainImagesCount)
 Initialize the swapchain. More...
 
 ~PNGSwapchain ()
 Destructor.
 
unsigned getNumImages () const
 Gets number of images in the swapchain. More...
 
void present (unsigned index, VkDevice device, VkDeviceMemory memory, unsigned width, unsigned height, unsigned numFences, VkFence *fences, bool coherent)
 Dump image for a swapchain index to disk. More...
 
unsigned acquire ()
 Acquire a new swapchain index. When acquire returns the image is ready to be presented into, so no semaphores are required.
 

Detailed Description

This class implements a swapchain outside the Vulkan API. Its main purpose is debugging without a screen since the swapchain will dump output directly to PNG files instead of displaying on-screen.

Definition at line 40 of file png_swapchain.hpp.

Member Function Documentation

◆ getNumImages()

unsigned MaliSDK::PNGSwapchain::getNumImages ( ) const
inline

Gets number of images in the swapchain.

Returns
Number of swapchain images.

Definition at line 55 of file png_swapchain.hpp.

◆ init()

Result PNGSwapchain::init ( const char *  pBasePath,
unsigned  swapchainImagesCount 
)

Initialize the swapchain.

Parameters
pBasePathThe base path that will be used for all PNG images.
swapchainImagesCountThe number of swapchain images to create in the internal queue.
Returns
Error code.

Definition at line 32 of file png_swapchain.cpp.

◆ present()

void PNGSwapchain::present ( unsigned  index,
VkDevice  device,
VkDeviceMemory  memory,
unsigned  width,
unsigned  height,
unsigned  numFences,
VkFence *  fences,
bool  coherent 
)

Dump image for a swapchain index to disk.

Parameters
indexIndex to present.
deviceVulkan device.
memoryThe VkDeviceMemory associated with the swapchain image. The memory must be tightly packed in VK_FORMAT_R8G8B8A8_UNORM format.
widthThe width of the swapchain image.
heightThe height of the swapchain image.
numFencesThe number of VkFences to wait on before dumping the texture.
[in]fencesFences to wait for.
coherentIf the swapchain memory is coherent, i.e. does not need to invalidate caches.

Definition at line 61 of file png_swapchain.cpp.


The documentation for this class was generated from the following files: