Convert Figma logo to code with AI

KhronosGroup logoVulkan-Guide

One stop shop for getting started with the Vulkan API

1,887
164
1,887
18

Top Related Projects

10,152

C++ examples for the Vulkan graphics API

Vulkan Samples

Awesome Vulkan ecosystem

Easy to integrate Vulkan memory allocation library

Quick Overview

The Vulkan-Guide repository is a comprehensive resource for learning and understanding the Vulkan graphics and compute API. It provides a collection of tutorials, best practices, and explanations to help developers get started with Vulkan and improve their understanding of its concepts and usage.

Pros

  • Offers in-depth explanations of Vulkan concepts and features
  • Provides practical examples and best practices for Vulkan development
  • Regularly updated to include the latest Vulkan specifications and features
  • Maintained by the Khronos Group, the official creators of Vulkan

Cons

  • May be overwhelming for absolute beginners in graphics programming
  • Requires a solid understanding of computer graphics concepts
  • Some sections may lack detailed code examples for complex topics
  • Navigation through the guide can be challenging due to the vast amount of information

Note: As this is not a code library but rather a documentation and guide repository, the code examples and getting started instructions sections have been omitted.

Competitor Comparisons

10,152

C++ examples for the Vulkan graphics API

Pros of Vulkan

  • Extensive collection of practical examples and demos
  • Includes advanced rendering techniques and performance optimizations
  • Cross-platform support with CMake build system

Cons of Vulkan

  • Less focus on beginner-friendly explanations and concepts
  • May not always align with the latest Vulkan specifications
  • Lacks comprehensive documentation on Vulkan fundamentals

Code Comparison

Vulkan-Guide (initialization):

VkInstanceCreateInfo createInfo = {};
createInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
createInfo.pApplicationInfo = &appInfo;
vkCreateInstance(&createInfo, nullptr, &instance);

Vulkan (initialization):

VkInstanceCreateInfo instanceCreateInfo = vks::initializers::instanceCreateInfo();
instanceCreateInfo.pApplicationInfo = &appInfo;
vkCreateInstance(&instanceCreateInfo, nullptr, &instance);

The Vulkan repository uses custom initializers for a more concise setup, while Vulkan-Guide follows a more standard approach. Vulkan-Guide's code is more explicit, making it easier for beginners to understand each step of the initialization process.

Vulkan Samples

Pros of VulkanSamples

  • Provides practical, hands-on examples of Vulkan implementation
  • Offers a wide range of samples covering various Vulkan features
  • Includes platform-specific code for multiple operating systems

Cons of VulkanSamples

  • May be overwhelming for beginners due to its comprehensive nature
  • Requires more setup and compilation compared to a guide-based approach
  • Some samples might become outdated as Vulkan evolves

Code Comparison

Vulkan-Guide (conceptual explanation):

// Explanation of a Vulkan instance creation
VkInstanceCreateInfo createInfo = {};
createInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
createInfo.pApplicationInfo = &appInfo;

VulkanSamples (practical implementation):

VkInstanceCreateInfo inst_info = {};
inst_info.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
inst_info.pApplicationInfo = &app_info;
err = vkCreateInstance(&inst_info, NULL, &demo->inst);

VulkanSamples provides concrete implementation examples, while Vulkan-Guide focuses on explaining concepts. VulkanSamples is better for developers who prefer learning by doing, while Vulkan-Guide is more suitable for those who want to understand the underlying principles before diving into code.

Awesome Vulkan ecosystem

Pros of awesome-vulkan

  • Comprehensive collection of Vulkan resources, including tutorials, tools, and libraries
  • Community-driven project with frequent updates and contributions
  • Covers a wide range of topics and skill levels

Cons of awesome-vulkan

  • Less structured and organized compared to Vulkan-Guide
  • May contain outdated or deprecated resources
  • Lacks official Khronos Group endorsement

Code comparison

While both repositories primarily focus on documentation and resources, Vulkan-Guide occasionally includes code snippets for illustration:

