{"id":22389451,"url":"https://github.com/adrien-ben/vulkan-tutorial-odin","last_synced_at":"2026-01-06T16:35:33.431Z","repository":{"id":264901187,"uuid":"891522834","full_name":"adrien-ben/vulkan-tutorial-odin","owner":"adrien-ben","description":"Vulkan tutorial written in Odin","archived":false,"fork":false,"pushed_at":"2024-12-04T12:45:02.000Z","size":2244,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T03:25:46.498Z","etag":null,"topics":["odin-lang","tutorial","vulkan"],"latest_commit_sha":null,"homepage":"","language":"Odin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adrien-ben.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-20T13:41:31.000Z","updated_at":"2024-12-30T15:18:02.000Z","dependencies_parsed_at":"2024-11-26T18:40:23.534Z","dependency_job_id":null,"html_url":"https://github.com/adrien-ben/vulkan-tutorial-odin","commit_stats":null,"previous_names":["adrien-ben/vulkan-tutorial-odin"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrien-ben%2Fvulkan-tutorial-odin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrien-ben%2Fvulkan-tutorial-odin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrien-ben%2Fvulkan-tutorial-odin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrien-ben%2Fvulkan-tutorial-odin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adrien-ben","download_url":"https://codeload.github.com/adrien-ben/vulkan-tutorial-odin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245737627,"owners_count":20664144,"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":["odin-lang","tutorial","vulkan"],"created_at":"2024-12-05T03:11:57.562Z","updated_at":"2026-01-06T16:35:33.399Z","avatar_url":"https://github.com/adrien-ben.png","language":"Odin","readme":"# Vulkan Tutorial\n\nVulkan [tutorial][0] written in [Odin][1].\n\n![result](/result.png \"Final result\")\n\n## Introduction\n\nThis repository will follow the structure of the original tutorial. Each commit will correspond to one page or on section of the page for long chapters.\n\nSometimes an 'extra' commit will be added with some refactoring, commenting or feature.\n\nThere are a few more things covered in the [more][5] branch. \n\n## Requirements\n\nYou need to have a [Vulkan SDK][2] and the [Odin compiler][3].\n\n## Running the project\n\n```sh\n# if you need to recompile the shaders\n.\\scripts\\compile_shaders.ps1\n# or ./scripts/compile_shaders.sh on linux\n\n# compile and run the application\nodin run .\n\n# or with validation layers\nodin run . -define:ENABLE_VALIDATION_LAYERS=true\n```\n\n## Commits\n\nThis section contains the summary of the project commits. Follow :rabbit2: to go to the related tutorial page and :smirk_cat: to go to the commit details.\n\n### 1.1.1: Base code [:rabbit2:](https://vulkan-tutorial.com/Drawing_a_triangle/Setup/Base_code) [:smirk_cat:](https://github.com/adrien-ben/vulkan-tutorial-odin/commit/a9f536894ec19df532365953d819b088e7e0c409)\n\nGLFW initialization, window's creation and main loop setup.\n\n### 1.1.2: Instance [:rabbit2:](https://vulkan-tutorial.com/Drawing_a_triangle/Setup/Instance) [:smirk_cat:](https://github.com/adrien-ben/vulkan-tutorial-odin/commit/47f80889c7d217800027a737e233f82f40225d7d)\n\nCreate and destroy the Vulkan instance.\n\n### 1.1.3: Validation layers [:rabbit2:](https://vulkan-tutorial.com/Drawing_a_triangle/Setup/Validation_layers) [:smirk_cat:](https://github.com/adrien-ben/vulkan-tutorial-odin/commit/4112b47237e5a297221ad214eeff92f698017fa4)\n\nEnable `VK_LAYER_KHRONOS_validation` validation layer and setup the debug messenger.\n\n\u003e Here we make use of Odin's [command-line defines][4] to control the activation of the validation layers (see [here](#running-the-project)).\n\n### 1.1.4: Physical devices and queue families [:rabbit2:](https://vulkan-tutorial.com/Drawing_a_triangle/Setup/Physical_devices_and_queue_families) [:smirk_cat:](https://github.com/adrien-ben/vulkan-tutorial-odin/commit/de593fb9aadedf31608d22421dbabc6fdd932f61)\n\nPhysical device and queue families selection.\n\n### 1.1.5: Logical device and queues [:rabbit2:](https://vulkan-tutorial.com/Drawing_a_triangle/Setup/Logical_device_and_queues) [:smirk_cat:](https://github.com/adrien-ben/vulkan-tutorial-odin/commit/ab33e87628e4de04e6965e3eeb99f80a6f5a9963)\n\nCreate the logical device and retrieve a graphics queue.\n\n### 1.2.1: Window surface [:rabbit2:](https://vulkan-tutorial.com/Drawing_a_triangle/Presentation/Window_surface) [:smirk_cat:](https://github.com/adrien-ben/vulkan-tutorial-odin/commit/1065f5f9b2da690ed1a363dd4003abf6a1e4951d)\n\nCreate the window surface and retrieve a queue supporting presentation.\n\n### 1.2.2: Swapchain [:rabbit2:](https://vulkan-tutorial.com/Drawing_a_triangle/Presentation/Swap_chain) [:smirk_cat:](https://github.com/adrien-ben/vulkan-tutorial-odin/commit/6837021099df672e282f394b6216a6c7f7eb8d5b)\n\nCreate the swapchain and retriving the swapchain images.\n\n### 1.2.3: Image views [:rabbit2:](https://vulkan-tutorial.com/Drawing_a_triangle/Presentation/Image_views) [:smirk_cat:](https://github.com/adrien-ben/vulkan-tutorial-odin/commit/95c40631c9898b4da91aacba7de7ff249fbbcfa0)\n\nCreate the image views for the swapchain images.\n\n### 1.3.2: Shader modules [:rabbit2:](https://vulkan-tutorial.com/Drawing_a_triangle/Graphics_pipeline_basics/Shader_modules) [:smirk_cat:](https://github.com/adrien-ben/vulkan-tutorial-odin/commit/4a2469ccee2cadbce85f4aea12c7535c64231ebe)\n\nCreate and compile the vertex and fragment shaders, load them, and the shader modules.\n\n### 1.3.3: Fixed functions [:rabbit2:](https://vulkan-tutorial.com/Drawing_a_triangle/Graphics_pipeline_basics/Fixed_functions) [:smirk_cat:](https://github.com/adrien-ben/vulkan-tutorial-odin/commit/be32fbaa5269bfa863ebc953d88f43faf54da2f5)\n\nSetup the states of the fixed functions of the graphics pipeline and create the pipeline layout.\n\n### 1.3.4: Render passes [:rabbit2:](https://vulkan-tutorial.com/Drawing_a_triangle/Graphics_pipeline_basics/Render_passes) [:smirk_cat:](https://github.com/adrien-ben/vulkan-tutorial-odin/commit/f48f87c17d5a7d6bc52834a2f4d5d7038f1fd6c6)\n\nCreate the render pass describing the attachments to use during rendering.\n\n### 1.3.5: Graphics pipeline conclusion [:rabbit2:](https://vulkan-tutorial.com/Drawing_a_triangle/Graphics_pipeline_basics/Conclusion) [:smirk_cat:](https://github.com/adrien-ben/vulkan-tutorial-odin/commit/4c54ad10b6c5ed57447f5b436e69731b48b60750)\n\nFinish the graphics pipeline creation.\n\n### 1.4.1: Framebuffers [:rabbit2:](https://vulkan-tutorial.com/Drawing_a_triangle/Drawing/Framebuffers) [:smirk_cat:](https://github.com/adrien-ben/vulkan-tutorial-odin/commit/becb034658915b9f1df1e372c31b76604074fa3f)\n\nCreate the swapchain framebuffers from the swapchain image views and the render pass.\n\n### 1.4.2: Command buffers [:rabbit2:](https://vulkan-tutorial.com/Drawing_a_triangle/Drawing/Command_buffers) [:smirk_cat:](https://github.com/adrien-ben/vulkan-tutorial-odin/commit/316cbb211381b34d55dfbc3a2387cc8b37f85132)\n\nCreate the command buffer and record commands to draw.\n\n### 1.4.3: Rendering and presentation [:rabbit2:](https://vulkan-tutorial.com/Drawing_a_triangle/Drawing/Rendering_and_presentation) [:smirk_cat:](https://github.com/adrien-ben/vulkan-tutorial-odin/commit/1544475ade1d713fdb506ffcd8e8000f54e2bfbe)\n\nFinalize drawing the triangle to the screen!\n\n### 1.4.4: Frames in flight [:rabbit2:](https://vulkan-tutorial.com/Drawing_a_triangle/Drawing/Frames_in_flight) [:smirk_cat:](https://github.com/adrien-ben/vulkan-tutorial-odin/commit/35316417372d8f98a08990ed1a8b9aeece8ccb30)\n\nImprove rendering by allowing overlap between cpu and gpu with multiple frames in flight.\n\n### 1.5: Swap chain recreation [:rabbit2:](https://vulkan-tutorial.com/Drawing_a_triangle/Swap_chain_recreation) [:smirk_cat:](https://github.com/adrien-ben/vulkan-tutorial-odin/commit/0d3026e2a86f70f9e7276a622aba95fe40f595b5)\n\nHandle swapchain recreation and window's resize.\n\n\u003e There is a bit of factoring around the swapchain creation and its dependencies here.\n\n\u003e Resizing detection is also done differently, `glfwSetFramebufferSizeCallback` is not used and we just manually check if the framebuffer was resized with `glfwGetFramebufferSize`.\n\n### 2.1: Vertex input description [:rabbit2:](https://vulkan-tutorial.com/Vertex_buffers/Vertex_input_description) [:smirk_cat:](https://github.com/adrien-ben/vulkan-tutorial-odin/commit/392daaf41001447482c16cdfa8e9a4d33bae353b)\n\nMove hardcoded vertices from the vertex shader to the application code and update pipeline's vertex input info.\n\n\u003e A new `vertex.odin` file is added to keep things more manageable.\n\n### 2.2: Vertex buffer creation [:rabbit2:](https://vulkan-tutorial.com/Vertex_buffers/Vertex_buffer_creation) [:smirk_cat:](https://github.com/adrien-ben/vulkan-tutorial-odin/commit/c26a2d79da79ba3fc67f5ce86ec4270125022cbe)\n\nCreate the actual vertex buffer and its memory, fill it and bind it before drawing.\n\n### 2.3: Staging buffer [:rabbit2:](https://vulkan-tutorial.com/Vertex_buffers/Staging_buffer) [:smirk_cat:](https://github.com/adrien-ben/vulkan-tutorial-odin/commit/1e671ee886002db570cb07a9a5ac970ba2f09ace)\n\nCreate a buffer whose memory is local to the graphics card and a staging buffer from which data is tranfered.\n\n### 2.4: Index buffer [:rabbit2:](https://vulkan-tutorial.com/Vertex_buffers/Index_buffer) [:smirk_cat:](https://github.com/adrien-ben/vulkan-tutorial-odin/commit/2c4f55e72bb3b57ac27df50d0f05f688396c78a8)\n\nRender a rectangle without duplicating vertices by using an index buffer.\n\n### 3.1: Descriptor layout and buffer [:rabbit2:](https://vulkan-tutorial.com/Uniform_buffers/Descriptor_layout_and_buffer) [:smirk_cat:](https://github.com/adrien-ben/vulkan-tutorial-odin/commit/2b48402abf4a13e45cef7beb699c4938d4a2217e)\n\nUpdate the vertex shader to apply a transformation and render it with a perspective camera.\nAlso create the descriptor set layout, the buffers used to send data to the shader and update it each frame.\n\n### 3.2: Descriptor pool and sets [:rabbit2:](https://vulkan-tutorial.com/Uniform_buffers/Descriptor_pool_and_sets) [:smirk_cat:](https://github.com/adrien-ben/vulkan-tutorial-odin/commit/4173db8246df3c5cda0801d0f5949f8e10e74646)\n\nCreate the descriptor set pool and sets, update them to point at the proper buffers and bind them before rendering.\n\n### 4.1: Images [:rabbit2:](https://vulkan-tutorial.com/Texture_mapping/Images) [:smirk_cat:](https://github.com/adrien-ben/vulkan-tutorial-odin/commit/eff2d8abc94731cd30fa96b5b1f3780433252a55)\n\nLoad an image file and upload its data to the GPU.\n\n### 4.2: Image view and sampler [:rabbit2:](https://vulkan-tutorial.com/Texture_mapping/Image_view_and_sampler) [:smirk_cat:](https://github.com/adrien-ben/vulkan-tutorial-odin/commit/81ef9de5fb9cf0a6725ba4753b309dc51d9ef5c3)\n\nCreate the image view and sampler and enable anisotropic filtering.\n\n### 4.3: Combined image sampler [:rabbit2:](https://vulkan-tutorial.com/Texture_mapping/Combined_image_sampler) [:smirk_cat:](https://github.com/adrien-ben/vulkan-tutorial-odin/commit/125e3c2f54b3a9dcbb160fdbac523b94eb3258eb)\n\nUpdate the descriptor sets, Vertex structure and shaders to use the loaded image as a texture for the displayed rectangle.\n\n### 5: Depth buffering [:rabbit2:](https://vulkan-tutorial.com/Depth_buffering) [:smirk_cat:](https://github.com/adrien-ben/vulkan-tutorial-odin/commit/57734c6b04bda781805a1e89676a3c7b2e36c3fd)\n\nRender overlapping geometry, create a depth texture and set up depth testing.\n\n### 6.0: Obj file loader [:smirk_cat:](https://github.com/adrien-ben/vulkan-tutorial-odin/commit/fa295d4abeb2a97888e3146af3144cc9173f1de3)\n\n**This is not part of the original Vulkan tutorial!**\n\nImplement a simple (and most likely incomplete) loader for .obj files in preparation for the next chapter.\nIt overlaps a little with the next chapter though as it already merges duplicate vertices and invert the texture coordinates y axis.\n\n\u003e This is a very simple loader, it might not work for other more complicated loader. Also it only outputs positions and texture coordinate since we won't use normals.\n\n### 6: Loading models [:rabbit2:](https://vulkan-tutorial.com/Loading_models) [:smirk_cat:](https://github.com/adrien-ben/vulkan-tutorial-odin/commit/8096588d847a5fae5da1ac9ac717d8221ae84303)\n\nLoad an .obj model and render it.\n\n\u003e Since we don't use the vertex color anymore I just remove them altogether.\n\n\u003e The tutorial already mentions it but the model doesn't play nicely with backface culling so I disabled it.\n\n### 7: Generating Mipmaps [:rabbit2:](https://vulkan-tutorial.com/Generating_Mipmaps) [:smirk_cat:](https://github.com/adrien-ben/vulkan-tutorial-odin/commit/9ffb71a55e425014495fe6443a6fb73e087a4c71)\n\nGenerate mipmaps for the model texture and update sampler to make use of the new mip levels.\n\n\u003e Model rotation is now controlled with the right and left keys.\n\n### 8: Multisampling [:rabbit2:](https://vulkan-tutorial.com/Multisampling) [:smirk_cat:](https://github.com/adrien-ben/vulkan-tutorial-odin/commit/b8a7ec9fdd0b16693b25546a7eae902073fbc952)\n\nAdd MSAA support.\n\n### Extra.2: Cleanup and refactoring [:smirk_cat:](https://github.com/adrien-ben/vulkan-tutorial-odin/commit/b64bd0ffd0da0db6ac42f7235a0339eaf4ec7986)\n\n**This is not part of the original Vulkan tutorial!**\n\nClean up the code, refactor to avoid passing to many things around all the time, make to code more \"Odin-like\" by applying idioms from the language.\n\n\n\n[0]: https://vulkan-tutorial.com/\n[1]: https://odin-lang.org/\n[2]: https://www.lunarg.com/vulkan-sdk/\n[3]: https://odin-lang.org/docs/install/\n[4]: https://odin-lang.org/docs/overview/#command-line-defines\n[5]: https://github.com/adrien-ben/vulkan-tutorial-odin/tree/more\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrien-ben%2Fvulkan-tutorial-odin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadrien-ben%2Fvulkan-tutorial-odin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrien-ben%2Fvulkan-tutorial-odin/lists"}