Optimize, Develop, and Debug with Vulkan Android Developer Tools

Today we’re happy to bring you a preview of android development tools for Vulkan™. Vulkan is a new 3D rendering API that we’ve helped to develop as a member of Khronos, geared at providing specific, low-overhead GPU (Graphics Processor Unit) management to developers. Vulkan’s reduction of cpu overhead permits some artificial benchmarks to check as more as ten times the draw decision throughput on one core as compared to OpenGL es. Combined with a threading-friendly API style that permits multiple cores to be employed in parallel with high potency, this offers a weighty boost in performance for draw-call grave applications.

Vulkan support is on the market currently via the android N Preview on devices that support it, together with Nexus 5X and Nexus 6P. (Of course, you’ll still be able to use OpenGL es as well!)

To help developers begin coding quickly, we’ve place along a group of samples and guides that illustrate how to use Vulkan effectively.

You can see Vulkan in action running on an android device with Robert Hodgin’s Fish Tornado demo, ported by Google’s Art, Copy, and Code team:

Optimization: The Vulkan API

There are several similarities between OpenGL es and Vulkan, however Vulkan offers new options for developers who ought to build each millisecond count.

Application Management Of Memory Allocation.

Vulkan provides mechanisms for fine-grained management of how and once memory is allotted on the GPU. this enables developers to use their own allocation and tautologize policies to suit their application, ultimately reducing execution and memory overhead and permitting applications to manage when expensive allocations occur.

Asynchronous Command Generation.

In OpenGL es, draw calls are issued to the GPU as shortly as the application calls them. In Vulkan, the appliance instead submits draw calls to command buffers, that permits the work of forming and recording the draw decision to be separated from the act of issue it to the GPU. By spreading command generation across many threads, applications will a lot of effectively create use of multiple cpu cores. These command buffers also can be reused, reducing the overhead concerned in command creation and issuing.

No Hidden Work.

One OpenGL es pitfall is that some commands might trigger work at points that aren’t expressly spelled out in the API specification or created obvious to the developer. Vulkan makes performance a lot of anticipated and consistent by specifying that commands can expressly trigger work and which can not.

Multi-threaded Style, From The Bottom Up.

All OpenGL es applications should issue commands for a context solely from one thread so as to render predictably and properly. in contrast, Vulkan doesn’t have this demand, permitting applications to do work like command buffer generation in parallel— but at an equivalent time, it doesn’t create implicit guarantees regarding the security of modifying and reading information from multiple threads at a similar time. the ability and responsibility of managing thread synchronization is within the hands of the appliance.

Vulkan mandates support for SPIR-V, an intermediate language for shaders. this permits developers to compile shaders before time, and ship SPIR-V binaries with their applications. These binaries are easier to parse than high-level languages like GLSL, which implies less variance in however drivers perform this parsing. SPIR-V as well as opens the door for third parties to supply compilers for specialised or cross-platform shading languages.

Optional Validation.

OpenGL es validates each command you decision, checking that arguments are among expected ranges, and objects are within the correct state to be operated upon. Vulkan doesn’t perform any of this validation itself. Instead, developers will use optional rectify tools to confirm their calls are correct, incurring no run-time overhead within the final product.

Debugging: Validation Layers

As noted on top of, Vulkan’s lack of implicit validation needs developers to form use of tools outside the API so as to validate their code. Vulkan’s layer mechanism permits validation code and different developer tools to examine each API decision during development, while not incurring any overhead within the shipping version. Our guides show you how to make the validation layers to be used with the android NDK, supplying you with the tools necessary to make bug-free Vulkan code from begin to end.

Develop: Shader toolchain

The Shaderc assortment of tools provides developers with build-time and run-time tools for compilation GLSL into SPIR-V. Shaders will be compiled at build time exploitation glslc, a command-line compiler, for simple integration into existing build systems. Or, for shaders that are generated or altered throughout execution, developers will use the Shaderc library to compile GLSL shaders to SPIR-V via a C interface. each tools are designed on high of Khronos’s reference compiler.

Additional Resources

The Vulkan ecosystem is a broad one, and also the resources to urge you started don’t finish here. there’s a wealth of fabric to explore, including:

Khronos’s Vulkan resources, as well as overviews, reference pages, specification, and community demos

Android’s documentation for Vulkan

Android Vulkan samples

Android Vulkan tutorials

LunarG’s LunarXchange has resources for Windows and Linux Vulkan development