Vulkan-Guide:

VkInstanceCreateInfo create_info = {};
create_info.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
create_info.pApplicationInfo = &app_info;

awesome-vulkan doesn't typically include code snippets, as it's mainly a curated list of resources.

Summary

Vulkan-Guide offers an official, structured approach to learning Vulkan, while awesome-vulkan provides a diverse collection of community-curated resources. Vulkan-Guide is better for beginners and those seeking authoritative information, whereas awesome-vulkan is valuable for discovering a wide range of Vulkan-related tools and projects.

Easy to integrate Vulkan memory allocation library

Pros of VulkanMemoryAllocator

  • Provides a complete memory allocation library for Vulkan applications
  • Optimizes memory usage and reduces fragmentation
  • Offers advanced features like defragmentation and custom memory pools

Cons of VulkanMemoryAllocator

  • Focuses solely on memory allocation, lacking broader Vulkan guidance
  • May have a steeper learning curve for beginners
  • Requires integration into existing Vulkan projects

Code Comparison

VulkanMemoryAllocator:

VmaAllocator allocator;
VmaAllocatorCreateInfo allocatorInfo = {};
vmaCreateAllocator(&allocatorInfo, &allocator);

VkBufferCreateInfo bufferInfo = { /* ... */ };
VmaAllocationCreateInfo allocInfo = {};
VkBuffer buffer;
VmaAllocation allocation;
vmaCreateBuffer(allocator, &bufferInfo, &allocInfo, &buffer, &allocation, nullptr);

Vulkan-Guide (typical Vulkan code without VMA):

VkDevice device = /* ... */;
VkBufferCreateInfo bufferInfo = { /* ... */ };
VkBuffer buffer;
vkCreateBuffer(device, &bufferInfo, nullptr, &buffer);

VkMemoryRequirements memRequirements;
vkGetBufferMemoryRequirements(device, buffer, &memRequirements);
// Allocate and bind memory manually

VulkanMemoryAllocator simplifies memory management, while Vulkan-Guide provides broader Vulkan concepts and best practices.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

// Copyright 2019-2024 The Khronos Group, Inc. // SPDX-License-Identifier: CC-BY-4.0

= Vulkan^®^ Guide :regtitle: pass:q,r[^®^] The Khronos{regtitle} Vulkan Working Group :data-uri: :icons: font :max-width: 100% :numbered: :source-highlighter: rouge :rouge-style: github

image::images/vulkan_logo.png[Vulkan Logo] image::images/khronos_logo.png[Khronos logo]

:lang-jp: lang/jp/ :lang-kor: lang/kor/ This document is also available in the following languages: + xref:{lang-jp}README-jp.adoc[Japanese] xref:{lang-kor}README-kor.adoc[Korean]

// Use {chapters} as base path for individual chapters, to allow single // pages to work properly as well. Must have trailing slash. // Implicit {relfileprefix} does not work due to file hierarchy :chapters: chapters/

The Vulkan Guide is designed to help developers get up and going with the world of Vulkan. It is aimed to be a light read that leads to many other useful links depending on what a developer is looking for. All information is intended to help better fill the gaps about the many nuances of Vulkan.

[NOTE]

The Vulkan Guide can be built as a single page using asciidoctor guide.adoc

:leveloffset: 1

= Logistics Overview

== xref:{chapters}what_is_vulkan.adoc[What is Vulkan?]

// include::{chapters}what_is_vulkan.adoc[]

== xref:{chapters}what_vulkan_can_do.adoc[What you can do with Vulkan]

// include::{chapters}what_vulkan_can_do.adoc[]

== xref:{chapters}vulkan_spec.adoc[Vulkan Spec]

// include::{chapters}vulkan_spec.adoc[]

== xref:{chapters}platforms.adoc[Platforms]

// include::{chapters}platforms.adoc[]

== xref:{chapters}checking_for_support.adoc[Checking for Support]

// include::{chapters}checking_for_support.adoc[]

