All Projects → stetre → moonvulkan

stetre / moonvulkan

Licence: other
Lua bindings for Vulkan

Programming Languages

C++
36643 projects - #6 most used programming language
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to moonvulkan

AI-Lossless-Zoomer
AI无损放大工具
Stars: ✭ 940 (+2932.26%)
Mutual labels:  vulkan
lcurses
Lua bindings for Curses
Stars: ✭ 60 (+93.55%)
Mutual labels:  lua-bindings
VkInline
A tool to make it easy to use Vulkan from Python. An interface for computation and off-screen rendering.
Stars: ✭ 16 (-48.39%)
Mutual labels:  vulkan
RavEngine
A fast, easy to use C++20 3D game library for modern computers
Stars: ✭ 122 (+293.55%)
Mutual labels:  vulkan
DummyEngine
Small cross platform Vulkan/OpenGL 3d engine for personal experimentation
Stars: ✭ 76 (+145.16%)
Mutual labels:  vulkan
drivers-linux-firmware
MOVED: https://gitlab.com/q3aql/drivers-linux-firmware
Stars: ✭ 28 (-9.68%)
Mutual labels:  vulkan
tortuga
A modern game engine built using dot net core
Stars: ✭ 14 (-54.84%)
Mutual labels:  vulkan
LowLevelAPIDemo
Evergine Low-Level API samples.
Stars: ✭ 12 (-61.29%)
Mutual labels:  vulkan
vkhelpers
Vulkan c helper library
Stars: ✭ 25 (-19.35%)
Mutual labels:  vulkan
vulkan-seed
🌋🌱 A Vulkan starter repo that you could use to get the ball rolling.
Stars: ✭ 57 (+83.87%)
Mutual labels:  vulkan
nuklear-glfw-vulkan
A nuklear adapter that does Vulkan rendering
Stars: ✭ 52 (+67.74%)
Mutual labels:  vulkan
gfr
Graphics Flight Recorder (GFR) is a Vulkan layer to help trackdown and identify the cause of GPU hangs and crashes.
Stars: ✭ 49 (+58.06%)
Mutual labels:  vulkan
virtualGizmo3D
Virtual GIZMO - 3D object manipulator / orientator, via mouse, with pan and dolly/zoom features
Stars: ✭ 36 (+16.13%)
Mutual labels:  vulkan
hpc
Learning and practice of high performance computing (CUDA, Vulkan, OpenCL, OpenMP, TBB, SSE/AVX, NEON, MPI, coroutines, etc. )
Stars: ✭ 39 (+25.81%)
Mutual labels:  vulkan
Vulkan-MemoryModel
Vulkan Memory Model
Stars: ✭ 95 (+206.45%)
Mutual labels:  vulkan
spirv cross
Safe Rust wrapper around SPIRV-Cross
Stars: ✭ 75 (+141.94%)
Mutual labels:  vulkan
ogl to vlk
Vulkan Tutorials For OpenGL Developers
Stars: ✭ 16 (-48.39%)
Mutual labels:  vulkan
mojoshader
Use Direct3D shaders with other 3D rendering APIs.
Stars: ✭ 91 (+193.55%)
Mutual labels:  vulkan
CrossWindow-Demos
🥪 Examples of how to use CrossWindow for things like rendering graphics, listening to events, etc.
Stars: ✭ 48 (+54.84%)
Mutual labels:  vulkan
wgpu-mc
Rust-based replacement for the default Minecraft renderer
Stars: ✭ 254 (+719.35%)
Mutual labels:  vulkan

MoonVulkan: Lua bindings for Vulkan

MoonVulkan is a Lua binding library for the Khronos Vulkan™ API.

It runs on GNU/Linux and requires Lua (>=5.3) and Vulkan (>= 1.0).

Author: Stefano Trettel

Lua logo

License

MIT/X11 license (same as Lua). See LICENSE.

Documentation

See the Reference Manual.

Getting and installing

Setup the build environment as described here, then:

$ git clone https://github.com/stetre/moonvulkan
$ cd moonvulkan
moonvulkan$ make
moonvulkan$ sudo make install

To use MoonVulkan, you'll also need at least one Vulkan capable device with updated drivers and the Vulkan loader.

To install the Vulkan loader you can either install the latest version of the the LunarG VulkanSDK (preferred, since it is frequently updated and it comes with validation layers, glslangValidator, etc), or you can install the loader that comes with your Linux distro, e.g. on Ubuntu:

$ sudo apt install libvulkan-dev

Note that MoonVulkan does not link directly to the Vulkan loader (libvulkan.so on Linux), but it builds dynamically its own internal dispatch tables instead. As a consequence, libvulkan.so is not needed at compile time but it is required at runtime, so you have to make sure that it is reachable by the linker. You can do this by installing it in the standard search directories (e.g. /usr/lib/), or by properly setting the LD_LIBRARY_PATH environment variable in the shell where you execute the Lua scripts.

For example, assuming you are using the VulkanSDK version 1.1.77.0:

$ export LD_LIBRARY_PATH=<path-to-vulkan-sdk>/1.1.77.0/x86_64/lib
$ lua -e "require('moonvulkan')"     # just tests if it works

Example

The example below creates a Vulkan instance, enumerates the available GPUs, selects the first one (if any), retrieves its properties and prints a few of them.

Other examples can be found in the examples/ directory contained in the release package.

-- MoonVulkan example: hello.lua

local vk = require("moonvulkan")

-- Create a Vulkan instance:
local instance = vk.create_instance({
   application_info = {
      application_name = 'Hello',
      application_version = 1,
      api_version = vk.make_version(1,0,0)
   },
   enabled_layer_names = { 
      'VK_LAYER_LUNARG_standard_validation', 
   -- 'VK_LAYER_LUNARG_api_dump', -- uncomment to see API call dumps
   }
})

-- Enumerate physical devices:
local physdevs = vk.enumerate_physical_devices(instance)
print("Number of available physical devices: " ..#physdevs)
assert(#physdevs > 0)

-- Select the first device:
local gpu = physdevs[1]

-- Get its properties, and print a few:
local props = vk.get_physical_device_properties(gpu)
print("Device name: ".. props.device_name)
print("Device type: ".. props.device_type)
print("Driver version: ".. vk.version_string(props.driver_version))
print("API version: ".. vk.version_string(props.api_version))
-- ...

-- Note: objects are automatically destroyed at exit so there is no need for cleanup

The script can be executed at the shell prompt with the standard Lua interpreter:

$ lua hello.lua

See also

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].