Optimize a Game with Vulkan

Objective

Learn how the rendering with Vulkan API can be optimized by using 2 methods: fixed barriers and multi pass. Afterwards, compare performance results for every optimization.

Overview

Vulkan API

According to Khronos Group, "Vulkan is a new generation graphics and compute API that provides high-efficiency, cross-platform access to modern GPUs used in a wide variety of devices from PCs and consoles to mobile phones and embedded platforms". For more details and latest updates about Vulkan, go to https://www.khronos.org/vulkan/

Showcase (Sample App)

The showcase or sample app on which the performance will be tested is shown below with the following characteristics:

  • Scene with a lot of light sources

  • Deferred shading (heavy for mobile in general case)

  • Several optimization approaches

GPU Watch

Samsung delivers its own profiling tool called GPU. The profiling stats have the following information:

  1. FPS (Frame Per Second) counters

    • Current FPS

    • Average FPS

  2. CPU / GPU load

    • CPU load

    • GPU load

    • GPU clock frequency

  3. Frame info

    • Render pass stats

    • Vertex / Fragment shader load

Pipeline Barriers and Render Passes

In Vulkan, pipeline barriers and render passes are part of synchronization mechanisms. These methods can be used to optimize graphic performance of apps. Pipeline barriers are mainly concerned on the GPU resources transitioning including the source and destination of the resources. Render passes contain a set of framebuffer attachments, how it’s being used, and the rendering work being done.