{"id":13894313,"url":"https://github.com/stetre/moonvulkan","last_synced_at":"2026-02-11T08:54:30.159Z","repository":{"id":90018011,"uuid":"87414980","full_name":"stetre/moonvulkan","owner":"stetre","description":"Lua bindings for Vulkan","archived":false,"fork":false,"pushed_at":"2022-02-06T12:18:09.000Z","size":14799,"stargazers_count":37,"open_issues_count":3,"forks_count":4,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-08-07T18:29:30.149Z","etag":null,"topics":["graphics","lua","lua-bindings","vulkan"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stetre.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-04-06T10:05:11.000Z","updated_at":"2024-03-19T18:29:51.000Z","dependencies_parsed_at":"2023-03-17T19:00:29.694Z","dependency_job_id":null,"html_url":"https://github.com/stetre/moonvulkan","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stetre%2Fmoonvulkan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stetre%2Fmoonvulkan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stetre%2Fmoonvulkan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stetre%2Fmoonvulkan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stetre","download_url":"https://codeload.github.com/stetre/moonvulkan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226248261,"owners_count":17595158,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graphics","lua","lua-bindings","vulkan"],"created_at":"2024-08-06T18:01:29.291Z","updated_at":"2026-02-11T08:54:30.118Z","avatar_url":"https://github.com/stetre.png","language":"C++","readme":"## MoonVulkan: Lua bindings for Vulkan\n\nMoonVulkan is a Lua binding library for the [Khronos Vulkan\u0026#8482; API](https://www.khronos.org/vulkan).\n\nIt runs on GNU/Linux \u003c!-- and on Windows (MSYS2/MinGW) --\u003e and requires \n[Lua](http://www.lua.org/) (\u003e=5.3) and Vulkan (\u003e= 1.0).\n\n\n_Author:_ _[Stefano Trettel](https://www.linkedin.com/in/stetre)_\n\n[![Lua logo](./doc/powered-by-lua.gif)](http://www.lua.org/)\n\n#### License\n\nMIT/X11 license (same as Lua). See [LICENSE](./LICENSE).\n\n#### Documentation\n\nSee the [Reference Manual](https://stetre.github.io/moonvulkan/doc/index.html).\n\n#### Getting and installing\n\nSetup the build environment as described [here](https://github.com/stetre/moonlibs), then:\n\n```sh\n$ git clone https://github.com/stetre/moonvulkan\n$ cd moonvulkan\nmoonvulkan$ make\nmoonvulkan$ sudo make install\n```\n\nTo use MoonVulkan, you'll also need at least one \n[Vulkan capable device](http://vulkan.gpuinfo.org/) with\n[updated drivers](https://www.howtogeek.com/242045/how-to-get-the-latest-nvidia-amd-or-intel-graphics-drivers-on-ubuntu/) \nand the \n[Vulkan loader](https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/blob/master/loader/LoaderAndLayerInterface.md).\n\nTo install the **Vulkan loader** you can either install the latest version of the \nthe [LunarG VulkanSDK](https://vulkan.lunarg.com/sdk/home) (preferred, since it is\nfrequently updated and it comes with validation layers, glslangValidator, etc), or\nyou can install the loader that comes with your Linux distro, e.g. on Ubuntu:\n\n```sh\n$ sudo apt install libvulkan-dev\n```\n\nNote that MoonVulkan does not link directly to the Vulkan loader (`libvulkan.so` on Linux), \nbut it builds dynamically its own internal dispatch tables instead. \nAs a consequence, `libvulkan.so` is not needed at compile time but it is required \nat runtime, so you have to make sure that it is reachable by the linker. \nYou can do this by installing it in the standard search directories (e.g. `/usr/lib/`),\nor by properly setting the LD_LIBRARY_PATH environment variable in the shell where you execute\nthe Lua scripts. \n\nFor example, assuming you are using the VulkanSDK version 1.1.77.0:\n```sh\n$ export LD_LIBRARY_PATH=\u003cpath-to-vulkan-sdk\u003e/1.1.77.0/x86_64/lib\n$ lua -e \"require('moonvulkan')\"     # just tests if it works\n```\n \n\n#### Example\n\nThe example below creates a Vulkan instance, enumerates the available GPUs, selects\nthe first one (if any), retrieves its properties and prints a few of them.\n\nOther examples can be found in the **examples/** directory contained in the release package.\n\n```lua\n-- MoonVulkan example: hello.lua\n\nlocal vk = require(\"moonvulkan\")\n\n-- Create a Vulkan instance:\nlocal instance = vk.create_instance({\n   application_info = {\n      application_name = 'Hello',\n      application_version = 1,\n      api_version = vk.make_version(1,0,0)\n   },\n   enabled_layer_names = { \n      'VK_LAYER_LUNARG_standard_validation', \n   -- 'VK_LAYER_LUNARG_api_dump', -- uncomment to see API call dumps\n   }\n})\n\n-- Enumerate physical devices:\nlocal physdevs = vk.enumerate_physical_devices(instance)\nprint(\"Number of available physical devices: \" ..#physdevs)\nassert(#physdevs \u003e 0)\n\n-- Select the first device:\nlocal gpu = physdevs[1]\n\n-- Get its properties, and print a few:\nlocal props = vk.get_physical_device_properties(gpu)\nprint(\"Device name: \".. props.device_name)\nprint(\"Device type: \".. props.device_type)\nprint(\"Driver version: \".. vk.version_string(props.driver_version))\nprint(\"API version: \".. vk.version_string(props.api_version))\n-- ...\n\n-- Note: objects are automatically destroyed at exit so there is no need for cleanup\n```\n\nThe script can be executed at the shell prompt with the standard Lua interpreter:\n\n```shell\n$ lua hello.lua\n```\n\n#### See also\n\n* [MoonLibs - Graphics and Audio Lua Libraries](https://github.com/stetre/moonlibs).\n","funding_links":[],"categories":["C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstetre%2Fmoonvulkan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstetre%2Fmoonvulkan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstetre%2Fmoonvulkan/lists"}