== xref:{chapters}versions.adoc[Versions]

// include::{chapters}versions.adoc[]

== xref:{chapters}vulkan_release_summary.adoc[Vulkan Release Summary]

// include::{chapters}vulkan_release_summary.adoc[]

== xref:{chapters}what_is_spirv.adoc[What is SPIR-V?]

// include::{chapters}what_is_spirv.adoc[]

== xref:{chapters}portability_initiative.adoc[Portability Initiative]

// include::{chapters}portability_initiative.adoc[]

== xref:{chapters}vulkan_cts.adoc[Vulkan CTS]

// include::{chapters}vulkan_cts.adoc[]

== xref:{chapters}development_tools.adoc[Vulkan Development Tools]

// include::{chapters}development_tools.adoc[]

== xref:{chapters}validation_overview.adoc[Vulkan Validation Overview]

// include::{chapters}validation_overview.adoc[]

== xref:{chapters}decoder_ring.adoc[Vulkan Decoder Ring (GL, GLES, DirectX, and Metal)]

// include::{chapters}decoder_ring.adoc[]

= Using Vulkan

== xref:{chapters}loader.adoc[Loader]

// include::{chapters}loader.adoc[]

== xref:{chapters}layers.adoc[Layers]

// include::{chapters}layers.adoc[]

== xref:{chapters}querying_extensions_features.adoc[Querying Properties, Extensions, Features, Limits, and Formats]

// include::{chapters}querying_extensions_features.adoc[]

=== xref:{chapters}enabling_extensions.adoc[Enabling Vulkan Extensions]

// include::{chapters}enabling_extensions.adoc[]

=== xref:{chapters}enabling_features.adoc[Enabling Vulkan Features]

// include::{chapters}enabling_features.adoc[]

=== xref:{chapters}spirv_extensions.adoc[Using SPIR-V Extension]

// include::{chapters}spirv_extensions.adoc[]

=== xref:{chapters}formats.adoc[Formats]

// include::{chapters}formats.adoc[]

== xref:{chapters}queues.adoc[Queues and Queue Family]

// include::{chapters}queues.adoc[]

== xref:{chapters}wsi.adoc[WSI]

// include::{chapters}wsi.adoc[]

== xref:{chapters}pnext_and_stype.adoc[pNext and sType]

// include::{chapters}pnext_and_stype.adoc[]

== xref:{chapters}synchronization.adoc[Synchronization]

// include::{chapters}synchronization.adoc[]

=== xref:{chapters}extensions/VK_KHR_synchronization2.adoc[Porting to VK_KHR_synchronization2]

// include::{chapters}extensions/VK_KHR_synchronization2.adoc[]

=== xref:{chapters}synchronization_examples.adoc[Synchronization Examples]

// include::{chapters}extensions/synchronization_examples.adoc[]

== xref:{chapters}memory_allocation.adoc[Memory Allocation Strategy]

// include::{chapters}memory_allocation.adoc[]

=== xref:{chapters}sparse_resources.adoc[Sparse Resources]

// include::{chapters}sparse_resources.adoc[]

=== xref:{chapters}protected.adoc[Protected Memory]

// include::{chapters}protected.adoc[]

== xref:{chapters}pipeline_cache.adoc[Pipeline Caching/Derivatives]

// include::{chapters}pipeline_cache.adoc[]

== xref:{chapters}threading.adoc[Threading]

// include::{chapters}threading.adoc[]

== xref:{chapters}depth.adoc[Depth]

// include::{chapters}depth.adoc[]

  • VK_EXT_depth_range_unrestricted, VK_EXT_depth_clip_enable, VK_EXT_depth_clip_control

== xref:{chapters}mapping_data_to_shaders.adoc[Mapping Data to Shaders]

// include::{chapters}mapping_data_to_shaders.adoc[]

=== xref:{chapters}vertex_input_data_processing.adoc[Vertex Input Data Processing]

// include::{chapters}vertex_input_data_processing.adoc[]

