1 Star 0 Fork 0

hhhhhh/vulkan-sdk

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Vulkan SDK for Android

Vulkan SDK banner

Introduction

The Vulkan Software Development Kit is a collection of resources to help you build Vulkan applications for a platform with a Mali GPU and an ARM processor. You can use it for creating new applications, training, and exploration of implementation possibilities.

Setting up development environment

Minimum NDK requirements

Minimum android-ndk-r12 is required. The NDK can be downloaded from Android Studio 2.2 or later. It is recommended to use the NDK provided in Android Studio.

OS requirements

The Vulkan SDK has been tested to build on Linux (Android Studio) and Windows (Android Studio). Partial support for running on Linux desktop is also included.

Android requirements

Not all Android devices support Vulkan. To make sure your Android device has the Vulkan API supported download the Hardware CapsViewer for Vulkan app to verify your device's status.

License

The software is provided under an MIT license. Contributions to this project are accepted under the same license.

Building

Check out submodules

This repo uses GLM and STB as submodules, before building, make sure you pull those in.

git submodule init
git submodule update

Build and run samples from Android Studio

  • Open Android Studio 3.4 or newer
  • Open an existing Android Studio project
  • Import a sample project
  • You might be prompted to update or install the Gradle wrapper. Do so if asked.
  • You might be prompted to download and/or update Android SDK tools if Android Studio has not downloaded these before.
  • Under Tools -> Android -> SDK manager, install cmake, lldb and NDK components if these are not installed already.
  • In the top menu, run Build -> Make Project.
  • In the bottom of the screen, the Messages tab should display a build log which shows that libnative.so has been built and that build was successful.
  • Run the app on the device by pressing the Play button on the top toolbar.
  • To debug the code, Run -> Debug app. In the project view, you will find app/cpp/native/hellotriangle.cpp or similar. You can set breakpoints and step through the code.

Build samples for desktop Linux

mkdir build
cd build
cmake ..
make -j8

will build samples with a PNG backend. Running the binary on desktop should dump out PNG images. This is useful when developing samples and for creating screenshots.

X11 or Wayland backends can be used instead on Linux by passing in extra parameters to cmake:

cmake .. -DPLATFORM=wayland   # or xcb for X11

Documentation

For online tutorials, documentation and explanation of the samples, see Vulkan SDK documentation.

To build the same documentation for yourself for offline use, build Doxygen documentation with ./build_documentation.sh. This requires Doxygen to be installed on your machine.

Adding new samples

The build system for samples is designed to be as general as possible. To create a new sample based on hellotriangle:

cd samples
$EDITOR CMakeLists.txt             # add_subdirectory(newsample)
mkdir newsample
cp -r hellotriangle/{CMakeLists.txt,app,build.gradle,settings.gradle} newsample/
$EDITOR CMakeLists.txt             # Edit add_sample
$EDITOR app/AndroidManifest.xml    # Edit manifest:package
$EDITOR app/res/values/strings.xml # Edit resources:string

Source files go in newsample/, GLSL source files go in newsample/shaders and general assets (if needed) go in newsample/assets.

Samples must implement the VulkanApplication interface as well as implementing MaliSDK::create_application().

#include "framework/application.hpp"
#include "framework/context.hpp"
#include "framework/common.hpp"
#include "framework/assets.hpp"
#include "platform/platform.hpp"

class MyVulkanApplication : public VulkanApplication
{
    // ...
};

VulkanApplication* MaliSDK::create_application()
{
    return new MyVulkanApplication();
}
Copyright (c) 2016-2017, ARM Limited and Contributors SPDX-License-Identifier: MIT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

暂无描述 展开 收起
README
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/input-output/vulkan-sdk.git
git@gitee.com:input-output/vulkan-sdk.git
input-output
vulkan-sdk
vulkan-sdk
master

搜索帮助