Giter Club home page Giter Club logo

vk-samples's Introduction

vk-samples

Samples for vk (Common Lisp/CFFI bindings for the Vulkan API).

Requirements

Supported implementations & Operating systems

See vk for supported CL implementations.

vk-samples has currently only been tested on Linux, but Windows should work as well. Some of the samples might also work on MacOS, but currently it is not guaranteed that samples using a window are run on the main thread (which is required for graphics applications on MacOS), so you might need to wrap them in a (trivial-main-thread:with-body-in-main-thread).

CL dependencies

Quicklisp

  • alexandria
  • cffi
  • cl-glfw
  • rtg-math
  • trivial-main-thread (TODO: actually use this - MacOS support)
  • vk

Not on Quicklisp (yet)

All of the following dependencies can be loaded via Quicklisp when they are cloned to one of your ql:*local-project-directories*.

  • shaderc
  • varjo: this is my fork of Varjo, which adds Vulkan support and is not merged into the original repo (yet?).

External dependencies

Samples

The following table shows all currently available samples. You can either run them individually (e.g. (vk-samples:01-init-instance)) or run all of them except for ray-tracing using (vk-samples:run-all-samples). As with the original VulkanSamples by LunarG all samples prefixed with a number represent the progression from initializing a Vulkan instance to drawing a cube on screen. For the most part the things shown in the samples have also been refactored into the package vk-samples/utils, so later sample don't repeat too much from the earlier samples.

Name Description
01-init-instance Shows how to create and destroy a Vulkan instance.
02-enumerate-devices Shows how to enumerate physical devices.
03-init-device Shows how to create and destroy a Vulkan device.
04-init-command-buffer Shows how to create and destroy a command pool and allocate and free command buffers.
05-init-swapchain Shows how to initialize a Vulkan swapchain.
06-init-depth-buffer Shows how to create and destroy a depth buffer.
07-init-uniform-buffer Shows how to create and destroy a uniform buffer and how to write and read memory from it.
08-init-pipeline-layout Shows how to create and destroy a Vulkan pipeline layout.
09-init-descriptor-sets Shows how to allocate descriptor sets and how to write to them.
10-init-render-pass Shows how to create and destroy a Vulkan render pass with a color and a depth attachment.
11-init-shaders Shows how to create and destroy Vulkan shader modules from SPIR-V binaries.
12-init-frame-buffers Shows how to create and destroy Vulkan framebuffers.
13-init-vertex-buffer Shows how to create, fill and destroy a vertex buffer and how to record commands and submit them to a queue.
14-init-pipeline Shows how to create and destroy a Vulkan graphics pipeline.
15-draw-cube This puts everything from the previous samples together and shows how to finally draw a cube onto a window.
create-debug-utils-messenger Shows how to create and destroy a debug callback.
create-debug-utils-messenger-next Shows how to use the NEXT slot of a VK:INSTANCE-CREATE-INFO to create and destroy a debug callback alongside a Vulkan instance.
compile-shaders-from-repl This is the same as 15-draw-cube, but it compiles the shaders at runtime using shaderc.
compile-shaders-from-repl This is the same as compile-shaders-from-repl, but the shaders are written in Vari. The shaders are slightly different, because the earliest GLSL version Varjo can produce shaders targeted at Vulkan (i.e. SPIR-V compilation) for.
ray-tracing Shows how to use the Vk_KHR_ray_tracing extension. This sample is not run by run-all-samples.

Ray Tracing Sample

Run (vk-samples:ray-tracing) to start the sample. Note that VK_KHR_ray_tracing needs to be supported on the device. In contrast to all other samples, this sample starts an infinite loop that has to be terminated by the user by closing the window, or by pressing Q or ESCAPE. The sample renderes a bunch of textured cubes using ray tracing or standard rasterization. Pressing R switches the rendering pipeline used. When using the ray tracing pipeline, shadows are computed using secondary rays. The camera can be moved by pressing the left or right mouse button while moving the mouse or by using the scroll wheel. Use M to cycle through camera modes and CTRL, SHIFT, and ALT while moving to change the movement type.

Acknowledgements

The samples in this repository closely follows the VulkanSamples by LunarG as well as the samples for Vulkan-Hpp.

vk-samples's People

Contributors

jolifantobambla avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.