Setup

The following software and tools are needed to optimize apps for Vulkan:

  • Visual Studio 2017 ( latest update)

  • Android NDK (15+, tested on r15c)

  • Android SDK (install platform 21)

  • CMake

  • Ninja build

  • Java SE Development Kit (JDK) 8

Initial Setup

Enable the GPU Watch on your mobile phone through the following:

Set environment variables

  • JAVA_HOME to point to JDK installation

  • NDK_ROOT to point to Android NDK installation

  • ANDROID_HOME to point to Android SDK installation

  • Add following directory to PATH:

    • CMake bin folder

    • Ninja installation folder (or copy ninja.exe to CMake bin folder)

    • %JAVA_HOME%\bin

    • %ANDROID_HOME%\tools

    • %ANDROID_HOME%\platform-tools

Build and launch project from Visual Studio

  • Connect mobile device for testing

  • Select one of the configurations (1-BASE, 2-BARRIERS, etc.)

  • Go to menu Debug > Start Without Debugging (or press Ctrl+F5)

  • This will build, upload and launch application on the connected device

Build and launch project from terminal

  • Run /cmake/build-stepN.bat where N is the showcase configuration step.

  • Run /cmake/deploy.bat to upload APK to device.


Add Launch showcase button to Visual Studio

  • Go to menu Tools > Customize > Commands

  • Select Toolbar and Standard

  • Click Add Command

  • Pick Debug > Start Without Debugging

  • Press Ok

  • Select newly added item and click Modify Selection

  • Change Name to Launch showcase and select style Image and Text

  • Position of the item can be modified by Move Down and Move Up

Add Toggle GPUWatch button to Visual Studio

  • Go to menu Tools > External Tools

  • Click Add

  • Change Title to Toggle GPUWatch

  • Change Command to /cmake/toggle_gpuwatch.bat

  • Remember position of newly added command (first index is 1)

  • Press Ok

  • Go to menu Tools > Customize > Commands

  • Select Toolbar and Standard

  • Click Add Command

  • Pick Tools > External Command N, where N is the index of the command added earlier

  • Press Ok