KhronosGroup / Vulkan-Samples

One stop solution for all Vulkan samples
Apache License 2.0
4.05k stars 604 forks source link
best-practices cpp graphics graphics-programming khronos tutorials vulkan vulkan-api vulkan-samples

////

image::banner.jpg[Vulkan Samples banner]

ifndef::site-gen-antora[] == Renaming Default Branch

We have recently transitioned the repository to use the main branch by default. All remote git usage is handled automatically. To update your local repository to use main please use the following commands


git branch -m master main && git fetch origin && git branch -u origin/main main && git remote set-head origin -a

endif::[]

== Introduction

The Vulkan Samples is collection of resources to help you develop optimized Vulkan applications.

If you are new to Vulkan the xref:samples/api/README.adoc[API samples] are the right place to start. Additionally you may find the following links useful:

ifdef::site-gen-antora[]

ifndef::site-gen-antora[]

xref:samples/performance/README.adoc[Performance samples] show the recommended best practice together with real-time profiling information. They are more advanced but also contain a detailed tutorial with more in-detail explanations.

=== Goals

== Samples

== General information

== Setup

Prerequisites: https://git-scm.com/downloads[git] with https://docs.github.com/en/repositories/working-with-files/managing-large-files/installing-git-large-file-storage[git large file storage (git-lfs)].

Clone the repo with submodules using the following command:


git clone --recurse-submodules https://github.com/KhronosGroup/Vulkan-Samples.git cd Vulkan-Samples

Follow build instructions for your platform below.

== Build

=== Supported Platforms

== Usage

The following shows some example command line usage on how to configure and run the Vulkan Samples.

Make sure that you are running the samples from the root directory of the repository. Otherwise the samples will not be able to find the assets. ./build/app/bin///vulkan_samples


For the entire usage use

vulkan_samples --help

For subcommand usage use

vulkan_samples --help

Run Swapchain Images sample

vulkan_samples sample swapchain_images

Run AFBC sample in benchmark mode for 5000 frames

vulkan_samples sample afbc --benchmark --stop-after-frame 5000

Run bonza test offscreen

vulkan_samples test bonza --headless

Run all the performance samples for 10 seconds in each configuration

vulkan_samples batch --category performance --duration 10

Run Swapchain Images sample on an Android device

adb shell am start-activity -n com.khronos.vulkan_samples/com.khronos.vulkan_samples.SampleLauncherActivity -e sample swapchain_images

== Tests

== License

See link:LICENSE[LICENSE].

This project has some third-party dependencies, each of which may have independent licensing:

This project uses assets from https://github.com/KhronosGroup/Vulkan-Samples-Assets[vulkan-samples-assets]. Each one has its own license.

=== Trademarks

Vulkan is a registered trademark of the Khronos Group Inc.

== Contributions

Donated to Khronos by Arm, with further contributions by Sascha Willems and Adam Sawicki. See xref:CONTRIBUTORS.adoc[CONTRIBUTORS] for the full contributor list.

Also see xref:CONTRIBUTING.adoc[CONTRIBUTING] for contribution guidelines.

== Related resources