Skip to content

junlbj/android-vulkan-tutorials

 
 

Repository files navigation

Tutorial Samples

A set of samples to illustrate Vulkan API on Android with Android Studio To build on windows for tutorial02/03, copy/install ndk-r12 ( or better ) to a directory close to root dir ( c: ) to workaround command path 260 character limit issue;see totorial02/03's build.gradle for details. To Build samples:

  • Inside Andriod, menu File --> New --> Import Project
  • Find your sample's build.gradle and open it This will force andrioid studio to create local.properties file to config your SDK and NDK location; if you see error during importing, open local.properties file and correct the NDK and SDK location, then re-sync.

Other Resources: Additional Android Studio/NDK samples:

Pre-requisites

  • Android N device, API >= 24
  • Android Studio 2.2 beta1 or better
  • Android NDK
    • NDK-r12, compile as is
    • SDK with the latest cmake package

Test Matrix

Andrid Studio Version cmake in SDK NDK Result
2.2.0-beta1 3.6.3133135 NDK-r12 Yes
2.2.0-beta1 3.6.3133135 r13-beta1 NO

Known Issue:

  • r13-beta layer source needed to be updated
  • Studio Beta cmake 3.6.3133135 having issues with r13-beta

Getting Started

  1. Download Android Studio
  2. Download Android NDK-R12+
  3. Download source code
  4. Launch Android Studio.
  5. "Import Project" of the interested tutorial project to Android Studio
  6. Expand "Gradle" panel inside Android Studio, right hand edge of IDE, then "mathfu" --> "Tasks" --> "other" --> "get_mathfu".
  7. Select "app" inside Android Studio "Project" pane.
  8. Click Tools/Android/Sync Project with Gradle Files.
  9. Click Run/Run 'app'.

Tutorial List

  1. tutorial01_load_vulkan
    • create a vulkan device
  2. tutorial02_prebuilt_layers
    • create a vulkan device with vulkan validation layers
  3. tutorial03_traceable_layers
    • create a vulkan device with validation layers that could debug into
  4. tutorial04_first_window
    • create a vulkan window with WSI
  5. tutorial05_triangle
    • draw a simple triangle with android shaderc feature

License

Copyright 2016 Google, Inc.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

A set of samples to illustrate Vulkan API on Android

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 86.0%
  • C 9.6%
  • CMake 2.8%
  • Other 1.6%