=== xref:{chapters}descriptor_dynamic_offset.adoc[Descriptor Dynamic Offset]

// include::{chapters}descriptor_dynamic_offset.adoc[]

=== xref:{chapters}push_constants.adoc[Push Constants]

// include::{chapters}push_constants.adoc[]

== xref:{chapters}robustness.adoc[Robustness]

// include::{chapters}robustness.adoc[]

  • VK_EXT_image_robustness, VK_EXT_robustness2, VK_EXT_pipeline_robustness

== xref:{chapters}dynamic_state.adoc[Dynamic State]

// include::{chapters}dynamic_state.adoc[]

  • VK_EXT_extended_dynamic_state, VK_EXT_extended_dynamic_state2, VK_EXT_extended_dynamic_state3, VK_EXT_vertex_input_dynamic_state, VK_EXT_color_write_enable, VK_EXT_attachment_feedback_loop_dynamic_state

=== xref:{chapters}dynamic_state_map.adoc[Dynamic State Map]

// include::{chapters}dynamic_state_map.adoc[]

== xref:{chapters}subgroups.adoc[Subgroups]

// include::{chapters}subgroups.adoc[]

  • VK_EXT_subgroup_size_control, VK_KHR_shader_subgroup_extended_types, VK_EXT_shader_subgroup_ballot, VK_EXT_shader_subgroup_vote

== xref:{chapters}shader_memory_layout.adoc[Shader Memory Layout]

// include::{chapters}shader_memory_layout.adoc[]

  • VK_KHR_uniform_buffer_standard_layout, VK_KHR_relaxed_block_layout, VK_EXT_scalar_block_layout

== xref:{chapters}atomics.adoc[Atomics]

// include::{chapters}atomics.adoc[]

  • VK_KHR_shader_atomic_int64, VK_EXT_shader_image_atomic_int64, VK_EXT_shader_atomic_float, VK_EXT_shader_atomic_float2

== xref:{chapters}common_pitfalls.adoc[Common Pitfalls]

// include::{chapters}common_pitfalls.adoc[]

== xref:{chapters}hlsl.adoc[Using HLSL shaders]

// include::{chapters}hlsl.adoc[]

== xref:{chapters}high_level_shader_language_comparison.adoc[High Level Shader Language Comparison]

// include::{chapters}high_level_shader_language_comparison.adoc[]

= When and Why to use Extensions

[NOTE]

These are supplemental references for the various Vulkan Extensions. Please consult the Vulkan Spec for further details on any extension

== xref:{chapters}extensions/cleanup.adoc[Cleanup Extensions]

  • VK_EXT_4444_formats, VK_KHR_bind_memory2, VK_KHR_create_renderpass2, VK_KHR_dedicated_allocation, VK_KHR_driver_properties, VK_KHR_get_memory_requirements2, VK_KHR_get_physical_device_properties2, VK_EXT_host_query_reset, VK_KHR_maintenance1, VK_KHR_maintenance2, VK_KHR_maintenance3, VK_KHR_maintenance4, VK_KHR_maintenance5, VK_KHR_maintenance6, VK_KHR_separate_depth_stencil_layouts, VK_KHR_depth_stencil_resolve, VK_EXT_separate_stencil_usage, VK_EXT_sampler_filter_minmax, VK_KHR_sampler_mirror_clamp_to_edge, VK_EXT_ycbcr_2plane_444_formats, VK_KHR_format_feature_flags2, VK_EXT_rgba10x6_formats, VK_KHR_copy_commands2

// include::{chapters}extensions/cleanup.adoc[]

== xref:{chapters}extensions/device_groups.adoc[Device Groups]

  • VK_KHR_device_group, VK_KHR_device_group_creation

// include::{chapters}extensions/device_groups.adoc[]

== xref:{chapters}extensions/external.adoc[External Memory and Sychronization]

  • VK_KHR_external_fence, VK_KHR_external_memory, VK_KHR_external_semaphore

// include::{chapters}extensions/external.adoc[]

