19 releases
| 0.1.18 | Dec 25, 2025 |
|---|---|
| 0.1.17 | May 1, 2023 |
| 0.1.16 | Apr 30, 2023 |
#306 in Game dev
Used in 2 crates
1MB
17K
SLoC
vulk
vulk is a highly experimental Vulkan bindings library, except it only includes the latest features and extensions, such as ray tracing, mesh shaders, descriptor buffers, shader objects, etc. vulk will not maintain backward compatibility when a new Vulkan extension completely replaces a feature. For example, in vulk, you can't use vertex shaders because mesh shaders are a superset of all geometry stages.
The design of vulk is inspired by ash, which is also what you should use for production use cases instead of vulk.
Currently, the only supported driver is the latest NVIDIA April 27th, 2023 driver.
lib.rs:
vulk
Commands
Initialization
vk::GetInstanceProcAddrReturn a function pointer for a commandvk::GetDeviceProcAddrReturn a function pointer for a commandvk::CreateInstanceCreate a new Vulkan instancevk::DestroyInstanceDestroy an instance of Vulkan
Devices and Queues
vk::EnumeratePhysicalDevicesEnumerates the physical devices accessible to a Vulkan instancevk::GetPhysicalDeviceProperties2Returns properties of a physical devicevk::GetPhysicalDeviceQueueFamilyProperties2Reports properties of the queues of the specified physical devicevk::CreateDeviceCreate a new device instancevk::DestroyDeviceDestroy a logical devicevk::GetDeviceQueue2Get a queue handle from a device
Command Buffers
vk::CreateCommandPoolCreate a new command pool objectvk::ResetCommandPoolReset a command poolvk::DestroyCommandPoolDestroy a command pool objectvk::AllocateCommandBuffersAllocate command buffers from an existing command poolvk::ResetCommandBufferReset a command buffer to the initial statevk::FreeCommandBuffersFree command buffersvk::BeginCommandBufferStart recording a command buffervk::EndCommandBufferFinish recording a command buffervk::QueueSubmit2Submits command buffers to a queue
Synchronization and Cache Control
vk::CreateSemaphoreCreate a new queue semaphore objectvk::DestroySemaphoreDestroy a semaphore objectvk::GetSemaphoreCounterValueQuery the current state of a timeline semaphorevk::WaitSemaphoresWait for timeline semaphores on the hostvk::SignalSemaphoreSignal a timeline semaphore on the hostvk::CmdPipelineBarrier2Insert a memory dependencyvk::QueueWaitIdleWait for a queue to become idlevk::DeviceWaitIdleWait for a device to become idlevk::GetCalibratedTimestampsEXTQuery calibrated timestamps
Render Pass
vk::CmdBeginRenderingBegin a dynamic render pass instancevk::CmdEndRenderingEnd a dynamic render pass instance
Shaders
vk::CreateShadersEXTCreate one or more new shadersvk::CmdBindShadersEXTBind shader objects to a command buffervk::DestroyShaderEXTDestroy a shader objectvk::CreateShaderModuleCreates a new shader module objectvk::DestroyShaderModuleDestroy a shader module
Pipelines
vk::CreateRayTracingPipelinesKHRCreates a new ray tracing pipeline objectvk::GetRayTracingShaderGroupHandlesKHRQuery ray tracing pipeline shader group handlesvk::DestroyPipelineDestroy a pipeline objectvk::CmdBindPipelineBind a pipeline object to a command buffer
Memory Allocation
vk::GetPhysicalDeviceMemoryProperties2Reports memory information for the specified physical devicevk::AllocateMemoryAllocate device memoryvk::FreeMemoryFree device memoryvk::MapMemory2KHRMap a memory object into application address spacevk::UnmapMemory2KHRUnmap a previously mapped memory object
Resource Creation
vk::CreateBufferCreate a new buffer objectvk::DestroyBufferDestroy a buffer objectvk::CreateImageCreate a new image objectvk::DestroyImageDestroy an image objectvk::CreateImageViewCreate an image view from an existing imagevk::DestroyImageViewDestroy an image view objectvk::CreateAccelerationStructureKHRCreate a new acceleration structure objectvk::GetAccelerationStructureBuildSizesKHRRetrieve the required size for an acceleration structurevk::DestroyAccelerationStructureKHRDestroy an acceleration structure objectvk::GetAccelerationStructureDeviceAddressKHRQuery an address of a acceleration structurevk::GetDeviceBufferMemoryRequirementsReturns the memory requirements for specified Vulkan objectvk::GetDeviceImageMemoryRequirementsReturns the memory requirements for specified Vulkan objectvk::BindBufferMemory2Bind device memory to buffer objectsvk::BindImageMemory2Bind device memory to image objects
Samplers
vk::CreateSamplerCreate a new sampler objectvk::DestroySamplerDestroy a sampler object
Resource Descriptors
vk::CreateDescriptorSetLayoutCreate a new descriptor set layoutvk::DestroyDescriptorSetLayoutDestroy a descriptor set layout objectvk::CreatePipelineLayoutCreates a new pipeline layout objectvk::DestroyPipelineLayoutDestroy a pipeline layout objectvk::CmdPushConstantsUpdate the values of push constantsvk::GetBufferDeviceAddressQuery an address of a buffervk::GetDescriptorSetLayoutSizeEXTGet the size of a descriptor set layout in memoryvk::GetDescriptorSetLayoutBindingOffsetEXTGet the offset of a binding within a descriptor set layoutvk::GetDescriptorEXTTo get a descriptor to place in a buffervk::CmdBindDescriptorBuffersEXTBinding descriptor buffers to a command buffervk::CmdSetDescriptorBufferOffsetsEXTSetting descriptor buffer offsets in a command buffer
Queries
vk::CreateQueryPoolCreate a new query pool objectvk::DestroyQueryPoolDestroy a query pool objectvk::ResetQueryPoolReset queries in a query poolvk::CmdBeginQueryBegin a queryvk::CmdEndQueryEnds a queryvk::GetQueryPoolResultsCopy results of queries in a query pool to a host memory regionvk::CmdWriteTimestamp2Write a device timestamp into a query object
Copy Commands
vk::CmdCopyBuffer2Copy data between buffer regionsvk::CmdCopyImage2Copy data between imagesvk::CmdCopyBufferToImage2Copy data from a buffer into an imagevk::CmdCopyImageToBuffer2Copy image data into a buffer
Drawing Commands
vk::CmdDrawMeshTasksEXTDraw mesh task work itemsvk::CmdDrawMeshTasksIndirectEXTIssue an indirect mesh tasks draw into a command buffervk::CmdDrawMeshTasksIndirectCountEXTPerform an indirect mesh tasks draw with the draw count sourced from a buffer
Fixed-Function Vertex Post-Processing
vk::CmdSetViewportWithCountSet the viewport count and viewports dynamically for a command buffervk::CmdSetScissorWithCountSet the scissor count and scissor rectangular bounds dynamically for a command buffer
Rasterization
vk::CmdSetRasterizationSamplesEXTSpecify the rasterization samples dynamically for a command buffervk::CmdSetFrontFaceSet front face orientation dynamically for a command buffervk::CmdSetCullModeSet cull mode dynamically for a command buffer
Fragment Operations
vk::CmdSetDepthTestEnableSet depth test enable dynamically for a command buffervk::CmdSetDepthCompareOpSet depth comparison operator dynamically for a command buffervk::CmdSetDepthWriteEnableSet depth write enable dynamically for a command buffer
The Framebuffer
vk::CmdSetColorBlendEnableEXTSpecify the pname:blendEnable for each attachment dynamically for a command buffervk::CmdSetColorBlendEquationEXTSpecify the blend factors and operations dynamically for a command buffervk::CmdSetColorWriteMaskEXTSpecify the color write masks for each attachment dynamically for a command buffer
Dispatching Commands
vk::CmdDispatchDispatch compute work itemsvk::CmdDispatchIndirectDispatch compute work items with indirect parameters
Window System Integration (WSI)
vk::CreateWin32SurfaceKHRCreate a VkSurfaceKHR object for an Win32 native windowvk::DestroySurfaceKHRDestroy a VkSurfaceKHR objectvk::GetPhysicalDeviceSurfaceSupportKHRQuery if presentation is supportedvk::GetPhysicalDeviceSurfaceCapabilitiesKHRQuery surface capabilitiesvk::GetPhysicalDeviceSurfaceFormatsKHRQuery color formats supported by surfacevk::GetPhysicalDeviceSurfacePresentModesKHRQuery supported presentation modesvk::CreateSwapchainKHRCreate a swapchainvk::DestroySwapchainKHRDestroy a swapchain objectvk::GetSwapchainImagesKHRObtain the array of presentable images associated with a swapchainvk::AcquireNextImage2KHRRetrieve the index of the next available presentable imagevk::QueuePresentKHRQueue an image for presentation
Acceleration Structures
vk::CmdBuildAccelerationStructuresKHRBuild an acceleration structure
Ray Tracing
vk::CmdTraceRaysKHRInitialize a ray tracing dispatchvk::CmdTraceRaysIndirect2KHRInitialize an indirect ray tracing dispatch with indirect shader binding tables
Additional Capabilities
vk::GetPhysicalDeviceCalibrateableTimeDomainsEXTQuery calibrateable time domains
Debugging
vk::CreateDebugUtilsMessengerEXTCreate a debug messenger objectvk::DestroyDebugUtilsMessengerEXTDestroy a debug messenger object
Extensions
VK_KHR_surfaceVK_KHR_swapchainVK_KHR_win32_surfaceVK_EXT_debug_utilsVK_KHR_acceleration_structureVK_KHR_ray_tracing_pipelineVK_KHR_ray_queryVK_EXT_calibrated_timestampsVK_EXT_validation_featuresVK_KHR_deferred_host_operationsVK_KHR_map_memory2VK_KHR_pipeline_libraryVK_KHR_synchronization2VK_EXT_descriptor_bufferVK_EXT_mesh_shaderVK_KHR_ray_tracing_maintenance1VK_EXT_shader_object
Dependencies
~245–630KB
~13K SLoC