== xref:{chapters}extensions/ray_tracing.adoc[Ray Tracing]

  • VK_KHR_acceleration_structure, VK_KHR_ray_tracing_pipeline, VK_KHR_ray_query, VK_KHR_pipeline_library, VK_KHR_deferred_host_operations

// include::{chapters}extensions/ray_tracing.adoc[]

== xref:{chapters}extensions/shader_features.adoc[Shader Features]

  • VK_KHR_8bit_storage, VK_KHR_16bit_storage, VK_KHR_shader_clock, VK_EXT_shader_demote_to_helper_invocation, VK_KHR_shader_draw_parameters, VK_KHR_shader_float16_int8, VK_KHR_shader_float_controls, VK_KHR_shader_non_semantic_info, VK_EXT_shader_stencil_export, VK_KHR_shader_terminate_invocation, VK_EXT_shader_viewport_index_layer, VK_KHR_spirv_1_4, VK_KHR_storage_buffer_storage_class, VK_KHR_variable_pointers, VK_KHR_vulkan_memory_model, VK_KHR_workgroup_memory_explicit_layout, VK_KHR_zero_initialize_workgroup_memory

// include::{chapters}extensions/shader_features.adoc[]

== xref:{chapters}extensions/translation_layer_extensions.adoc[Translation Layer Extensions]

  • VK_EXT_custom_border_color, VK_EXT_border_color_swizzle, VK_EXT_depth_clip_enable, VK_EXT_depth_clip_control, VK_EXT_provoking_vertex, VK_EXT_transform_feedback, VK_EXT_image_view_min_lod

// include::{chapters}extensions/translation_layer_extensions.adoc[]

== xref:{chapters}extensions/VK_EXT_descriptor_indexing.adoc[VK_EXT_descriptor_indexing]

// include::{chapters}extensions/VK_EXT_descriptor_indexing.adoc[]

== xref:{chapters}extensions/VK_EXT_inline_uniform_block.adoc[VK_EXT_inline_uniform_block]

// include::{chapters}extensions/VK_EXT_inline_uniform_block.adoc[]

== xref:{chapters}extensions/VK_EXT_memory_priority.adoc[VK_EXT_memory_priority]

// include::{chapters}extensions/VK_EXT_memory_priority.adoc[]

== xref:{chapters}extensions/VK_KHR_descriptor_update_template.adoc[VK_KHR_descriptor_update_template]

// include::{chapters}extensions/VK_KHR_descriptor_update_template.adoc[]

== xref:{chapters}extensions/VK_KHR_draw_indirect_count.adoc[VK_KHR_draw_indirect_count]

// include::{chapters}extensions/VK_KHR_draw_indirect_count.adoc[]

== xref:{chapters}extensions/VK_KHR_image_format_list.adoc[VK_KHR_image_format_list]

// include::{chapters}extensions/VK_KHR_image_format_list.adoc[]

== xref:{chapters}extensions/VK_KHR_imageless_framebuffer.adoc[VK_KHR_imageless_framebuffer]

// include::{chapters}extensions/VK_KHR_imageless_framebuffer.adoc[]

== xref:{chapters}extensions/VK_KHR_sampler_ycbcr_conversion.adoc[VK_KHR_sampler_ycbcr_conversion]

// include::{chapters}extensions/VK_KHR_sampler_ycbcr_conversion.adoc[]

== link:https://www.khronos.org/blog/vulkan-timeline-semaphores[VK_KHR_timeline_semaphore]

== link:https://www.khronos.org/blog/streamlining-render-passes[VK_KHR_dynamic_rendering]

== xref:{chapters}extensions/VK_KHR_shader_subgroup_uniform_control_flow.adoc[VK_KHR_shader_subgroup_uniform_control_flow]

// include::{chapters}extensions/VK_KHR_shader_subgroup_uniform_control_flow.adoc[]

= link:CONTRIBUTING.adoc[Contributing]

= link:LICENSE[License]

= link:CODE_OF_CONDUCT.adoc[Code of conduct]