Preface
This is the reference manual of MoonVulkan, which is a Lua binding library for the Khronos Vulkan API. [1]
It is assumed that the reader is familiar with both Vulkan and the Lua programming language.
For convenience of reference, this document contains external (deep) links to the Lua Reference Manual, the Vulkan API Reference Pages, and the Vulkan Specification.
Getting and installing
For installation intructions, refer to the README file in the MoonVulkan official repository on GitHub.
Module organization
The MoonVulkan module is loaded using Lua’s require() and returns a table containing the functions it provides (as usual with Lua modules). This manual assumes that such table is named vk, i.e. that it is loaded with:
vk = require("moonvulkan")
but nothing forbids the use of a different name.
Examples
Complete examples can be found in the examples/ directory of the release package.
License
MoonVulkan is released under the MIT/X11 license (same as Lua, and with the same only requirement to give proper credits to the original author). The copyright notice is in the LICENSE file in the base directory of the official repository on GitHub.
See also
MoonVulkan is part of MoonLibs, a collection of Lua libraries for graphics and audio programming.
Introduction
MoonVulkan is an (almost) one-to-one Lua binding library to the Vulkan API. It provides means to implement scripted Vulkan applications using Lua instead of C or C++, with all its pros and cons. You can think of it as a 'working pseudocode', less efficient but easier to write and read and to work with.
This section gives a brief overview, while the details of the bindings are given in the sections that follow.
As a general rule, Vulkan API functions are bound to by MoonVulkan functions whose names are snake_case versions of the original ones (for example, vkCreateInstance( ) is bound to by vk.create_instance( )).
If not stated otherwise, on error all MoonVulkan functions raise a Lua error. If needed, this behaviour can be overridden by wrapping function calls in the standard Lua pcall( ).
MoonVulkan avoids performing validations that can be delegated to Vulkan validation layers, and limits its error checks to the minimum needed to protect itself from script errors.
MoonVulkan binds Vulkan objects (instance, device, etc.) to Lua userdata, which are returned by the creating or allocating functions (vk.create_instance( ), vk.create_device( ), etc) and are then used to refer to objects in Lua in the same way as one would use Vulkan handles in C.
In the rest of this manual we will refer to userdata bound to Vulkan objects as to just 'objects', or as 'MoonVulkan objects' (vs. 'Vulkan objects') when there is need for disambiguation.
Occasionally, the actual Vulkan handles may be needed by the Lua code, mainly to interoperate in very dangerous ways with other libraries that access the Vulkan API directly. Handles can be retrieved with the raw( ) method that every object has.
Objects are garbage collected at exit (which includes on error) with automatic destruction/free at the Vulkan level, so there is no need to explicitly invoke the bindings to vkDestroy/FreeXxx( ) at exit for cleanup.
Apart from at exit, however, objects are not automatically garbage collected [2] and one should destroy/free them explicitly when needed, e.g. to release resources when the application is not exiting and some objects are no longer needed.
Destroying/freeing an object causes the automatic (pre) destruction of all its children objects, and the invalidation of any reference to the object and to its children. [3]
Vulkan structs (and lists, and arrays) that are used to pass parameters and results across the Vulkan API are mapped in MoonVulkan to tables, having more or less the same contents as their C counterparts but, again, with snake_case named fields. Enumerations are mapped to/from sets of string literals, while flags bitmasks are represented as plain integers encoded in the same way as in C. More details are given in the respective sections of this document (structs, enums, flags).
In addition to the bindings to the Vulkan API, which are described in the sections that follow, MoonVulkan also provides a few other utilities and object 'methods' that do not correspond to Vulkan functions. These are described mainly in the 'Miscellanea' subsections.
MoonVulkan does not support multithreading, at least for now. Support for multi-threaded applications is under study and may be added in the future (although one could argue that if performance is paramount for the application, maybe using a binding library to a dynamic, garbage-collected language is not the way to go).
Objects
The following tree shows the MoonVulkan (Vulkan) objects and their parent-child relationships.
instance (VkInstance)
├─ physical_device (VkPhysicalDevice)
│ └─ display (VkDisplayKHR)
│ └─ display_mode (VkDisplayModeKHR)
├─ device (VkDevice)
│ ├─ queue (VkQueue)
│ ├─ command_pool (VkCommandPool)
│ │ └─ command_buffer (VkCommandBuffer)
│ ├─ fence (VkFence)
│ ├─ semaphore (VkSemaphore)
│ ├─ event (VkEvent)
│ ├─ render_pass (VkRenderPass)
│ ├─ framebuffer (VkFramebuffer)
│ ├─ shader_module (VkShaderModule )
│ ├─ pipeline (VkPipeline)
│ ├─ pipeline_cache (VkPipelineCache)
│ ├─ device_memory (VkDeviceMemory)
│ ├─ buffer (VkBuffer)
│ │ └─ buffer_view (VkBufferView)
│ ├─ image (VkImage)
│ │ └─ image_view (VkImageView)
│ ├─ sampler (VkSampler)
│ ├─ descriptor_set_layout (VkDescriptorSetLayout)
│ ├─ pipeline_layout (VkPipelineLayout)
│ ├─ descriptor_pool (VkDescriptorPool)
│ │ └─ descriptor_set (VkDescriptorSet)
│ ├─ descriptor_update_template (VkDescriptorUpdateTemplateKHR)
│ ├─ validation_cache (VkValidationCacheEXT)
│ ├─ sampler_ycbcr_conversion (VkSamplerYcbcrConversionKHR)
│ ├─ query_pool (VkQueryPool)
│ └─ swapchain (VkSwapchainKHR)
│ └─ image (VkImage, present)
├─ surface (VkSurfaceKHR)
├─ debug_report_callback (VkDebugReportCallbackEXT)
└─ debug_utils_messenger (VkDebugUtilsMessengerEXT)
(Notice that the image object is listed two times because it may be either created by the application or acquired from a swapchain).
Core functions
This section lists the MoonVulkan bindings to the core Vulkan API functions.
Only the synopses are given. The functionalities, usages, and meanings of parameters and return values are basically the same as for the underlying Vulkan API.
The structure of this section purposedly reflects the structure of the Vulkan Specification, from chapter 3 onward.
Initialization
Rfr: Initialization.
instance
-
instance = create_instance(instancecreateinfo, [allocator])
Rfr: vkCreateInstance.
-
destroy_instance(instance)
Rfr: vkDestroyInstance.
Devices and Queues
Rfr: Devices and Queues.
physical_device
In this document, physdev is an abbreviation for physical_device when referring to a variable or a return value.
-
{physdev} = enumerate_physical_devices(instance)
Rfr: vkEnumeratePhysicalDevices.
-
{physicaldevicegroupproperties} = enumerate_physical_device_groups(instance)
Rfr: vkEnumeratePhysicalDeviceGroups.
-
physicaldeviceproperties = get_physical_device_properties(physdev)
Rfr: vkGetPhysicalDeviceProperties, vkGetPhysicalDeviceProperties2.
-
physicaldevicefeatures = get_physical_device_features(physdev)
Rfr: vkGetPhysicalDeviceFeatures, vkGetPhysicalDeviceFeatures2.
-
{queuefamilyproperties} = get_physical_device_queue_family_properties(physdev)
Rfr: vkGetPhysicalDeviceQueueFamilyProperties, vkGetPhysicalDeviceQueueFamilyProperties2.
-
physicaldevicememoryproperties = get_physical_device_memory_properties(physdev)
Rfr: vkGetPhysicalDeviceMemoryProperties, vkGetPhysicalDeviceMemoryProperties2.
-
formatproperties = get_physical_device_format_properties(physdev, format)
Rfr: vkGetPhysicalDeviceFormatProperties, vkGetPhysicalDeviceFormatProperties2.
-
imageformatproperties = get_physical_device_image_format_properties(physdev, info)
info: physicaldeviceimageformatinfo.
Rfr: vkGetPhysicalDeviceImageFormatProperties, vkGetPhysicalDeviceImageFormatProperties2.
-
sparseimageformatproperties = get_physical_device_sparse_image_format_properties(physdev, info)
info: physicaldevicesparseimageformatinfo.
Rfr: vkGetPhysicalDeviceSparseImageFormatProperties, vkGetPhysicalDeviceSparseImageFormatProperties2.
-
externalbufferproperties = get_physical_device_external_buffer_properties(physdev, info)
info: physicaldeviceexternalbufferinfo.
Rfr: vkGetPhysicalDeviceExternalBufferProperties.
-
externalfenceproperties = get_physical_device_external_fence_properties(physdev, info)
info: physicaldeviceexternalfenceinfo.
Rfr: vkGetPhysicalDeviceExternalFenceProperties.
-
externalsemaphoreproperties = get_physical_device_external_semaphore_properties(physdev, info)
info: physicaldeviceexternalsemaphoreinfo.
Rfr: vkGetPhysicalDeviceExternalSemaphoreProperties.
-
multisampleproperties = get_physical_device_multisample_properties(physdev, samplecountflags)
Rfr: vkGetPhysicalDeviceMultisamplePropertiesEXT.
-
{timedomain} = get_physical_device_calibrateable_time_domains(physdev)
Rfr: vkGetPhysicalDeviceCalibrateableTimeDomainsEXT.
-
{physicaldevicefragmentshadingrate} = get_physical_device_fragment_shading_rates(physdev)
Rfr: vkGetPhysicalDeviceFragmentShadingRatesKHR.
-
{physicaldevicetoolproperties} = get_physical_device_tool_properties(physdev)
Rfr: vkGetPhysicalDeviceToolPropertiesEXT.
-
{performancecounter}, {performancecounterdescription} = enumerate_physical_device_queue_family_performance_query_counters(physdev, queue_family_index)
Rfr: vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR.
-
num_passes = get_physical_device_queue_family_performance_query_passes(physdev, querypoolperformancecreateinfo)
Rfr: vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR.
device
-
device = create_device(physdev, devicecreateinfo, [allocator])
Rfr: vkCreateDevice.
-
destroy_device(device)
Rfr: vkDestroyDevice.
-
device_wait_idle(device)
Rfr: vkDeviceWaitIdle.
-
acquire_profiling_lock(device, acquireprofilinglockinfo)
release_profiling_lock(device)
Rfr: vkAcquireProfilingLockKHR, vkReleaseProfilingLockKHR.
queue
-
queue = get_device_queue(device, queue_family_index, queue_index, [devicequeuecreateflags])
queue = get_device_queue(device, devicequeueinfo)
Rfr: vkGetDeviceQueue, vkGetDeviceQueue2.
-
queue_submit(queue, {submitinfo}, [fence])
queue_submit2(queue, {submitinfo2}, [fence])
Rfr: vkQueueSubmit, vkQueueSubmit2KHR.
-
queue_bind_sparse(queue, {bindsparseinfo}, [fence])
Rfr: vkQueueBindSparse.
-
queue_wait_idle(queue)
Rfr: vkQueueWaitIdle.
Command Buffers
Rfr: Command Buffers.
command_pool
-
command_pool = create_command_pool(device, commandpoolcreateinfo, [allocator])
command_pool = create_command_pool(device, commandpoolcreateflags, queue_family_index)
Rfr: vkCreateCommandPool.
-
destroy_command_pool(command_pool)
Rfr: vkDestroyCommandPool.
-
reset_command_pool(command_pool, [commandpoolresetflags])
Rfr: vkResetCommandPool.
-
trim_command_pool(command_pool, [commandpooltrimflags])
Rfr: vkTrimCommandPool.
command_buffer
In this document, cb is an abbreviation for command_buffer when referring to a variable or a return value.
-
{cb} = allocate_command_buffers(command_pool, commandbufferallocateinfo)
{cb} = allocate_command_buffers(command_pool, level, count)
Rfr: vkAllocateCommandBuffers.
-
free_command_buffers({cb})
Rfr: vkFreeCommandBuffers.
-
begin_command_buffer(cb, commandbufferbegininfo)
begin_command_buffer(cb, [commandbufferusageflags])
Rfr: vkBeginCommandBuffer.
-
end_command_buffer(cb)
Rfr: vkEndCommandBuffer.
-
reset_command_buffer(cb, [commandbufferresetflags])
Rfr: vkResetCommandBuffer.
Synchronization
fence
-
fence = create_fence(device, fencecreateinfo, [allocator])
fence = create_fence(device, [fencecreateflags])
Rfr: vkCreateFence.
-
fence = register_device_event(device, deviceeventinfo, [allocator])
Rfr: vkRegisterDeviceEventEXT.
-
fence = register_display_event(device, display, displayeventinfo, [allocator])
Rfr: vkRegisterDisplayEventEXT.
-
destroy_fence(fence)
Rfr: vkDestroyFence.
-
reset_fences({fence})
Rfr: vkResetFences.
-
boolean = get_fence_status(fence)
Returns true if the given fence is ready, false otherwise.
Rfr: vkGetFenceStatus.
-
boolean = wait_for_fences({fence}, waitall, [timeout])
waitall: boolean
Returns true on success, false on timeout.
Rfr: vkWaitForFences.
-
import_fence_fd(fence, importfencefdinfo)
Rfr: vkImportFenceFdKHR.
-
fd = get_fence_fd(fence, fencegetfdinfo)
Rfr: vkGetFenceFdKHR.
semaphore
-
semaphore = create_semaphore(device, semaphorecreateinfo, [allocator])
semaphore = create_semaphore(device, [semaphorecreateflags])
Rfr: vkCreateSemaphore.
-
destroy_semaphore(semaphore)
Rfr: vkDestroySemaphore.
-
value = get_semaphore_counter_value(semaphore)
Rfr: vkGetSemaphoreCounterValue.
-
wait_semaphores(device, semaphorewaitinfo, timeout)
Rfr: vkWaitSemaphores.
-
signal_semaphore(device, semaphoresignalinfo)
Rfr: vkSignalSemaphore.
-
import_semaphore_fd(semaphore, importsemaphorefdinfo)
Rfr: vkImportSemaphoreFdKHR.
-
fd = get_semaphore_fd(semaphore, semaphoregetfdinfo)
Rfr: vkGetSemaphoreFdKHR.
event
-
event = create_event(device, eventcreateinfo, [allocator])
event = create_event(device, [eventcreateflags])
Rfr: vkCreateEvent.
-
destroy_event(event)
Rfr: vkDestroyEvent.
-
boolean = get_event_status(event)
Returns true if the given event is set, false otherwise.
Rfr: vkGetEventStatus.
-
set_event(event)
Rfr: vkSetEvent.
-
reset_event(event)
Rfr: vkResetEvent.
Render Pass
Rfr: Render Pass.
render_pass
-
render_pass = create_render_pass(device, renderpasscreateinfo, [allocator])
render_pass = create_render_pass(device, renderpasscreateinfo2, [allocator])
Rfr: vkCreateRenderPass, vkCreateRenderPass2.
-
destroy_render_pass(render_pass)
Rfr: vkDestroyRenderPass.
-
extent2d = get_render_area_granularity(render_pass)
Rfr: vkGetRenderAreaGranularity.
framebuffer
-
framebuffer = create_framebuffer(device, framebuffercreateinfo, [allocator])
Rfr: vkCreateFramebuffer.
-
destroy_framebuffer(framebuffer)
Rfr: vkDestroyFramebuffer.
Shaders
Rfr: Shaders.
shader_module
-
shader_module = create_shader_module(device, shadermodulecreateinfo, [allocator])
shader_module = create_shader_module(device, shadermodulecreateflags, code)
Rfr: vkCreateShaderModule.
-
destroy_shader_module(shader_module)
Rfr: vkDestroyShaderModule.
Pipelines
Rfr: Pipelines.
pipeline
-
{pipeline} = create_graphics_pipelines(device, [pipeline_cache], {graphicspipelinecreateinfo}, [allocator])
Rfr: vkCreateGraphicsPipelines.
-
{pipeline} = create_compute_pipelines(device, [pipeline_cache], {computepipelinecreateinfo}, [allocator])
Rfr: vkCreateComputePipelines.
-
destroy_pipeline(pipeline)
Rfr: vkDestroyPipeline.
-
{pipelineexecutableproperties} = get_pipeline_executable_properties(pipeline, [pipelineinfo])
Rfr: vkGetPipelineExecutablePropertiesKHR.
-
{pipelineexecutablestatistic} = get_pipeline_executable_statistics(pipeline, pipelineexecutableinfo)
Rfr: vkGetPipelineExecutableStatisticsKHR.
-
{pipelineexecutableinternalrepresentation} = get_pipeline_executable_internal_representations(pipeline, pipelineexecutableinfo)
Rfr: vkGetPipelineExecutableInternalRepresentationsKHR.
pipeline_cache
-
pipeline_cache = create_pipeline_cache(device, pipelinecachecreateinfo, [allocator])
pipeline_cache = create_pipeline_cache(device, [pipelinecachecreateflags], [initial_data])
Rfr: vkCreatePipelineCache.
-
destroy_pipeline_cache(pipeline_cache)
Rfr: vkDestroyPipelineCache.
-
data = get_pipeline_cache_data(pipeline_cache)
Returns data as a binary string.
Rfr: vkGetPipelineCacheData.
-
merge_pipeline_caches(destination, {source})
destination, source: pipeline_cache
Rfr: vkMergePipelineCaches.
Memory Allocation
Rfr: Memory Allocation.
device_memory
In this document, devmem is an abbreviation for device_memory when referring to a variable or a return value.
-
devmem = allocate_memory(device, memoryallocateinfo, [allocator])
devmem = allocate_memory(device, allocation_size, memory_type_index)
Rfr: vkAllocateMemory.
-
free_memory(devmem)
Rfr: vkFreeMemory.
-
ptr = map_memory(devmem, offset, size, [memorymapflags])
offset: integer
size: integer or 'whole size'
The returned ptr value is a lightuserdata containing the raw pointer to the mapped memory.
Rfr: vkMapMemory.
-
unmap_memory(devmem)
Rfr: vkUnmapMemory.
-
write_memory(devmem, offset, data)
offset: integer
data: binary string.
-
data = read_memory(devmem, offset, size)
offset: integer
size: integer or 'whole size'
Returns data as a binary string.
-
bytes = get_device_memory_commitment(devmem)
Rfr: vkGetDeviceMemoryCommitment.
-
set_device_memory_priority(devmem, priority)
Rfr: vkSetDeviceMemoryPriorityEXT.
-
flush_mapped_memory_ranges(device, {mappedmemoryrange})
Rfr: vkFlushMappedMemoryRanges.
-
invalidate_mapped_memory_ranges(device, {mappedmemoryrange})
Rfr: vkInvalidateMappedMemoryRanges.
-
peermemoryfeatureflags = get_device_group_peer_memory_features(device, heap_index, local_device_index, remote_device_index)
Rfr: vkGetDeviceGroupPeerMemoryFeatures.
-
memoryrequirements = get_buffer_memory_requirements(buffer, [buffermemoryrequirementsinfo])
Rfr: vkGetBufferMemoryRequirements - vkGetBufferMemoryRequirements2.
-
memoryrequirements = get_image_memory_requirements(image, [imagememoryrequirementsinfo])
Rfr: vkGetImageMemoryRequirements - vkGetImageMemoryRequirements2.
-
{sparseimagememoryrequirements} = get_image_sparse_memory_requirements(image, [imagesparsememoryrequirementsinfo])
Rfr: vkGetImageSparseMemoryRequirements - vkGetImageSparseMemoryRequirements2.
-
memoryrequirements = get_device_buffer_memory_requirements(device, devicebuffermemoryrequirements)
Rfr: vkGetDeviceBufferMemoryRequirementsKHR.
-
memoryrequirements = get_device_image_memory_requirements(device, deviceimagememoryrequirements)
Rfr: vkGetDeviceImageMemoryRequirementsKHR.
-
{sparseimagememoryrequirements} = get_device_image_sparse_memory_requirements(device, deviceimagememoryrequirements)
Rfr: vkGetDeviceImageSparseMemoryRequirementsKHR.
-
bind_buffer_memory(buffer, devmem, offset)
bind_buffer_memory(device, {bindbuffermemoryinfo})
Rfr: vkBindBufferMemory - vkBindBufferMemory2.
-
bind_image_memory(image, devmem, offset)
bind_image_memory(device, {bindimagememoryinfo})
Rfr: vkBindImageMemory - vkBindImageMemory2.
-
address = get_buffer_device_address(buffer)
Rfr: vkGetBufferDeviceAddress.
-
address = get_buffer_opaque_capture_address(buffer)
Rfr: vkGetBufferOpaqueCaptureAddress.
-
address = get_device_memory_opaque_capture_address(devmem)
Rfr: vkGetDeviceMemoryOpaqueCaptureAddress.
-
fd = get_memory_fd(devmem, memorygetfdinfo)
Rfr: vkGetMemoryFdKHR.
-
memoryfdproperties = get_memory_fd_properties(device, handle_type, fd)
handle_type: externalmemoryhandletypeflags,
fd: integer.
Rfr: vkGetMemoryFdPropertiesKHR.
-
memoryhostpointerproperties = get_memory_host_pointer_properties(device, handle_type, host_pointer)
handle_type: externalmemoryhandletypeflags,
host_pointer: lightuserdata.
Rfr: vkGetMemoryHostPointerPropertiesEXT.
Resource Creation
Rfr: Resource Creation.
buffer
-
buffer = create_buffer(device, buffercreateinfo, [allocator])
Rfr: vkCreateBuffer.
-
destroy_buffer(buffer)
Rfr: vkDestroyBuffer.
buffer_view
-
buffer_view = create_buffer_view(buffer, bufferviewcreateinfo, [allocator])
Rfr: vkCreateBufferView.
-
destroy_buffer_view(buffer_view)
Rfr: vkDestroyBufferView.
image
-
image = create_image(device, imagecreateinfo, [allocator])
Rfr: vkCreateImage.
-
destroy_image(image)
Rfr: vkDestroyImage.
-
subresourcelayout = get_image_subresource_layout(image, imagesubresource)
Rfr: vkGetImageSubresourceLayout.
image_view
-
image_view = create_image_view(image, imageviewcreateinfo, [allocator])
Rfr: vkCreateImageView.
-
destroy_image_view(image_view)
Rfr: vkDestroyImageView.
Samplers
Rfr: Samplers.
sampler
-
sampler = create_sampler(device, samplercreateinfo, [allocator])
Rfr: vkCreateSampler.
-
destroy_sampler(sampler)
Rfr: vkDestroySampler.
Resource Descriptors
Rfr: Resource Descriptors.
descriptor_set_layout
-
descriptor_set_layout = create_descriptor_set_layout(device, descriptorsetlayoutcreateinfo, [allocator])
descriptor_set_layout = create_descriptor_set_layout(device, [flags], [bindings])
Rfr: vkCreateDescriptorSetLayout.
-
destroy_descriptor_set_layout(descriptor_set_layout)
Rfr: vkDestroyDescriptorSetLayout.
-
descriptorsetlayoutsupport = get_descriptor_set_layout_support(device, descriptorsetlayoutcreateinfo)
Rfr: vkGetDescriptorSetLayoutSupport.
pipeline_layout
-
pipeline_layout = create_pipeline_layout(device, pipelinelayoutcreateinfo, [allocator])
pipeline_layout = create_pipeline_layout(device, [flags], [set_layouts], [push_constant_ranges])
Rfr: vkCreatePipelineLayout.
-
destroy_pipeline_layout(pipeline_layout)
Rfr: vkDestroyPipelineLayout.
descriptor_pool
-
descriptor_pool = create_descriptor_pool(device, descriptorpoolcreateinfo, [allocator])
descriptor_pool = create_descriptor_pool(device, flags, max_sets, pool_sizes)
Rfr: vkCreateDescriptorPool.
-
destroy_descriptor_pool(descriptor_pool)
Rfr: vkDestroyDescriptorPool.
-
reset_descriptor_pool(descriptor_pool, [flags])
[flags]: descriptorpoolresetflags
Rfr: vkResetDescriptorPool.
descriptor_set
-
{descriptor_set} = allocate_descriptor_sets(descriptor_pool, descriptorsetallocateinfo)
{descriptor_set} = allocate_descriptor_sets(descriptor_pool, {descriptor_set_layout})
Rfr: vkAllocateDescriptorSets.
-
free_descriptor_sets({descriptor_set})
Rfr: vkFreeDescriptorSets.
-
update_descriptor_sets(device, [{writedescriptorset}], [{copydescriptorset}])
Rfr: vkUpdateDescriptorSets.
Queries
Rfr: Queries.
query_pool
-
query_pool = create_query_pool(device, querypoolcreateinfo, [allocator])
Rfr: vkCreateQueryPool.
-
data = destroy_query_pool(query_pool, first_query, …)
arg2 - first_query: integer
arg3 - query_count: integer
arg4 - data_size: integer
arg5 - size: integer
arg6 - flags: queryresultflags
Returns data as a binary string.
Rfr: vkDestroyQueryPool.
-
get_query_pool_results(query_pool)
Rfr: vkGetQueryPoolResults.
-
reset_query_pool(query_pool, first_query, query_count)
Rfr: vkResetQueryPool.
Commands
The first argument (cb) of all the following functions is a command_buffer.
-
cmd_begin_conditional_rendering(cb, conditionalrenderingbegininfo)
cmd_end_conditional_rendering(cb)
Rfr: vkCmdBeginConditionalRenderingEXT, vkCmdEndConditionalRenderingEXT.
-
cmd_begin_debug_utils_label(cb, debugutilslabel)
cmd_end_debug_utils_label(cb)
cmd_insert_debug_utils_label(cb, debugutilslabel)
Rfr: vkCmdBeginDebugUtilsLabelEXT, vkCmdEndDebugUtilsLabelEXT, vkCmdInsertDebugUtilsLabelEXT.
-
cmd_begin_query(cb, query_pool, query, querycontrolflags)
cmd_end_query(cb, query_pool, query)
Rfr: vkCmdBeginQuery, vkCmdEndQuery.
-
cmd_begin_query_indexed(cb, query_pool, query, querycontrolflags, index)
cmd_end_query_indexed(cb, query_pool, query, index)
Rfr: vkCmdBeginQueryIndexedEXT, vkCmdEndQueryIndexedEXT.
-
cmd_begin_render_pass(cb, renderpassbegininfo, subpasscontents)
cmd_begin_render_pass(cb, renderpassbegininfo, subpassbegininfo) (2KHR)
cmd_next_subpass(cb, subpasscontents)
cmd_next_subpass(cb, subpassbegininfo, subpassendinfo) (2KHR)
cmd_end_render_pass(cb)
cmd_end_render_pass(cb, subpassendinfo) (2KHR)
Rfr: vkCmdBeginRenderPass, vkCmdBeginRenderPass2, vkCmdNextSubpass, vkCmdNextSubpass2, vkCmdEndRenderPass, vkCmdEndRenderPass2.
-
cmd_begin_rendering(cb, renderinginfo)
cmd_end_rendering(cb)
Rfr: vkCmdBeginRenderingKHR, vkCmdEndRenderingKHR.
-
cmd_begin_transform_feedback(cb, first, [buffers], [offsets])
cmd_end_transform_feedback(cb, first, [buffers], [offsets])
first: integer (0-based),
buffers: {buffer},
offsets: {integer},
Rfr: vkCmdBeginTransformFeedbackEXT, vkCmdEndTransformFeedbackEXT.
-
cmd_bind_descriptor_sets(cb, pipelinebindpoint, …)
arg3 - layout: pipeline_layout
arg4 - first_set: integer
arg5 - descriptor_sets: {descriptor_set}
arg6 - [dynamic_offsets]: {integer}
Rfr: vkCmdBindDescriptorSets.
-
cmd_bind_index_buffer(cb, buffer, offset, indextype)
Rfr: vkCmdBindIndexBuffer.
-
cmd_bind_pipeline(cb, pipelinebindpoint, pipeline)
Rfr: vkCmdBindPipeline.
-
cmd_bind_transform_feedback_buffers(cb, first_binding, buffers, [offsets], [sizes])
first_binding: integer (0-based),
buffers: {buffer},
offsets: {integer},
sizes: {devicesize},
Rfr: vkCmdBindTransformFeedbackBuffersEXT.
-
cmd_bind_vertex_buffers(cb, first_binding, {buffer}, {offsets})
cmd_bind_vertex_buffers(cb, first_binding, {buffer}, {offsets}, [{sizes}], [{strides}])
Rfr: vkCmdBindVertexBuffers, vkCmdBindVertexBuffers2EXT.
-
cmd_blit_image(cb, src_image, …)
cmd_blit_image(cb, blitimageinfo) (2KHR)
arg2 - src_image: image
arg3 - src_imagelayout: imagelayout
arg4 - dst_image: image
arg5 - dst_imagelayout: imagelayout
arg6 - regions : {imageblit}
arg7 - filter: filter
Rfr: vkCmdBlitImage, vkCmdBlitImage 2KHR.
-
cmd_clear_attachments(cb, attachments, rects)
attachments: {clearattachment}
rects: {clearrect}
Rfr: vkCmdClearAttachments.
-
cmd_clear_color_image(cb, image, imagelayout, color, ranges)
image: image
imagelayout: imagelayout
color: clearcolorvalue
ranges: {imagesubresourcerange}
Rfr: vkCmdClearColorImage.
-
cmd_clear_depth_stencil_image(cb, image, imagelayout, depth, stencil, ranges)
image: image
imagelayout: imagelayout
depth: float
stencil: integer
ranges: {imagesubresourcerange}
Rfr: vkCmdClearDepthStencilImage.
-
cmd_copy_buffer(cb, src_buffer, dst_buffer, regions)
cmd_copy_buffer(cb, copybufferinfo) (2KHR)
src_buffer: buffer
dst_buffer: buffer
regions: {buffercopy}
Rfr: vkCmdCopyBuffer, vkCmdCopyBuffer2KHR.
-
cmd_copy_buffer_to_image(cb, src_buffer, dst_image, dst_imagelayout, regions)
cmd_copy_buffer_to_image(cb, copybuffertoimageinfo) (2KHR)
src_buffer: buffer
dst_image: image
dst_imagelayout: imagelayout
regions: {bufferimagecopy}
Rfr: vkCmdCopyBufferToImage, vkCmdCopyBufferToImage 2KHR.
-
cmd_copy_image(cb, src_image, …)
cmd_copy_image(cb, copyimageinfo) (2KHR)
arg2 - src_image: image
arg3 - src_imagelayout: imagelayout
arg4 - dst_image: image
arg5 - dst_imagelayout: imagelayout
arg6 - regions : {imagecopy}
Rfr: vkCmdCopyImage, vkCmdCopyImage2KHR.
-
cmd_copy_image_to_buffer(cb, src_image, …)
cmd_copy_image_to_buffer(cb, copyimagetobufferinfo) (2KHR)
arg2 - src_image: image
arg3 - src_imagelayout: imagelayout
arg4 - dst_buffer: buffer
arg5 - regions: {bufferimagecopy}
Rfr: vkCmdCopyImageToBuffer, vkCmdCopyImageToBuffer2KHR.
-
cmd_copy_query_pool_results(cb, query_pool, …)
arg2 - query_pool: query_pool
arg3 - first_query: integer
arg4 - query_count: integer
arg5 - dst_buffer: buffer
arg6 - dst_offset: integer
arg7 - stride: integer
arg8 - flags: queryresultflags
Rfr: vkCmdCopyQueryPoolResults.
-
cmd_debug_marker_begin(cb, marker_name, [color])
cmd_debug_marker_end(cb)
cmd_debug_marker_insert(cb, marker_name, [color])
marker_name: string
color: {float}[4] (opt.)
Rfr: vkCmdDebugMarkerBeginEXT, vkCmdDebugMarkerEndEXT, vkCmdDebugMarkerInsertEXT.
-
cmd_dispatch(cb, x, y, z)
cmd_dispatch_indirect(cb, buffer, offset)
Rfr: vkCmdDispatch, vkCmdDispatchIndirect.
-
cmd_dispatch_base(cb, basegroup_x, basegroup_y, basegroup_z, groupcount_x, groupcount_y, groupcount_z)
Rfr: vkCmdDispatchBase.
-
cmd_draw(cb, vertex_count, instance_count, first_vertex, first_instance)
cmd_draw_indexed(cb, index_count, instance_count, first_index, vertex_offset, first_instance)
cmd_draw_indexed_indirect(cb, buffer, offset, draw_count, stride)
cmd_draw_indirect(cb, buffer, offset, draw_count, stride)
Rfr: vkCmdDraw, vkCmdDrawIndexed, vkCmdDrawIndexedIndirect, vkCmdDrawIndirect.
-
cmd_draw_indirect_byte_count(cb, instance_count, first_instance, counter_buffer, counter_buffer_offset, counter_offset, vertex_stride)
Rfr: vkCmdDrawIndirectByteCountEXT.
-
cmd_draw_indirect_count(cb, buffer, offset, count_buffer, count_buffer_offset, max_draw_count, stride)
cmd_draw_indexed_indirect_count(cb, buffer, offset, count_buffer, count_buffer_offset, max_draw_count, stride)
Rfr: vkCmdDrawIndirectCount, vkCmdDrawIndexedIndirectCount,.
-
cmd_draw_multi(cb, [{multidrawinfo}], instance_count, first_instance, stride)
cmd_draw_multi_indexed(cb, [{multidrawindexedinfo}], instance_count, first_instance, stride, [vertex_offset])
Rfr: vkCmdDrawMultiEXT, vkCmdDrawMultiIndexedEXT.
-
cmd_execute_commands(cb, {command_buffer})
Rfr: vkCmdExecuteCommands.
-
cmd_fill_buffer(cb, dst_buffer, dst_offset, size, data)
dst_buffer: buffer
dst_offset: integer
size: integer (multiple of 4) or 'whole size'
data: integer
Rfr: vkCmdFillBuffer.
-
cmd_pipeline_barrier(cb, src_stage_mask, …)
cmd_pipeline_barrier(cb, dependencyinfo)
arg2 - src_stage_mask: pipelinestageflags
arg3 - dst_stage_mask: pipelinestageflags
arg4 - dependency_flags: dependencyflags
arg5 - [memory_barriers]: {memorybarrier}
arg6 - [buffer_memory_barriers]: {buffermemorybarrier}
arg7 - [image_memory_barriers]: {imagememorybarrier}
Rfr: vkCmdPipelineBarrier, vkCmdPipelineBarrier2KHR.
-
cmd_push_descriptor_set(cb, bind_point, …)
arg2 - bind_point: pipelinebindpoint
arg3 - pipeline_layout: pipeline_layout
arg4 - set: integer
arg5 - writes: {writedescriptorset}
Rfr: vkCmdPushDescriptorSetKHR.
-
cmd_push_descriptor_set_with_template(cb, descriptor_update_template, layout, …)
arg3: layout: pipeline_layout
arg4: set: integer
arg5: data: binary string
Rfr: vkCmdPushDescriptorSetWithTemplateKHR.
-
cmd_push_constants(cb, layout, flags, offset, values)
layout: pipeline_layout
flags: shaderstageflags
offset: integer
values: binary string
Rfr: vkCmdPushConstants.
-
cmd_reset_event(cb, event, pipelinestageflags)
Rfr: vkCmdResetEvent, vkCmdResetEvent2KHR.
-
cmd_reset_query_pool(cb, query_pool, first_query, query_count)
Rfr: vkCmdResetQueryPool.
-
cmd_resolve_image(cb, src_image, …)
cmd_resolve_image(cb, resolveimageinfo) (2KHR)
arg2 - src_image: image
arg3 - src_imagelayout: imagelayout
arg4 - dst_image: image
arg5 - dst_imagelayout: imagelayout
arg6 - regions: {imageresolve}
Rfr: vkCmdResolveImage, vkCmdResolveImage2KHR.
-
cmd_set_blend_constants(cb, constant0, constant1, constant2, constant3)
Rfr: vkCmdSetBlendConstants.
-
cmd_set_color_write_enable(cb, {boolean})
Rfr: vkCmdSetColorWriteEnableEXT.
-
cmd_set_cull_mode(cb, cullmodeflags)
Rfr: vkCmdSetCullModeEXT.
-
cmd_set_depth_bias(cb, constantfactor, clamp, slopefactor)
cmd_set_depth_bias_enable(cb, boolean)
Rfr: vkCmdSetDepthBias, vkCmdSetDepthBiasEnableEXT.
-
cmd_set_depth_bounds(cb, min, max)
cmd_set_depth_bounds_test_enable(cb, boolean)
Rfr: vkCmdSetDepthBounds, vkCmdSetDepthBoundsTestEnableEXT.
-
cmd_set_depth_compare_op(cb, compareop)
Rfr: vkCmdSetDepthCompareOpEXT.
-
cmd_set_depth_test_enable(cb, boolean)
Rfr: vkCmdSetDepthTestEnableEXT.
-
cmd_set_depth_write_enable(cb, boolean)
Rfr: vkCmdSetDepthWriteEnableEXT.
-
cmd_set_device_mask(cb, devicemask)
Rfr: vkCmdSetDeviceMask.
-
cmd_set_discard_rectangle(cb, first, {rect2d})
Rfr: vkCmdSetDiscardRectangleEXT.
-
cmd_set_event(cb, event, pipelinestageflags)
cmd_set_event(cb, event, {dependencyinfo})
Rfr: vkCmdSetEvent, vkCmdSetEvent2KHR.
-
cmd_set_fragment_shading_rate(cb, fragment_size, combiner_op1, combiner_op2)
fragment_size: extent2d,
combiner_op1, combiner_op2: fragmentshadingratecombinerop,
Rfr: vkCmdSetFragmentShadingRateKHR.
-
cmd_set_front_face(cb, frontface)
Rfr: vkCmdSetFrontFaceEXT.
-
cmd_set_line_width(cb, [linewidth = 1.0])
Rfr: vkCmdSetLineWidth.
-
cmd_set_line_stipple(cb, factor, pattern)
Rfr: vkCmdSetLineStippleEXT.
-
cmd_set_logic_op(cb, logicop)
Rfr: vkCmdSetLogicOpEXT.
-
cmd_set_patch_control_points(cb, integer>>)
Rfr: vkCmdSetPatchControlPointsEXT.
-
cmd_set_primitive_restart_enable(cb, boolean)
Rfr: vkCmdSetPrimitiveRestartEnableEXT.
-
cmd_set_primitive_topology(cb, primitivetopology)
Rfr: vkCmdSetPrimitiveTopologyEXT.
-
cmd_set_rasterizer_discard_enable(cb, boolean)
Rfr: vkCmdSetRasterizerDiscardEnableEXT.
-
cmd_set_sample_locations(cb, samplelocationsinfo)
Rfr: vkCmdSetSampleLocationsEXT.
-
cmd_set_scissor(cb, first, {rect2d})
cmd_set_scissor_with_count(cb, {rect2d})
Rfr: vkCmdSetScissor, vkCmdSetScissorWithCountEXT.
-
cmd_set_stencil_compare_mask(cb, face_mask, compare_mask)
face_mask: stencilfaceflags
compare_mask: integer
Rfr: vkCmdSetStencilCompareMask.
-
cmd_set_stencil_op(cb, face_mask, …)
arg2 - face_mask: stencilfaceflags
arg3 - fail_op: stencilop
arg4 - pass_op: stencilop
arg5 - depth_fail_op: stencilop
arg6 - compare_op: compareop
Rfr: vkCmdSetStencilOpEXT.
-
cmd_set_stencil_reference(cb, face_mask, reference)
face_mask: stencilfaceflags
reference: integer
Rfr: vkCmdSetStencilReference.
-
cmd_set_stencil_test_enable(cb, boolean)
Rfr: vkCmdSetStencilTestEnableEXT.
-
cmd_set_stencil_write_mask(cb, face_mask, write_mask)
face_mask: stencilfaceflags
write_mask: integer
Rfr: vkCmdSetStencilWriteMask.
-
cmd_set_vertex_input(cb, [{vertexinputbindingdescription2}], [{vertexinputattributedescription2}])
Rfr: vkCmdSetVertexInputEXT.
-
cmd_set_viewport(cb, first, {viewport})
cmd_set_viewport_with_count(cb, {viewport})
Rfr: vkCmdSetViewport, vkCmdSetViewportWithCountEXT.
-
cmd_update_buffer(cb, dst_buffer, dst_offset, data)
dst_buffer: buffer
dst_offset: integer
data: binary string (n x 4 bytes)
Rfr: vkCmdUpdateBuffer.
-
cmd_wait_events(cb, src_stage_mask, …)
cmd_wait_events(cb, {event}, dependencyinfo)
arg2 - src_stage_mask: pipelinestageflags
arg3 - dst_stage_mask: pipelinestageflags
arg4 - events: {event}
arg5 - [memory_barriers]: {memorybarrier}
arg6 - [buffer_memory_barriers]: {buffermemorybarrier}
arg7 - [image_memory_barriers]: {imagememorybarrier}
Rfr: vkCmdWaitEvents, vkCmdWaitEvents2KHR.
-
cmd_write_timestamp(cb, pipelinestageflags, query_pool, query)
Rfr: vkCmdWriteTimestamp, vkCmdWriteTimestamp2KHR.
Layers and extensions
Enumerate extensions
Each of the following functions returns an integer-indexed array unless it is called with byname=true, in which case the returned table is indexed by name. For example, vk.enumerate_instance_layer_properties(true) returns a table indexed by layer_name (which is usually more convenient).
-
{layerproperties} = enumerate_instance_layer_properties([byname=false])
Rfr: vkEnumerateInstanceLayerProperties.
-
{extensionproperties} = enumerate_instance_extension_properties([layer_name], [byname=false])
Rfr: vkEnumerateInstanceExtensionProperties.
-
{layerproperties} = enumerate_device_layer_properties(physdev, [byname=false]) DEPRECATED
Rfr: vkEnumerateDeviceLayerProperties.
-
{extensionproperties} = enumerate_device_extension_properties(physdev, [layer_name], [byname=false])
Rfr: vkEnumerateDeviceExtensionProperties.
Note
|
Device layers are deprecated (rfr: 'Device Layer Deprecation'). As a consequence, with up to date Vulkan implementations, the enumerate_device_layer_properties( ) function will always return an empty list, and the layer parameter in the enumerate_device_extension_properties( ) is irrelevant. |
Supported extensions
MoonVulkan supports the core Vulkan API, plus most of the Khronos (KHR) and multivendor (EXT) extensions.
It also supports any extension that does not require API calls other than that for enabling it.
It does not support Khronos experimental extensions (KHX) and single vendor extensions (AMD, GOOGLE, NV, …).
Surfaces (KHR)
surface
Rfr: VK_KHR_surface.
-
surface = created_surface(instance, surfaceRAW, [allocator])
surfaceRAW: a valid VkSurfaceKHR handle (integer) for the given instance.
Creates and returns a surface userdata (MoonVulkan object) bound to the given handle.
(See 'Creating surfaces by other means' for details on how to use this function.)
-
surface = create_display_plane_surface(display_mode, displaysurfacecreateinfo, [allocator])
Rfr: vkCreateDisplayPlaneSurfaceKHR.
-
destroy_surface(surface)
Rfr: vkDestroySurfaceKHR
-
boolean = get_physical_device_surface_support(physdev, queue_family_index, surface)
Rfr: vkGetPhysicalDeviceSurfaceSupportKHR.
-
surfacecapabilities = get_physical_device_surface_capabilities(physdev, surface)
Rfr: vkGetPhysicalDeviceSurfaceCapabilitiesKHR.
-
{surfaceformat} = get_physical_device_surface_formats(physdev, surface)
Rfr: vkGetPhysicalDeviceSurfaceFormatsKHR.
-
{presentmode} = get_physical_device_surface_present_modes(physdev, surface, [byname])
If byname=true, then a table of booleans indexed by presentmode is returned instead of the {presentmode} array.
Rfr: vkGetPhysicalDeviceSurfacePresentModesKHR.
-
devicegrouppresentmodeflags = get_device_group_surface_present_modes(device, surface)
Rfr: vkGetDeviceGroupSurfacePresentModesKHR.
-
{rect2d} = get_physical_device_present_rectangles(physdev, surface)
Rfr: vkGetPhysicalDevicePresentRectanglesKHR.
-
devicegrouppresentcapabilities = get_device_group_present_capabilities(device)
Rfr: vkGetDeviceGroupPresentCapabilitiesKHR.
Platform-specific surface API
Platform-specific surface API are available only if MoonVulkan was compiled with support enabled for the desired platforms. This is not needed if surfaces are created using MoonGLFW or equivalent libraries that handle platform-specific details.
(Hint: Use MoonGLFW, avoid compiling for specific platforms, and ignore this section).
Rfr: VK_KHR_xlib_surface, PLATFORM_XLIB.
-
boolean = get_physical_device_xlib_presentation_support(physdev, queue_family_index, dpy, visual_id)
dpy: lightuserdata (Display*)
Rfr: vkGetPhysicalDeviceXlibPresentationSupportKHR.
-
surface = create_xlib_surface(instance, flags, dpy, window, [allocator])
dpy: lightuserdata (Display*)
window: lightuserdata (Window)
Rfr: vkCreateXlibSurfaceKHR.
Rfr: VK_KHR_xcb_surface, PLATFORM_XCB.
-
boolean = get_physical_device_xcb_presentation_support(physdev, queue_family_index, connection, visual_id)
connection: lightuserdata (xcb_connection_t*)
Rfr: vkGetPhysicalDeviceXcbPresentationSupportKHR.
-
surface = create_xcb_surface(instance, flags, connection, window, [allocator])
connection: lightuserdata (xcb_connection_t*)
Rfr: vkCreateXcbSurfaceKHR.
-
boolean = get_physical_device_wayland_presentation_support(physdev, queue_family_index, wldisplay)
wldisplay: lightuserdata (wl_display*)
Rfr: vkGetPhysicalDeviceWaylandPresentationSupportKHR.
-
surface = create_wayland_surface(instance, flags, wldisplay, wlsurface, [allocator])
wldisplay: lightuserdata (wl_display*)
wlsurface: lightuserdata (wl_surface*)
Rfr: vkCreateWaylandSurfaceKHR.
-
boolean = get_physical_device_win32_presentation_support(physdev, queue_family_index)
Rfr: vkGetPhysicalDeviceWin32PresentationSupportKHR.
-
surface = create_win32_surface(instance, flags, hinstance, hwnd, [allocator])
hinstance: lightuserdata (HINSTANCE)
hwnd: lightuserdata (HWND)
Rfr: vkCreateWin32SurfaceKHR.
Rfr: VK_EXT_headless_surface.
-
surface = create_headless_surface(instance, headlesssurfacecreateflags, [allocator])
Rfr: vkCreateHeadlessSurfaceEXT.
Displays (KHR)
display
Rfr: VK_KHR_display.
-
{displayproperties} = get_physical_device_display_properties(physdev)
Rfr: vkGetPhysicalDeviceDisplayPropertiesKHR, vkGetPhysicalDeviceDisplayProperties2KHR.
-
{displayplaneproperties} = get_physical_device_display_plane_properties(physdev)
Rfr: vkGetPhysicalDeviceDisplayPlanePropertiesKHR, vkGetPhysicalDeviceDisplayPlaneProperties2KHR.
-
{display} = get_display_plane_supported_displays(physdev, plane_index)
Rfr: vkGetDisplayPlaneSupportedDisplaysKHR.
-
release_display(display)
Rfr: vkReleaseDisplayEXT.
-
display_power_control(device, display, displaypowerinfo)
Rfr: vkDisplayPowerControlEXT.
-
acquire_xlib_display(dpy, display)
display = get_randr_output_display(physdev, dpy, rroutput)
dpy: lightuserdata (Display*),
rroutput: integer (RROutput).
Rfr: vkAcquireXlibDisplayEXT, vkGetRandROutputDisplayEXT.
display_mode
Rfr: VK_KHR_display.
-
display_mode = create_display_mode(display, displaymodecreateinfo, [allocator])
display_mode = create_display_mode(display, displaymodecreateflags, displaymodeparameters, [allocator])
Rfr: vkCreateDisplayModeKHR.
-
{displaymodeproperties} = get_display_mode_properties(display)
Rfr: vkGetDisplayModePropertiesKHR, vkGetDisplayModeProperties2KHR.
-
displayplanecapabilities = get_display_plane_capabilities(display_mode, plane_index)
displayplanecapabilities = get_display_plane_capabilities(display_mode, displayplaneinfo) (2KHR only)
Rfr: vkGetDisplayPlaneCapabilitiesKHR, vkGetDisplayPlaneCapabilities2KHR.
Swapchains (KHR)
swapchain
Rfr: VK_KHR_swapchain.
-
swapchain = create_swapchain(device, swapchaincreateinfo, [allocator])
Rfr: vkCreateSwapchainKHR.
-
destroy_swapchain(swapchain)
Rfr: vkDestroySwapchainKHR.
-
{image} = get_swapchain_images(swapchain)
Rfr: vkGetSwapchainImagesKHR.
-
image_index, result = acquire_next_image(swapchain, timeout, [semaphore], [fence])
image_index, result = acquire_next_image(swapchain, acquirenextimageinfo) (2KHR only)
Returns one of the following combinations of image_index and result:
1) image_index, 'success' 2) image_index, 'suboptimal' 3) nil, '…' (any other result)
Rfr: vkAcquireNextImageKHR, vkAcquireNextImage2KHR.
-
result, {result} = queue_present(queue, presentinfo, [per_swapchain_results])
[per_swapchain_results]: boolean
Returns the global result for the operation, optionally followed by a table with the individual results for each of the given swapchains.
The individual results table is returned only if per_swapchain_results is true.
Rfr: vkQueuePresentKHR.
-
result = wait_for_present(swapchain, present_id, timeout)
Rfr: vkWaitForPresentKHR.
-
result = get_swapchain_status(swapchain)
Rfr: vkGetSwapchainStatusKHR.
-
set_hdr_metadata({swapchain}, hdrmetadata)
Rfr: vkSetHdrMetadataEXT.
-
value = getswapchaincounter(swapchain, surfacecounterflags)
Rfr: vkGetSwapchainCounterEXT.
Other (KHR)
descriptor_update_template
-
descriptor_update_template = create_descriptor_update_template(device, info, [allocator])
info: descriptorupdatetemplatecreateinfo
Rfr: vkCreateDescriptorUpdateTemplate.
-
destroy_descriptor_update_template(descriptor_update_template)
Rfr: vkDestroyDescriptorUpdateTemplate.
-
update_descriptor_set_with_template(descriptor_set, descriptor_update_template, data)
data: binary string
The data parameter can be constructed using the pack_descriptorimageinfo( ), pack_descriptorbufferinfo( ), and pack_bufferview( ) utilities.
Rfr: vkUpdateDescriptorSetWithTemplate. -
See also: commands.
sampler_ycbcr_conversion
-
sampler_ycbcr_conversion = create_sampler_ycbcr_conversion(device, samplerycbcrconversioncreateinfo, [allocator])
Rfr: vkCreateSamplerYcbcrConversion.
-
destroy_sampler_ycbcr_conversion(sampler_ycbcr_conversion)
Rfr: vkDestroySamplerYcbcrConversion.
Other (EXT)
debug_report
Rfr: VK_EXT_debug_report.
-
debug_report_callback = create_debug_report_callback(instance, debugreportflags, func, [allocator])
The func callback (a Lua function) will be executed as:
func(instance, flags, object_type, objectRAW, location, message_code, layer_prefix, message),
where the parameters are the same as those for the debug_report_message( ) function.
Rfr: vkCreateDebugReportCallbackEXT.
-
destroy_debug_report_callback(debug_report_callback)
Rfr: vkDestroyDebugReportCallbackEXT.
-
debug_report_message(instance, debugreportflags, object_type, …)
arg3: object_type: debugreportobjecttype
arg4: objectRAW: integer raw object handle (may be 0)
arg5: location: integer
arg6: message_code: integer
arg7: layer_prefix: string
arg8: message: string
Rfr: vkDebugReportMessageEXT.
debug_marker
Rfr: VK_EXT_debug_marker.
-
debug_marker_set_object_name(device, object_type, objectRAW, object_name)
object_type: debugreportobjecttype
objectRAW: integer raw object handle (may be 0)
object_name: string
Rfr: vkDebugMarkerSetObjectNameEXT.
-
debug_marker_set_object_tag(device, object_type, objectRAW, tag_name, object_tag)
object_type: debugreportobjecttype
objectRAW: integer raw object handle (may be 0)
tag_name: integer
object_tag: binary string
Rfr: vkDebugMarkerSetObjectTagEXT. -
See also: commands.
debug_utils
Rfr: VK_EXT_debug_utils.
-
debug_utils_messenger = create_debug_utils_messenger(instance, debugutilsmessengercreateinfo, func, [allocator])
The func callback (a Lua function) will be executed as:
func(instance, severityflags, typeflags, callbackdata),
where the parameters are the same as those for the submit_debug_utils_message( ) function.
Rfr: vkCreateDebugUtilsMessengerEXT.
-
destroy_debug_utils_messenger(debug_utils_messenger)
Rfr: vkDestroyDebugUtilsMessengerEXT.
-
submit_debug_utils_message(instance, severityflags, typeflags, callbackdata)
severityflags: debugutilsmessageseverityflags,
typeflags: debugutilsmessagetypeflags,
callbackdata: debugutilsmessengercallbackdata.
Rfr: vkSubmitDebugUtilsMessageEXT.
-
set_debug_utils_object_name(device, debugutilsobjectnameinfo)
Rfr: vkSetDebugUtilsObjectNameEXT.
-
set_debug_utils_object_tag(device, debugutilsobjecttaginfo)
Rfr: vkSetDebugUtilsObjectTagEXT.
-
queue_begin_debug_utils_label(queue, debugutilslabel)
Rfr: vkQueueBeginDebugUtilsLabelEXT.
-
queue_end_debug_utils_label(queue)
Rfr: vkQueueEndDebugUtilsLabelEXT.
-
queue_insert_debug_utils_label(queue, debugutilslabel)
Rfr: vkQueueInsertDebugUtilsLabelEXT. -
See also: commands.
validation_cache
Rfr: VK_EXT_validation_cache.
-
validation_cache = create_validation_cache(device, validationcachecreateinfo, [allocator])
Rfr: vkCreateValidationCacheEXT.
-
destroy_validation_cache(validation_cache)
Rfr: vkDestroyValidationCacheEXT.
-
data = get_validation_cache_data(validation_cache)
Returns data as a binary string.
Rfr: vkGetValidationCacheDataEXT.
-
merge_validation_caches(destination, {source})
destination, source: validation_cache
Rfr: vkMergeValidationCachesEXT.
calibrated_timestamps
-
{timestamp}, {maxdeviation} = get_calibrated_timestamps(device, {calibratedtimestampinfo})
Rfr: vkGetCalibratedTimestampsEXT.
Structs
This section describes the tables used in MoonVulkan to pass Vulkan API structures from Lua to C and viceversa.
The correspondence between the tables and the underlying C structs is almost one-to-one [4]. Fields in tables are named with snake_case versions of their C equivalents (without the leading p's denoting pointers in C), and have the same semantics.
When a table is passed from C to Lua, all its fields are always present unless otherwise explicitly stated in the descriptions below.
When passing a table from Lua to C, if a field is annotated with [R] it is required and must be explicitly set, otherwise it is optional. If an optional field is not set, the following default value(s) will be used unless otherwise specified in the field’s description:
-
fields that admit a 'not present' encoding will be encoded as such,
-
flags default to 0,
-
enums default to the value indicated as default for their type in the Enums section,
-
booleans default to false,
-
integers, floats, and numbers in general default to 0,
-
strings default to NULL (not present).
(note that a default value may not necessarily be considered valid by the Vulkan API: if you need to check this, use the validation layers).
The tables are described as fieldname:valuetype lists of fields, where fieldname is the key of the field in the Lua table, and valuetype is the type its value must be of. The notation {valuetype} denotes an array of valuetype elements (by 'array' we mean a table with 1-based integer keys and no gaps, a.k.a. 'sequence' in Lua’s jargon).
Basic types used in the table description that follow:
Note
|
0-based indices that are used as identifiers in the Vulkan C API, like queue indices or queue family indices, are 0-based also in MoonVulkan functions and structs. They are not remapped to Lua-style 1-based indices to avoid confusion when using the validation layers. Care must be taken, however, when deducing their values from positions in Lua tables (for example, the queue_family_index of the i-th element in the table returned by get_physical_device_queue_family_properties( ) is i-1). |
-
layerproperties = {
layer_name: string,
spec_version: integer,
implementation_version: integer,
description: string,
} (rfr: VkLayerProperties) -
extensionproperties = {
extension_name: string,
spec_version: integer,
} (rfr: VkExtensionProperties)
-
instancecreateinfo = {
flags: instancecreateflags
application_info: applicationinfo
enabled_layer_names: {string}
enabled_extension_names: {string}
-- EXTENSION VkValidationFlagsEXT:
disabled_validation_checks: {validationcheck},
-- EXTENSION VkValidationFeaturesEXT:
enabled_validation_features: {validationfeatureenable},
disabled_validation_features: {validationfeaturedisable},
} (rfr: VkInstanceCreateInfo)
-
applicationinfo = {
application_name: string,
application_version: integer,
engine_name: string,
engine_version: integer,
api_version: integer,
} (rfr: VkApplicationInfo)
-
physicaldevicegroupproperties = {
physical_devices: {physical_device},
subset_allocation: boolean,
} (rfr: VkPhysicalDeviceGroupProperties) -
physicaldeviceproperties = {
api_version: integer,
driver_version: integer,
vendor_id: integer,
device_id: integer,
device_type: physicaldevicetype,
device_name: string,
pipeline_cache_uuid: binary string (length = 16),
limits: physicaldevicelimits,
sparse_properties: physicaldevicesparseproperties,
-- EXTENSION VkPhysicalDevicePushDescriptorPropertiesKHR:
max_push_descriptors: integer,
-- EXTENSION VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT:
advanced_blend_max_color_attachments: integer,
advanced_blend_independent_blend: boolean,
advanced_blend_non_premultiplied_src_color: boolean,
advanced_blend_non_premultiplied_dst_color: boolean,
advanced_blend_correlated_overlap: boolean,
advanced_blend_all_operations: boolean,
-- EXTENSION VkPhysicalDeviceSamplerFilterMinmaxProperties:
filter_minmax_single_component_formats: boolean,
filter_minmax_image_component_mapping: boolean,
-- EXTENSION VkPhysicalDeviceDiscardRectanglePropertiesEXT:
max_discard_rectangles: integer,
-- EXTENSION VkPhysicalDeviceIDProperties:
device_uuid: binary string,
driver_uuid: binary string,
device_luid: binary string,
device_node_mask: integer,
device_luid_valid: boolean,
-- EXTENSION VkPhysicalDevicePointClippingProperties:
point_clipping_behavior: pointclippingbehavior,
-- EXTENSION VkPhysicalDeviceMaintenance3Properties:
max_per_set_descriptors: integer,
max_memory_allocation_size: integer,
-- EXTENSION VkPhysicalDeviceSampleLocationsPropertiesEXT:
sample_location_sample_counts: samplecountflags,
max_sample_location_grid_size: extent2d,
sample_location_coordinate_range: {float}[2],
sample_location_sub_pixel_bits: integer,
variable_sample_locations: boolean,
-- EXTENSION VkPhysicalDeviceSubgroupProperties:
supported_stages: shaderstageflags,
supported_operations: subgroupfeatureflags,
quad_operations_in_all_stages: boolean,
-- EXTENSION VkPhysicalDeviceProtectedMemoryProperties:
protected_no_fault: boolean,
-- EXTENSION VkPhysicalDeviceConservativeRasterizationPropertiesEXT:
primitive_overestimation_size: float,
max_extra_primitive_overestimation_size: float,
extra_primitive_overestimation_size_granularity: float,
primitive_underestimation: boolean,
conservative_point_and_line_rasterization: boolean,
degenerate_triangles_rasterized: boolean,
degenerate_lines_rasterized: boolean,
fully_covered_fragment_shader_input_variable: boolean,
conservative_rasterization_post_depth_coverage: boolean,
-- EXTENSION VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT:
max_vertex_attrib_divisor: integer,
-- EXTENSION VkPhysicalDeviceInlineUniformBlockPropertiesEXT:
max_inline_uniform_block_size: integer,
max_per_stage_descriptor_inline_uniform_blocks: integer,
max_per_stage_descriptor_update_after_bind_inline_uniform_blocks: integer,
max_descriptor_set_inline_uniform_blocks: integer,
max_descriptor_set_update_after_bind_inline_uniform_blocks: integer,
-- EXTENSION VkPhysicalDeviceDescriptorIndexingProperties:
shader_uniform_buffer_array_non_uniform_indexing_native: boolean,
shader_sampled_image_array_non_uniform_indexing_native: boolean,
shader_storage_buffer_array_non_uniform_indexing_native: boolean,
shader_storage_image_array_non_uniform_indexing_native: boolean,
shader_input_attachment_array_non_uniform_indexing_native: boolean,
robust_buffer_access_update_after_bind: boolean,
quad_divergent_implicit_lod: boolean,
max_per_stage_descriptor_update_after_bind_samplers: integer,
max_per_stage_descriptor_update_after_bind_uniform_buffers: integer,
max_per_stage_descriptor_update_after_bind_storage_buffers: integer,
max_per_stage_descriptor_update_after_bind_sampled_images: integer,
max_per_stage_descriptor_update_after_bind_storage_images: integer,
max_per_stage_descriptor_update_after_bind_input_attachments: integer,
max_per_stage_update_after_bind_resources: integer,
max_descriptor_set_update_after_bind_samplers: integer,
max_descriptor_set_update_after_bind_uniform_buffers: integer,
max_descriptor_set_update_after_bind_uniform_buffers_dynamic: integer,
max_descriptor_set_update_after_bind_storage_buffers: integer,
max_descriptor_set_update_after_bind_storage_buffers_dynamic: integer,
max_descriptor_set_update_after_bind_sampled_images: integer,
max_descriptor_set_update_after_bind_storage_images: integer,
max_descriptor_set_update_after_bind_input_attachments: integer,
-- EXTENSION VkPhysicalDeviceMultiviewProperties:
max_multiview_view_count: integer,
max_multiview_instance_index: integer,
-- EXTENSION VkPhysicalDeviceExternalMemoryHostPropertiesEXT:
min_imported_host_pointer_alignment: integer,
-- EXTENSION VkPhysicalDeviceDriverProperties:
driver_id: driverid,
driver_name: string,
driver_info: string,
conformance_version: conformanceversion,
-- EXTENSION VkPhysicalDevicePCIBusInfoPropertiesEXT:
pci_domain: integer,
pci_bus: integer,
pci_device: integer,
pci_function: integer,
-- EXTENSION VkPhysicalDeviceTransformFeedbackPropertiesEXT:
max_transform_feedback_streams: integer,
max_transform_feedback_buffers: integer,
max_transform_feedback_buffer_size: integer,
max_transform_feedback_stream_data_size: integer,
max_transform_feedback_buffer_data_size: integer,
max_transform_feedback_buffer_data_stride: integer,
transform_feedback_queries: boolean ,
transform_feedback_streams_lines_triangles: boolean ,
transform_feedback_rasterization_stream_select: boolean ,
transform_feedback_draw: boolean ,
-- EXTENSION VkPhysicalDeviceFloatControlsProperties:
denorm_behavior_independence: shaderfloatcontrolsindependence,
rounding_mode_independence: shaderfloatcontrolsindependence,
shader_signed_zero_inf_nan_preserve_float16: boolean,
shader_signed_zero_inf_nan_preserve_float32: boolean,
shader_signed_zero_inf_nan_preserve_float64: boolean,
shader_denorm_preserve_float16: boolean,
shader_denorm_preserve_float32: boolean,
shader_denorm_preserve_float64: boolean,
shader_denorm_flush_to_zero_float16: boolean,
shader_denorm_flush_to_zero_float32: boolean,
shader_denorm_flush_to_zero_float64: boolean,
shader_rounding_mode_rte_float16: boolean,
shader_rounding_mode_rte_float32: boolean,
shader_rounding_mode_rte_float64: boolean,
shader_rounding_mode_rtz_float16: boolean,
shader_rounding_mode_rtz_float32: boolean,
shader_rounding_mode_rtz_float64: boolean,
-- EXTENSION VkPhysicalDeviceDepthStencilResolveProperties:
supported_depth_resolve_modes: resolvemodeflags,
supported_stencil_resolve_modes: resolvemodeflags,
independent_resolve_none: boolean,
independent_resolve: boolean,
-- EXTENSION VkPhysicalDeviceFragmentDensityMapPropertiesEXT:
min_fragment_density_texel_size: extent2d,
max_fragment_density_texel_size: extent2d,
fragment_density_invocations: boolean,
-- EXTENSION VkPhysicalDeviceMemoryBudgetPropertiesEXT:
heap_budget: {integer}[16],
heap_usage: {integer}[16],
-- EXTENSION VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT:
storage_texel_buffer_offset_alignment_bytes: integer,
storage_texel_buffer_offset_single_texel_alignment: boolean,
uniform_texel_buffer_offset_alignment_bytes: integer,
uniform_texel_buffer_offset_single_texel_alignment: boolean,
-- EXTENSION VkPhysicalDevicePerformanceQueryPropertiesKHR:
allow_command_buffer_query_copies: boolean,
-- EXTENSION VkPhysicalDeviceTimelineSemaphoreProperties:
max_timeline_semaphore_value_difference: integer,
-- EXTENSION VkPhysicalDeviceFragmentShadingRatePropertiesKHR:
min_fragment_shading_rate_attachment_texel_size: extent2d,
max_fragment_shading_rate_attachment_texel_size: extent2d,
max_fragment_shading_rate_attachment_texel_size_aspect_ratio: integer,
primitive_fragment_shading_rate_with_multiple_viewports: boolean,
layered_shading_rate_attachments: boolean,
fragment_shading_rate_non_trivial_combiner_ops: boolean,
max_fragment_size: extent2d,
max_fragment_size_aspect_ratio: integer,
max_fragment_shading_rate_coverage_samples: integer,
max_fragment_shading_rate_rasterization_samples: samplecountflags,
fragment_shading_rate_with_shader_depth_stencil_writes: boolean,
fragment_shading_rate_with_sample_mask: boolean,
fragment_shading_rate_with_shader_sample_mask: boolean,
fragment_shading_rate_with_conservative_rasterization: boolean,
fragment_shading_rate_with_fragment_shader_interlock: boolean,
fragment_shading_rate_with_custom_sample_locations: boolean,
fragment_shading_rate_strict_multiply_combiner: boolean,
-- EXTENSION VkPhysicalDeviceAccelerationStructurePropertiesKHR:
max_geometry_count: integer,
max_instance_count: integer,
max_primitive_count: integer,
max_per_stage_descriptor_acceleration_structures: integer,
max_per_stage_descriptor_update_after_bind_acceleration_structures: integer,
max_descriptor_set_acceleration_structures: integer,
max_descriptor_set_update_after_bind_acceleration_structures: integer,
min_acceleration_structure_scratch_offset_alignment: integer,
-- EXTENSION VkPhysicalDeviceRayTracingPipelinePropertiesKHR:
shader_group_handle_size: integer,
max_ray_recursion_depth: integer,
max_shader_group_stride: integer,
shader_group_base_alignment: integer,
shader_group_handle_capture_replay_size: integer,
max_ray_dispatch_invocation_count: integer,
shader_group_handle_alignment: integer,
max_ray_hit_attribute_size: integer,
-- EXTENSION VkPhysicalDeviceSubgroupSizeControlPropertiesEXT:
min_subgroup_size: integer,
max_subgroup_size: integer,
max_compute_workgroup_subgroups: integer,
required_subgroup_size_stages: shaderstageflags,
-- EXTENSION VkPhysicalDeviceProvokingVertexPropertiesEXT:
provoking_vertex_mode_per_pipeline: boolean,
transform_feedback_preserves_triangle_fan_provoking_vertex: boolean,
-- EXTENSION VkPhysicalDeviceLineRasterizationPropertiesEXT:
line_sub_pixel_precision_bits: integer,
-- EXTENSION VkPhysicalDeviceRobustness2PropertiesEXT:
robust_storage_buffer_access_size_alignment: integer,
robust_uniform_buffer_access_size_alignment: integer,
-- EXTENSION VkPhysicalDeviceCustomBorderColorPropertiesEXT:
max_custom_border_color_samplers: integer,
-- EXTENSION VkPhysicalDeviceFragmentDensityMap2PropertiesEXT:
subsampled_loads: boolean,
subsampled_coarse_reconstruction_early_access: boolean,
max_subsampled_array_layers: integer,
max_descriptor_set_subsampled_samplers: integer,
-- EXTENSION VkPhysicalDeviceDrmPropertiesEXT:
has_primary: boolean,
has_render: boolean,
primary_major: integer,
primary_minor: integer,
render_major: integer,
render_minor: integer,
-- EXTENSION VkPhysicalDeviceMultiDrawPropertiesEXT:
max_multi_draw_count: integer,
-- EXTENSION VkPhysicalDeviceMaintenance4PropertiesKHR:
max_buffer_size: integer,
-- EXTENSION VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR:
integer_dot_product_8bit_unsigned_accelerated: boolean,
integer_dot_product_8bit_signed_accelerated: boolean,
integer_dot_product_8bit_mixed_signedness_accelerated: boolean,
integer_dot_product_4x8bit_packed_unsigned_accelerated: boolean,
integer_dot_product_4x8bit_packed_signed_accelerated: boolean,
integer_dot_product_4x8bit_packed_mixed_signedness_accelerated: boolean,
integer_dot_product_16bit_unsigned_accelerated: boolean,
integer_dot_product_16bit_signed_accelerated: boolean,
integer_dot_product_16bit_mixed_signedness_accelerated: boolean,
integer_dot_product_32bit_unsigned_accelerated: boolean,
integer_dot_product_32bit_signed_accelerated: boolean,
integer_dot_product_32bit_mixed_signedness_accelerated: boolean,
integer_dot_product_64bit_unsigned_accelerated: boolean,
integer_dot_product_64bit_signed_accelerated: boolean,
integer_dot_product_64bit_mixed_signedness_accelerated: boolean,
integer_dot_product_accumulating_saturating_8bit_unsigned_accelerated: boolean,
integer_dot_product_accumulating_saturating_8bit_signed_accelerated: boolean,
integer_dot_product_accumulating_saturating_8bit_mixed_signedness_accelerated: boolean,
integer_dot_product_accumulating_saturating_4x8bit_packed_unsigned_accelerated: boolean,
integer_dot_product_accumulating_saturating_4x8bit_packed_signed_accelerated: boolean,
integer_dot_product_accumulating_saturating_4x8bit_packed_mixed_signedness_accelerated: boolean,
integer_dot_product_accumulating_saturating_16bit_unsigned_accelerated: boolean,
integer_dot_product_accumulating_saturating_16bit_signed_accelerated: boolean,
integer_dot_product_accumulating_saturating_16bit_mixed_signedness_accelerated: boolean,
integer_dot_product_accumulating_saturating_32bit_unsigned_accelerated: boolean,
integer_dot_product_accumulating_saturating_32bit_signed_accelerated: boolean,
integer_dot_product_accumulating_saturating_32bit_mixed_signedness_accelerated: boolean,
integer_dot_product_accumulating_saturating_64bit_unsigned_accelerated: boolean,
integer_dot_product_accumulating_saturating_64bit_signed_accelerated: boolean,
integer_dot_product_accumulating_saturating_64bit_mixed_signedness_accelerated: boolean,
} (rfr: VkPhysicalDeviceProperties2) -
conformanceversion = {
major: integer,
minor: integer,
subminor: integer,
patch: integer,
} (rfr: VkConformanceVersion) -
physicaldeviceimageformatinfo = {
format: format,
type: imagetype,
tiling: imagetiling,
usage: imageusageflags,
flags: imagecreateflags,
-- EXTENSION VkPhysicalDeviceExternalImageFormatInfo:
handle_type: externalmemoryhandletypeflags,
-- EXTENSION VkImageStencilUsageCreateInfo:
stencil_usage: imageusageflags,
-- EXTENSION VkPhysicalDeviceImageViewImageFormatInfoEXT:
image_view_type, imageviewtype,
} (rfr: VkPhysicalDeviceImageFormatInfo2) -
physicaldevicelimits = {
max_image_dimension_1d: integer,
max_image_dimension_2d: integer,
max_image_dimension_3d: integer,
max_image_dimension_cube: integer,
max_image_array_layers: integer,
max_texel_buffer_elements: integer,
max_uniform_buffer_range: integer,
max_storage_buffer_range: integer,
max_push_constants_size: integer,
max_memory_allocation_count: integer,
max_sampler_allocation_count: integer,
buffer_image_granularity: integer,
sparse_address_space_size: integer,
max_bound_descriptor_sets: integer,
max_per_stage_descriptor_samplers: integer,
max_per_stage_descriptor_uniform_buffers: integer,
max_per_stage_descriptor_storage_buffers: integer,
max_per_stage_descriptor_sampled_images: integer,
max_per_stage_descriptor_storage_images: integer,
max_per_stage_descriptor_input_attachments: integer,
max_per_stage_resources: integer,
max_descriptor_set_samplers: integer,
max_descriptor_set_uniform_buffers: integer,
max_descriptor_set_uniform_buffers_dynamic: integer,
max_descriptor_set_storage_buffers: integer,
max_descriptor_set_storage_buffers_dynamic: integer,
max_descriptor_set_sampled_images: integer,
max_descriptor_set_storage_images: integer,
max_descriptor_set_input_attachments: integer,
max_vertex_input_attributes: integer,
max_vertex_input_bindings: integer,
max_vertex_input_attribute_offset: integer,
max_vertex_input_binding_stride: integer,
max_vertex_output_components: integer,
max_tessellation_generation_level: integer,
max_tessellation_patch_size: integer,
max_tessellation_control_per_vertex_input_components: integer,
max_tessellation_control_per_vertex_output_components: integer,
max_tessellation_control_per_patch_output_components: integer,
max_tessellation_control_total_output_components: integer,
max_tessellation_evaluation_input_components: integer,
max_tessellation_evaluation_output_components: integer,
max_geometry_shader_invocations: integer,
max_geometry_input_components: integer,
max_geometry_output_components: integer,
max_geometry_output_vertices: integer,
max_geometry_total_output_components: integer,
max_fragment_input_components: integer,
max_fragment_output_attachments: integer,
max_fragment_dual_src_attachments: integer,
max_fragment_combined_output_resources: integer,
max_compute_shared_memory_size: integer,
max_compute_work_group_count: {integer}[3],
max_compute_work_group_invocations: integer,
max_compute_work_group_size: {integer}[3],
sub_pixel_precision_bits: integer,
sub_texel_precision_bits: integer,
mipmap_precision_bits: integer,
max_draw_indexed_index_value: integer,
max_draw_indirect_count: integer,
max_sampler_lod_bias: integer,
max_sampler_anisotropy: float,
max_viewports: integer,
max_viewport_dimensions: {integer}[2],
viewport_bounds_range: {float}[2],
viewport_sub_pixel_bits: integer,
min_memory_map_alignment: integer,
min_texel_buffer_offset_alignment: integer,
minuniform_buffer_offset_alignment: integer,
min_storage_buffer_offset_alignment: integer,
min_texel_offset: integer,
max_texel_offset: integer,
min_texel_gather_offset: integer,
max_texel_gather_offset: integer,
min_interpolation_offset: float,
max_interpolation_offset: float,
sub_pixel_interpolation_offset_bits: integer,
max_framebuffer_width: integer,
max_framebuffer_height: integer,
max_framebuffer_layers: integer,
framebuffer_color_sample_counts: samplecountflags,
framebuffer_depth_sample_counts: samplecountflags,
framebuffer_stencil_sample_counts: samplecountflags,
framebuffer_no_attachments_sample_counts: samplecountflags,
max_color_attachments: integer,
sampled_image_color_sample_counts: samplecountflags,
sampled_image_integer_sample_counts: samplecountflags,
sampled_image_depth_sample_counts: samplecountflags,
sampled_image_stencil_sample_counts: samplecountflags,
storage_image_sample_counts: samplecountflags,
max_sample_mask_words: integer,
timestamp_compute_and_graphics: boolean,
timestamp_period: float,
max_clip_distances: integer,
max_cull_distances: integer,
max_combined_clip_and_cull_distances: integer,
discrete_queue_priorities: integer,
point_size_range: {float}[2],
line_width_range: {float}[2],
point_size_granularity: float,
line_width_granularity: float,
strict_lines: boolean,
standard_sample_locations: boolean,
optimal_buffer_copy_offset_alignment: integer,
optimal_buffer_copy_row_pitch_alignment: integer,
non_coherent_atom_size: integer,
} (rfr: VkPhysicalDeviceLimits) -
physicaldevicesparseproperties = {
residency_standard_2d_block_shape: boolean,
residency_standard_2d_multisample_block_shape: boolean,
residency_standard_3d_block_shape: boolean,
residency_aligned_mip_size: boolean,
residency_non_resident_strict: boolean,
} (rfr: VkPhysicalDeviceSparseProperties) -
physicaldevicefragmentshadingrate = {
sample_counts: samplecountflags,
fragment_size: extent2d,
} (rfr: VkPhysicalDeviceFragmentShadingRateKHR) -
physicaldevicetoolproperties = {
name: string,
version: string,
purposes: toolpurposeflags,
description: string,
layer: string,
} (rfr: VkPhysicalDeviceToolPropertiesEXT) -
physicaldevicefeatures = {
robust_buffer_access: boolean,
full_draw_index_uint32: boolean,
image_cube_array: boolean,
independent_blend: boolean,
geometry_shader: boolean,
tessellation_shader: boolean,
sample_rate_shading: boolean,
dual_src_blend: boolean,
logic_op: boolean,
multi_draw_indirect: boolean,
draw_indirect_first_instance: boolean,
depth_clamp: boolean,
depth_bias_clamp: boolean,
fill_mode_non_solid: boolean,
depth_bounds: boolean,
wide_lines: boolean,
large_points: boolean,
alpha_to_one: boolean,
multi_viewport: boolean,
sampler_anisotropy: boolean,
texture_compression_etc2: boolean,
texture_compression_astc_ldr: boolean,
texture_compression_bc: boolean,
occlusion_query_precise: boolean,
pipeline_statistics_query: boolean,
vertex_pipeline_stores_and_atomics: boolean,
fragment_stores_and_atomics: boolean,
shader_tessellation_and_geometry_point_size: boolean,
shader_image_gather_extended: boolean,
shader_storage_image_extended_formats: boolean,
shader_storage_image_multisample: boolean,
shader_storage_image_read_without_format: boolean,
shader_storage_image_write_without_format: boolean,
shader_uniform_buffer_array_dynamic_indexing: boolean,
shader_sampled_image_array_dynamic_indexing: boolean,
shader_storage_buffer_array_dynamic_indexing: boolean,
shader_storage_image_array_dynamic_indexing: boolean,
shader_clip_distance: boolean,
shader_cull_distance: boolean,
shader_float64: boolean,
shader_int64: boolean,
shader_int16: boolean,
shader_resource_residency: boolean,
shader_resource_min_lod: boolean,
sparse_binding: boolean,
sparse_residency_buffer: boolean,
sparse_residency_image_2d: boolean,
sparse_residency_image_3d: boolean,
sparse_residency_2_samples: boolean,
sparse_residency_4_samples: boolean,
sparse_residency_8_samples: boolean,
sparse_residency_16_samples: boolean,
sparse_residency_aliased: boolean,
variable_multisample_rate: boolean,
inherited_queries: boolean,
-- EXTENSION VkPhysicalDevice8BitStorageFeatures:
storage_buffer_8bit_access: boolean,
uniform_and_storage_buffer_8bit_access: boolean,
storage_push_constant_8: boolean,
-- EXTENSION VkPhysicalDevice16BitStorageFeatures:
storage_buffer_16bit_access: boolean,
uniform_and_storage_buffer_16bit_access: boolean,
storage_push_constant_16: boolean,
storage_input_output_16: boolean,
-- EXTENSION VkPhysicalDeviceVariablePointerFeatures:
variable_pointers_storage_buffer: boolean,
variable_pointers: boolean,
-- EXTENSION VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT:
advanced_blend_coherent_operations: boolean,
-- EXTENSION VkPhysicalDeviceSamplerYcbcrConversionFeatures:
sampler_ycbcr_conversion: boolean,
-- EXTENSION VkPhysicalDeviceConditionalRenderingFeaturesEXT:
conditional_rendering: boolean,
inherited_conditional_rendering: boolean,
-- EXTENSION VkPhysicalDeviceProtectedMemoryFeatures:
protected_memory: boolean,
-- EXTENSION VkPhysicalDeviceShaderDrawParameterFeatures:
shader_draw_parameters: boolean,
-- EXTENSION VkPhysicalDeviceASTCDecodeFeaturesEXT:
decode_mode_shared_exponent: boolean,
-- EXTENSION VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT:
vertex_attribute_instance_rate_divisor: boolean,
vertex_attribute_instance_rate_zero_divisor: boolean,
-- EXTENSION VkPhysicalDeviceInlineUniformBlockFeaturesEXT:
inline_uniform_block: boolean,
descriptor_binding_inline_uniform_block_update_after_bind: boolean,
-- EXTENSION VkPhysicalDeviceDescriptorIndexingFeaturesEXT:
shader_input_attachment_array_dynamic_indexing: boolean,
shader_uniform_texel_buffer_array_dynamic_indexing: boolean,
shader_storage_texel_buffer_array_dynamic_indexing: boolean,
shader_uniform_buffer_array_non_uniform_indexing: boolean,
shader_sampled_image_array_non_uniform_indexing: boolean,
shader_storage_buffer_array_non_uniform_indexing: boolean,
shader_storage_image_array_non_uniform_indexing: boolean,
shader_input_attachment_array_non_uniform_indexing: boolean,
shader_uniform_texel_buffer_array_non_uniform_indexing: boolean,
shader_storage_texel_buffer_array_non_uniform_indexing: boolean,
descriptor_binding_uniform_buffer_update_after_bind: boolean,
descriptor_binding_sampled_image_update_after_bind: boolean,
descriptor_binding_storage_image_update_after_bind: boolean,
descriptor_binding_storage_buffer_update_after_bind: boolean,
descriptor_binding_uniform_texel_buffer_update_after_bind: boolean,
descriptor_binding_storage_texel_buffer_update_after_bind: boolean,
descriptor_binding_update_unused_while_pending: boolean,
descriptor_binding_partially_bound: boolean,
descriptor_binding_variable_descriptor_count: boolean,
runtime_descriptor_array: boolean,
-- EXTENSION VkPhysicalDeviceMultiviewFeatures:
multiview: boolean,
multiview_geometry_shader: boolean,
multiview_tessellation_shader: boolean,
-- EXTENSION VkPhysicalDeviceVulkanMemoryModelFeatures:
vulkan_memory_model: boolean,
vulkan_memory_model_device_scope: boolean,
vulkan_memory_model_availability_visibility_chains: boolean,
-- EXTENSION VkPhysicalDeviceShaderAtomicInt64Features:
shader_buffer_int64_atomics: boolean,
shader_shared_int64_atomics: boolean,
-- EXTENSION VkPhysicalDeviceTransformFeedbackFeaturesEXT:
transform_feedback: boolean,
geometry_streams: boolean,
-- EXTENSION VkPhysicalDeviceShaderFloat16Int8Features:
shader_float16: boolean,
shader_int8: boolean,
-- EXTENSION VkPhysicalDeviceUniformBufferStandardLayoutFeatures:
uniform_buffer_standard_layout: boolean,
-- EXTENSION VkPhysicalDeviceScalarBlockLayoutFeatures:
scalar_block_layout: boolean,
-- EXTENSION VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT:
fragment_shader_sample_interlock: boolean,
fragment_shader_pixel_interlock: boolean,
fragment_shader_shading_rate_interlock: boolean,
-- EXTENSION VkPhysicalDeviceYcbcrImageArraysFeaturesEXT:
ycbcr_image_arrays: boolean,
-- EXTENSION VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT:
shader_demote_to_helper_invocation: boolean,
-- EXTENSION VkPhysicalDeviceImagelessFramebufferFeatures:
imageless_framebuffer: boolean,
-- EXTENSION VkPhysicalDeviceDepthClipEnableFeaturesEXT:
depth_clip_enable: boolean,
-- EXTENSION VkPhysicalDeviceFragmentDensityMapFeaturesEXT:
fragment_density_map: boolean,
fragment_density_map_dynamic: boolean,
fragment_density_map_non_subsampled_images: boolean,
-- EXTENSION VkPhysicalDeviceMemoryPriorityFeaturesEXT:
memory_priority: boolean,
-- EXTENSION VkPhysicalDeviceBufferDeviceAddressFeaturesEXT:
buffer_device_address: boolean,
buffer_device_address_capture_replay: boolean,
buffer_device_address_multi_device: boolean,
-- EXTENSION VkPhysicalDeviceHostQueryResetFeatures:
host_query_reset: boolean,
-- EXTENSION VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT:
texel_buffer_alignment: boolean,
-- EXTENSION VkPhysicalDevicePerformanceQueryFeaturesKHR:
performance_counter_query_pools: boolean,
performance_counter_multiple_query_pools: boolean,
-- EXTENSION VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures:
shader_subgroup_extended_types: boolean,
-- EXTENSION VkPhysicalDeviceShaderClockFeaturesKHR:
shader_subgroup_clock: boolean,
shader_device_clock: boolean,
-- EXTENSION VkPhysicalDeviceTimelineSemaphoreFeatures:
timeline_semaphore: boolean,
-- EXTENSION VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR:
shader_terminate_invocation: boolean,
-- EXTENSION VkPhysicalDeviceFragmentShadingRateFeaturesKHR:
pipeline_fragment_shading_rate: boolean,
primitive_fragment_shading_rate: boolean,
attachment_fragment_shading_rate: boolean,
-- EXTENSION VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures:
separate_depth_stencil_layouts: boolean,
-- EXTENSION VkPhysicalDevicePresentWaitFeaturesKHR:
present_wait: boolean,
-- EXTENSION VkPhysicalDeviceBufferDeviceAddressFeatures:
buffer_device_address: boolean,
buffer_device_address_capture_replay: boolean,
buffer_device_address_multi_device: boolean,
-- EXTENSION VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR:
pipeline_executable_info: boolean,
-- EXTENSION VkPhysicalDevicePresentIdFeaturesKHR:
present_id: boolean,
-- EXTENSION VkPhysicalDeviceSynchronization2FeaturesKHR:
synchronization2: boolean,
-- EXTENSION VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR:
shader_subgroup_uniform_control_flow: boolean,
-- EXTENSION VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR:
shader_zero_initialize_workgroup_memory: boolean,
-- EXTENSION VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR:
workgroup_memory_explicit_layout: boolean,
workgroup_memory_explicit_layout_scalar_block_layout: boolean,
workgroup_memory_explicit_layout_8bit_access: boolean,
workgroup_memory_explicit_layout_16bit_access: boolean,
-- EXTENSION VkPhysicalDeviceAccelerationStructureFeaturesKHR:
acceleration_structure: boolean,
acceleration_structure_capture_replay: boolean,
acceleration_structure_indirect_build: boolean,
acceleration_structure_host_commands: boolean,
descriptor_binding_acceleration_structure_update_after_bind: boolean,
-- EXTENSION VkPhysicalDeviceRayTracingPipelineFeaturesKHR:
ray_tracing_pipeline: boolean,
ray_tracing_pipeline_shader_group_handle_capture_replay: boolean,
ray_tracing_pipeline_shader_group_handle_capture_replay_mixed: boolean,
ray_tracing_pipeline_trace_rays_indirect: boolean,
ray_traversal_primitive_culling: boolean,
-- EXTENSION VkPhysicalDeviceRayQueryFeaturesKHR:
ray_query: boolean,
-- EXTENSION VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT:
texture_compression_astc_hdr: boolean,
-- EXTENSION VkPhysicalDeviceSubgroupSizeControlFeaturesEXT:
subgroup_size_control: boolean,
compute_full_subgroups: boolean,
-- EXTENSION VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT:
shader_image_int64_atomics: boolean,
sparse_image_int64_atomics: boolean,
-- EXTENSION VkPhysicalDeviceProvokingVertexFeaturesEXT:
provoking_vertex_last: boolean,
transform_feedback_preserves_provoking_vertex: boolean,
-- EXTENSION VkPhysicalDeviceLineRasterizationFeaturesEXT:
rectangular_lines: boolean,
bresenham_lines: boolean,
smooth_lines: boolean,
stippled_rectangular_lines: boolean,
stippled_bresenham_lines: boolean,
stippled_smooth_lines: boolean,
-- EXTENSION VkPhysicalDeviceShaderAtomicFloatFeaturesEXT:
shader_buffer_float32_atomics: boolean,
shader_buffer_float32_atomic_add: boolean,
shader_buffer_float64_atomics: boolean,
shader_buffer_float64_atomic_add: boolean,
shader_shared_float32_atomics: boolean,
shader_shared_float32_atomic_add: boolean,
shader_shared_float64_atomics: boolean,
shader_shared_float64_atomic_add: boolean,
shader_image_float32_atomics: boolean,
shader_image_float32_atomic_add: boolean,
sparse_image_float32_atomics: boolean,
sparse_image_float32_atomic_add: boolean,
-- EXTENSION VkPhysicalDeviceIndexTypeUint8FeaturesEXT:
index_type_uint8: boolean,
-- EXTENSION VkPhysicalDeviceExtendedDynamicStateFeaturesEXT:
extended_dynamic_state: boolean,
-- EXTENSION VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT:
shader_buffer_float16_atomics: boolean,
shader_buffer_float16_atomicAdd: boolean,
shader_buffer_float16_atomic_min_max: boolean,
shader_buffer_float32_atomic_min_max: boolean,
shader_buffer_float64_atomic_min_max: boolean,
shader_shared_float16_atomics: boolean,
shader_shared_float16_atomic_add: boolean,
shader_shared_float16_atomic_min_max: boolean,
shader_shared_float32_atomic_min_max: boolean,
shader_shared_float64_atomic_min_max: boolean,
shader_image_float32_atomic_min_max: boolean,
sparse_image_float32_atomic_min_max: boolean,
-- EXTENSION VkPhysicalDeviceDeviceMemoryReportFeaturesEXT:
device_memory_report: boolean,
-- EXTENSION VkPhysicalDeviceRobustness2FeaturesEXT:
robust_buffer_access2: boolean,
robust_image_access2: boolean,
null_descriptor: boolean,
-- EXTENSION VkPhysicalDeviceCustomBorderColorFeaturesEXT:
custom_border_colors: boolean,
custom_border_color_without_format: boolean,
-- EXTENSION VkPhysicalDevicePrivateDataFeaturesEXT:
private_data: boolean,
-- EXTENSION VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT:
pipeline_creation_cache_control: boolean,
-- EXTENSION VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT:
ycbcr_2plane_444_formats: boolean,
-- EXTENSION VkPhysicalDeviceFragmentDensityMap2FeaturesEXT:
fragment_density_map_deferred: boolean,
-- EXTENSION VkPhysicalDeviceImageRobustnessFeaturesEXT:
robust_image_access: boolean,
-- EXTENSION VkPhysicalDevice4444FormatsFeaturesEXT:
format_a4r4g4b4: boolean,
format_a4b4g4r4: boolean,
-- EXTENSION VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT:
vertex_input_dynamic_state: boolean,
-- EXTENSION VkPhysicalDeviceExtendedDynamicState2FeaturesEXT:
extended_dynamic_state2: boolean,
extended_dynamic_state2_logic_op: boolean,
extended_dynamic_state2_patch_control_points: boolean,
-- EXTENSION VkPhysicalDeviceColorWriteEnableFeaturesEXT:
color_write_enable: boolean,
-- EXTENSION VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT:
global_priority_query: boolean,
-- EXTENSION VkPhysicalDeviceMultiDrawFeaturesEXT:
multi_draw: boolean,
-- EXTENSION VkPhysicalDeviceDynamicRenderingFeaturesKHR:
dynamic_rendering: boolean,
-- EXTENSION VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR:
shader_integer_dot_product: boolean,
-- EXTENSION VkPhysicalDeviceMaintenance4FeaturesKHR:
maintenance4: boolean,
-- EXTENSION VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT:
format_rgba10x6_without_ycbcr_sampler: boolean,
-- EXTENSION VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT:
primitive_topology_list_restart: boolean,
primitive_topology_patch_list_restart: boolean,
-- EXTENSION VkPhysicalDeviceBorderColorSwizzleFeaturesEXT:
border_color_swizzle: boolean,
border_color_swizzle_from_image: boolean,
-- EXTENSION VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT:
pageable_device_local_memory: boolean,
} (rfr: VkPhysicalDeviceFeatures2) -
queuefamilyproperties = {
queue_family_index: index,
queue_flags: queueflags,
queue_count: integer,
timestamp_valid_bits: integer,
min_image_transfer_granularity: extent3d,
-- EXTENSION VkQueueFamilyGlobalPriorityPropertiesEXT:
priorities: {queueglobalpriority},
} (rfr: VkQueueFamilyProperties, VkQueueFamilyProperties2) -
physicaldevicememoryproperties = {
memory_types: {memorytype},
memory_heaps: {memoryheap},
} (rfr: VkPhysicalDeviceMemoryProperties) -
memorytype = {
memory_type_index: index,
property_flags: memorypropertyflags,
heap_index: index,
} (rfr: VkMemoryType) -
memoryheap = {
memory_heap_index: index,
size: integer,
flags: memoryheapflags,
} (rfr: VkMemoryHeap) -
formatproperties = {
linear_tiling_features: formatfeatureflags,
optimal_tiling_features: formatfeatureflags,
buffer_features: formatfeatureflags,
} (rfr: VkFormatProperties2, VkFormatProperties3KHR) -
imageformatproperties = {
max_extent: extent3d,
max_mip_levels: integer,
max_array_layers: integer,
sample_counts: integer,
max_resource_size: integer,
-- EXTENSION VkExternalImageFormatProperties:
external_memory_properties: externalmemoryproperties,
-- EXTENSION VkSamplerYcbcrConversionImageFormatProperties:
combined_image_sampler_descriptor_count: integer,
-- EXTENSION VkFilterCubicImageViewImageFormatPropertiesEXT:
filter_cubic: boolean,
filter_cubic_minmax: boolean,
} (rfr: VkImageFormatProperties, VkImageFormatProperties2) -
physicaldevicesparseimageformatinfo = {
format: format,
type: imagetype,
samples: samplecountflags,
usage: imageusageflags,
tiling: imagetiling,
} (rfr: VkPhysicalDeviceSparseImageFormatInfo2) -
sparseimageformatproperties = {
aspect_mask: imageaspectflags,
image_granularity: extent3d,
flags: sparseimageformatflags,
} (rfr: VkSparseImageFormatProperties) -
externalmemoryproperties = {
external_memory_features: externalmemoryfeatureflags,
export_from_imported_handle_types: externalmemoryhandletypeflags,
compatible_handle_types: externalmemoryhandletypeflags,
} (rfr: VkExternalMemoryProperties) -
physicaldeviceexternalbufferinfo = {
flags: buffercreateflags,
usage: bufferusageflags,
handle_type: externalmemoryhandletypeflags,
} (rfr: VkPhysicalDeviceExternalBufferInfo) -
externalbufferproperties = {
external_memory_properties: externalmemoryproperties,
} (rfr: VkExternalBufferProperties) -
physicaldeviceexternalfenceinfo = {
handle_type: externalfencehandletypeflags,
} (rfr: VkPhysicalDeviceExternalFenceInfo) -
externalfenceproperties = {
export_from_imported_handle_types: externalfencehandletypeflags,
compatible_handle_types: externalfencehandletypeflags,
external_fence_features: externalfencefeatureflags,
} (rfr: VkExternalFenceProperties) -
physicaldeviceexternalsemaphoreinfo = {
handle_type: externalsemaphorehandletypeflags,
-- EXTENSION VkSemaphoreTypeCreateInfo:
semaphore_type: semaphoretype,
initial_value: integer,
} (rfr: VkPhysicalDeviceExternalSemaphoreInfo) -
externalsemaphoreproperties = {
export_from_imported_handle_types: externalsemaphorehandletypeflags,
compatible_handle_types: externalsemaphorehandletypeflags,
external_semaphore_features: externalsemaphorefeatureflags,
} (rfr: VkExternalSemaphoreProperties)
-
multisampleproperties = {
max_sample_location_grid_size: extent2d,
} (rfr: VkMultisamplePropertiesEXT)
-
devicecreateinfo = {
flags: devicecreateflags,
queue_create_infos: {devicequeuecreateinfo} [R],
enabled_layer_names: {string} (DEPRECATED),
enabled_extension_names: {string},
enabled_features: {physicaldevicefeatures},
-- EXTENSION VkDeviceGroupDeviceCreateInfo:
physical_devices: {physical_device},
} (rfr: VkDeviceCreateInfo) -
devicequeuecreateinfo = {
flags: devicequeuecreateflags,
queue_family_index: index,
queue_priorities: {float} [R],
-- EXTENSION VkDeviceQueueGlobalPriorityCreateInfoEXT:
global_priority: queueglobalpriority,
} (rfr: VkDeviceQueueCreateInfo) -
devicequeueinfo = {
flags: devicequeuecreateflags,
queue_family_index: index,
queue_index: index,
} (rfr: VkDeviceQueueInfo2)
-
submitinfo = {
wait_semaphores: {semaphore},
wait_dst_stage_mask: {pipelinestageflags},
command_buffers: {command_buffer},
signal_semaphores: {semaphore},
-- EXTENSION VkProtectedSubmitInfo, Core 1.1:
protected_submit: boolean,
-- EXTENSION VkDeviceGroupSubmitInfo:
wait_semaphore_device_indices: {integer},
command_buffer_device_masks: {integer},
signal_semaphore_device_indices: {integer},
-- EXTENSION VkTimelineSemaphoreSubmitInfo:
wait_semaphore_values: {integer},
signal_semaphore_values: {integer},
-- EXTENSION VkPerformanceQuerySubmitInfoKHR:
counter_pass_index: integer,
} (rfr: VkSubmitInfo) -
submitinfo2 = {
flags: submitflags,
wait_semaphore_infos: {semaphoresubmitinfo},
command_buffer_infos: {commandbuffersubmitinfo},
signal_semaphore_infos: {semaphoresubmitinfo},
-- EXTENSION VkPerformanceQuerySubmitInfoKHR:
counter_pass_index: integer,
} (rfr: VkSubmitInfo2KHR) -
semaphoresubmitinfo = {
semaphore: semaphore,
value: integer,
stage_mask: pipelinestageflags,
device_index: integer,
} (rfr: VkSemaphoreSubmitInfoKHR) -
commandbuffersubmitinfo = {
command_buffer: command_buffer,
device_mask: integer,
} (rfr: VkCommandBufferSubmitInfoKHR)
-
bindsparseinfo = {
wait_semaphores: {semaphore},
buffer_binds: {sparsebuffermemorybindinfo},
image_opaque_binds: {sparseimageopaquememorybindinfo},
image_binds: {sparseimagememorybindinfo},
signal_semaphores: {semaphore},
-- EXTENSION VkDeviceGroupBindSparseInfo:
resource_device_index: integer,
memory_device_index: integer,
-- EXTENSION VkTimelineSemaphoreSubmitInfo:
wait_semaphore_values: {integer},
signal_semaphore_values: {integer},
} (rfr: VkBindSparseInfo) -
sparsebuffermemorybindinfo = {
buffer: buffer [R],
binds: {sparsememorybind} [R],
} (rfr: VkSparseBufferMemoryBindInfo) -
sparseimageopaquememorybindinfo = {
image: image [R],
binds: {sparsememorybind} [R],
} (rfr: VkSparseImageOpaqueMemoryBindInfo) -
sparsememorybind = {
resource_offset: integer,
size: integer,
memory: device_memory [R],
memory_offset: integer,
flags: sparsememorybindflags,
} (rfr: VkSparseMemoryBind) -
sparseimagememorybindinfo = {
image: image [R],
binds: {sparseimagememorybind} [R],
} (rfr: VkSparseImageMemoryBindInfo) -
sparseimagememorybind = {
subresource: imagesubresource [R],
offset: offset3d,
extent: extent3d,
memory: device_memory [R],
memory_offset: integer,
flags: sparseimagememorybindflags,
} (rfr: VkSparseImageMemoryBind)
-
commandpoolcreateinfo = {
flags: commandpoolcreateflags,
queue_family_index: index,
} (rfr: VkCommandPoolCreateInfo) -
commandbufferallocateinfo = {
level: commandbufferlevel [R],
command_buffer_count: integer,
} (rfr: VkCommandBufferAllocateInfo) -
commandbufferbegininfo = {
flags: commandbufferusageflags,
inheritance_info: commandbufferinheritanceinfo,
-- EXTENSION VkDeviceGroupCommandBufferBeginInfo:
device_mask: integer,
} (rfr: VkCommandBufferBeginInfo) -
commandbufferinheritanceinfo = {
render_pass: render_pass [R],
subpass: integer,
framebuffer: framebuffer [R],
occlusion_query_enable: boolean,
query_flags: querycontrolflags,
pipeline_statistics: querypipelinestatisticflags,
-- EXTENSION VkCommandBufferInheritanceConditionalRenderingInfoEXT:
conditional_rendering_enable: boolean,
-- EXTENSIONS:
rendering_info: commandbufferinheritancerenderinginfo,
} (rfr: VkCommandBufferInheritanceInfo) -
commandbufferinheritancerenderinginfo = {
flags: renderingflags,
view_mask: integer,
color_attachment_formats: {format},
depth_attachment_format: format,
stencil_attachment_format: format,
rasterization_samples: samplecountflags,
} (rfr: VkCommandBufferInheritanceRenderingInfoKHR)
-
fencecreateinfo = {
flags: fencecreateflags,
-- EXTENSION VkExportFenceCreateInfo:
handle_types: externalfencehandletypeflags,
} (rfr: VkFenceCreateInfo) -
deviceeventinfo = {
device_event: deviceeventtype,
} (rfr: VkDeviceEventInfoEXT) -
displayeventinfo = {
display_event: displayeventtype,
} (rfr: VkDisplayEventInfoEXT) -
importfencefdinfo = {
flags: fenceimportflags,
handle_type: externalfencehandletypeflagbits,
fd: integer,
} (rfr: VkImportFenceFdInfoKHR) -
fencegetfdinfo = {
handle_type: externalfencehandletypeflagbits,
} (rfr: VkFenceGetFdInfoKHR)
-
semaphorecreateinfo = {
flags: semaphorecreateflags,
-- EXTENSION VkExportSemaphoreCreateInfo:
handle_types: externalsemaphorehandletypeflags,
-- EXTENSION VkSemaphoreTypeCreateInfo:
semaphore_type: semaphoretype,
initial_value: integer,
} (rfr: VkSemaphoreCreateInfo) -
semaphorewaitinfo = {
flags: semaphorewaitflags,
semaphores: {semaphore},
values: {integer},
} (rfr: VkSemaphoreWaitInfo) -
semaphoresignalinfo = {
semaphore: semaphore,
value: integer,
} (rfr: VkSemaphoreSignalInfo) -
importsemaphorefdinfo = {
flags: semaphoreimportflags,
handle_type: externalsemaphorehandletypeflagbits,
fd: integer,
} (rfr: VkImportSemaphoreFdInfoKHR) -
semaphoregetfdinfo = {
handle_type: externalsemaphorehandletypeflagbits,
} (rfr: VkSemaphoreGetFdInfoKHR)
-
eventcreateinfo = {
flags: eventcreateflags,
} (rfr: VkEventCreateInfo)
-
renderpasscreateinfo = {
flags: renderpasscreateflags,
subpasses: {subpassdescription} [R],
attachments: {attachmentdescription},
dependencies: {subpassdependency},
-- EXTENSION VkRenderPassInputAttachmentAspectCreateInfo:
input_attachment_aspect_references: {inputattachmentaspectreference},
-- EXTENSION VkRenderPassMultiviewCreateInfo:
view_masks: {integer},
view_offsets: {integer},
correlation_masks: {integer},
-- EXTENSION VkRenderPassFragmentDensityMapCreateInfoEXT:
fragment_density_map_attachment: attachmentreference,
} (rfr: VkRenderPassCreateInfo) -
renderpasscreateinfo2 = {
flags: renderpasscreateflags,
subpasses: {subpassdescription} [R],
attachments: {attachmentdescription},
dependencies: {subpassdependency},
correlated_view_masks: {integer},
-- EXTENSION VkRenderPassFragmentDensityMapCreateInfoEXT:
fragment_density_map_attachment: attachmentreference,
} (rfr: VkRenderPassCreateInfo2) -
attachmentdescription = {
flags: attachmentdescriptionflags,
format: format,
samples: samplecountflags (defaults to 1),
load_op: attachmentloadop,
store_op: attachmentstoreop,
stencil_load_op: attachmentloadop,
stencil_store_op: attachmentstoreop,
initial_layout: imagelayout,
final_layout: imagelayout,
-- EXTENSION VkAttachmentDescriptionStencilLayout:
stencil_initial_layout: imagelayout,
stencil_final_layout: imagelayout,
} (rfr: VkAttachmentDescription, VkAttachmentDescription2) -
subpassdescription = {
flags: subpassdescriptionflags,
pipeline_bind_point: pipelinebindpoint,
input_attachments: {attachmentreference},
color_attachments: {attachmentreference},
resolve_attachments: {attachmentreference},
depth_stencil_attachment: attachmentreference,
preserve_attachments: {integer},
view_mask: {integer} (2KHR only),
-- EXTENSION VkSubpassDescriptionDepthStencilResolve:
depth_resolve_mode: resolvemodeflags,
stencil_resolve_mode: resolvemodeflags,
depth_stencil_resolve_attachment: attachmentreference,
-- EXTENSION VkFragmentShadingRateAttachmentInfoKHR:
fragment_shading_rate_attachment: attachmentreference,
shading_rate_attachment_texel_size: extent2d,
} (rfr: VkSubpassDescription, VkSubpassDescription2) -
attachmentreference = {
attachment: integer or 'unused' (defaults to 'unused'),
layout: imagelayout [R],
aspect_mask: imageaspectflags (2KHR only),
-- EXTENSION VkAttachmentReferenceStencilLayout:
stencil_layout: imagelayout,
} (rfr: VkAttachmentReference, VkAttachmentReference2) -
subpassdependency = {
src_subpass: integer or 'external',
dst_subpass: integer or 'external',
src_stage_mask: pipelinestageflags,
dst_stage_mask: pipelinestageflags,
src_access_mask: accessflags,
dst_access_mask: accessflags,
dependency_flags: dependencyflags,
view_offset: integer (2KHR only),
-- EXTENSION VkMemoryBarrier2KHR:
memory_barrier2: memorybarrier2,
} (rfr: VkSubpassDependency, VkSubpassDependency2) -
inputattachmentaspectreference = {
subpass: integer,
input_attachment_index: index,
aspect_mask: imageaspectflags,
} (rfr: VkInputAttachmentAspectReference)
-
framebuffercreateinfo = {
flags: framebuffercreateflags,
render_pass: render_pass [R],
width: integer,
height: integer,
layers: integer (defaults to 1),
attachments: {image_view},
-- EXTENSION VkFramebufferAttachmentsCreateInfo:
attachment_image_infos: {framebufferattachmentimageinfo},
} (rfr: VkFramebufferCreateInfo) -
framebufferattachmentimageinfo = {
flags: imagecreateflags,
usage: imageusageflags,
width: integer,
height: integer,
layer_count: integer,
view_formats: {format},
} (rfr: VkFramebufferAttachmentImageInfo)
-
shadermodulecreateinfo = {
flags: shadermodulecreateflags,
code: binary string [R],
-- EXTENSION VkShaderModuleValidationCacheCreateInfoEXT:
validation_cache: validation_cache,
} (rfr: VkShaderModuleCreateInfo)
-
pipelinecachecreateinfo = {
flags: pipelinecachecreateflags,
initial_data: binary string,
} (rfr: VkPipelineCacheCreateInfo)
-
validationcachecreateinfo = {
flags: validationcachecreateflags,
initial_data: binary string,
} (rfr: VkValidationCacheCreateInfoEXT)
-
buffercreateinfo = {
flags: buffercreateflags,
size: integer
usage: bufferusageflags,
sharing_mode: sharingmode,
queue_family_indices: {index},
-- EXTENSION VkExternalMemoryBufferCreateInfo:
handle_types: externalmemoryhandletypeflags,
-- EXTENSION VkBufferOpaqueCaptureAddressCreateInfo:
opaque_capture_address: integer,
} (rfr: VkBufferCreateInfo) -
bufferviewcreateinfo = {
flags: bufferviewcreateflags,
format: format,
offset: integer,
range: integer,
} (rfr: VkBufferViewCreateInfo)
-
imagecreateinfo = {
flags: imagecreateflags,
image_type: imagetype,
format: format,
extent: extent3d,
mip_levels: integer (defaults to 1),
array_layers: integer (defaults to 1),
samples: samplecountflags (defaults to 1),
tiling: imagetiling,
usage: imageusageflags,
initial_layout: imagelayout,
sharing_mode: sharingmode,
queue_family_indices: {index},
-- EXTENSION VkExternalMemoryImageCreateInfo:
handle_types: externalmemoryhandletypeflags,
-- EXTENSION VkImageFormatListCreateInfo:
view_formats: {format},
-- EXTENSION VkImageSwapchainCreateInfoKHR:
swapchain: swapchain,
-- EXTENSION VkImageStencilUsageCreateInfo:
stencil_usage: imageusageflags,
} (rfr: VkImageCreateInfo) -
imageviewcreateinfo = {
flags: imageviewcreateflags,
view_type: imageviewtype [R],
format: format,
components: componentmapping,
subresource_range: imagesubresourcerange,
-- EXTENSION VkImageViewUsageCreateInfo:
usage: imageusageflags,
-- EXTENSION VkImageViewASTCDecodeModeEXT:
decode_mode: format,
} (rfr: VkImageViewCreateInfo)
-
samplercreateinfo = {
flags: samplercreateflags,
mag_filter: filter,
min_filter: filter,
mipmap_mode: samplermipmapmode,
address_mode_u: sampleraddressmode,
address_mode_v: sampleraddressmode,
address_mode_w: sampleraddressmode,
mip_lod_bias: float,
anisotropy_enable: boolean,
max_anisotropy: float,
compare_enable: boolean,
compare_op: compareop,
min_lod: float,
max_lod: float,
border_color: bordercolor,
unnormalized_coordinates: boolean,
-- EXTENSION VkSamplerReductionModeCreateInfo:
reduction_mode: samplerreductionmode,
-- EXTENSION VkSamplerYcbcrConversionInfo:
conversion: sampler_ycbcr_conversion,
-- EXTENSION VkSamplerCustomBorderColorCreateInfoEXT:
custom_border_color: clearcolorvalue,
custom_border_color_format: format,
-- EXTENSION VkSamplerBorderColorComponentMappingCreateInfoEXT:
components: componentmapping,
srgb: boolean,
} (rfr: VkSamplerCreateInfo) -
samplerycbcrconversioncreateinfo = {
format: format,
ycbcr_model: samplerycbcrmodelconversion,
ycbcr_range: samplerycbcrrange,
components: componentmapping,
x_chroma_offset: chromalocation,
y_chroma_offset: chromalocation,
chroma_filter: filter,
force_explicit_reconstruction: boolean,
} (rfr: VkSamplerYcbcrConversionCreateInfo)
-
mappedmemoryrange = {
memory: device_memory [R],
offset: integer,
size: integer or 'whole size' (defaults to 'whole size'),
} (rfr: VkMappedMemoryRange)
-
memoryallocateinfo = {
allocation_size: integer,
memory_type_index: index,
-- EXTENSION VkMemoryDedicatedAllocateInfo:
image: image,
buffer: buffer,
-- EXTENSION VkExportMemoryAllocateInfo:
handle_types: externalmemoryhandletypeflags,
-- EXTENSION VkImportMemoryFdInfoKHR:
fd_handle_type: externalmemoryhandletypeflags,
fd: integer,
-- EXTENSION VkImportMemoryHostPointerInfoEXT:
host_pointer_handle_type: externalmemoryhandletypeflags,
host_pointer: lightuserdata,
-- EXTENSION VkMemoryAllocateFlagsInfo:
device_mask integer,
-- EXTENSION VkMemoryOpaqueCaptureAddressAllocateInfo:
opaque_capture_address: integer,
-- EXTENSION VkMemoryPriorityAllocateInfoEXT:
priority: float,
} (rfr: VkMemoryAllocateInfo) -
memorygetfdinfo = {
handle_type: externalmemoryhandletypeflags,
} (rfr: VkMemoryGetFdInfoKHR) -
memoryfdproperties = {
memory_type_bits: integer,
} (rfr: VkMemoryFdPropertiesKHR) -
memoryhostpointerproperties = {
memory_type_bits: integer,
} (rfr: VkMemoryHostPointerPropertiesEXT)
-
buffermemoryrequirementsinfo = {
-- for future use,
} (rfr: VkBufferMemoryRequirementsInfo2) -
imagememoryrequirementsinfo = {
-- EXTENSION VkImagePlaneMemoryRequirementsInfo:
plane_aspect: imageaspectflags,
} (rfr: VkImageMemoryRequirementsInfo2) -
imagesparsememoryrequirementsinfo = {
-- for future use,
} (rfr: VkImageSparseMemoryRequirementsInfo2) -
devicebuffermemoryrequirements = {
create_info: buffercreateinfo,
} (rfr: VkDeviceBufferMemoryRequirementsKHR) -
deviceimagememoryrequirements = {
create_info: imagecreateinfo,
plane_aspect: imageaspectflagbits,
} (rfr: VkDeviceImageMemoryRequirementsKHR)
-
memoryrequirements = {
size: integer,
alignment: integer,
memory_type_bits: integer,
-- EXTENSION VkMemoryDedicatedRequirements:
prefers_dedicated_allocation: boolean,
requires_dedicated_allocation: boolean,
} (rfr: VkMemoryRequirements2) -
sparseimagememoryrequirements = {
format_properties: sparseimageformatproperties,
image_mip_tail_first_lod: integer,
image_mip_tail_size: integer,
image_mip_tail_offset: integer,
image_mip_tail_stride: integer,
} (rfr: VkSparseImageMemoryRequirements2) -
subresourcelayout = {
offset: integer,
size: integer,
row_pitch: integer,
array_pitch: integer,
depth_pitch: integer,
} (rfr: VkSubresourceLayout) -
imagesubresource = {
aspect_mask: imageaspectflags,
mip_level: integer,
array_layer: integer,
} (rfr: VkImageSubresource)
Constructor: imagesubresource(aspect_mask, mip_level, array_layer) -
imagesubresourcerange = {
aspect_mask: imageaspectflags,
base_mip_level: integer,
level_count: integer or 'remaining' (defaults to 1),
base_array_layer: integer,
layer_count: integer or 'remaining' (defaults to 1),
} (rfr: VkImageSubresourceRange)
Constructor: imagesubresourcerange(aspect_mask, base_mip_level, level_count, base_array_layer, layer_count)
-
bindbuffermemoryinfo = {
buffer: buffer [R],
memory: device_memory [R],
offset: integer,
-- EXTENSION VkBindBufferMemoryDeviceGroupInfo:
device_indices: {integer},
} (rfr: VkBindBufferMemoryInfo) -
bindimagememoryinfo = {
image: image [R],
memory: device_memory [R],
offset: integer,
-- EXTENSION VkBindImagePlaneMemoryInfo:
plane_aspect: imageaspectflags:
-- EXTENSION VkBindImageMemoryDeviceGroupInfo:
device_indices: {integer},
split_instance_bind_regions:, {rect2d},
-- EXTENSION VkBindImageMemorySwapchainInfoKHR:
swapchain: swapchain,
image_index: integer,
} (rfr: VkBindImageMemoryInfo)
-
descriptorsetlayoutcreateinfo = {
flags: descriptorsetlayoutcreateflags,
bindings: {descriptorsetlayoutbinding},
-- EXTENSION VkDescriptorSetLayoutBindingFlagsCreateInfo:
binding_flags: {descriptorbindingflags},
} (rfr: VkDescriptorSetLayoutCreateInfo) -
descriptorsetlayoutsupport = {
supported: boolean,
-- EXTENSION VkDescriptorSetVariableDescriptorCountLayoutSupport:
max_variable_descriptor_count: integer,
} (rfr: VkDescriptorSetLayoutSupport) -
descriptorsetlayoutbinding = {
binding: integer,
descriptor_type: descriptortype [R],
descriptor_count: integer,
stage_flags: shaderstageflags,
immutable_samplers: {sampler},
} (rfr: VkDescriptorSetLayoutBinding)
Constructor: descriptorsetlayoutbinding(binding, descriptor_type, descriptor_count, stage_flags, {immutable_samplers})
-
pipelinelayoutcreateinfo = {
flags: pipelinelayoutcreateflags,
set_layouts: {descriptor_set_layout},
push_constant_ranges: {pushconstantrange},
} (rfr: VkPipelineLayoutCreateInfo) -
pushconstantrange = {
stage_flags: shaderstageflags,
offset: integer,
size: integer,
} (rfr: VkPushConstantRange)
Constructor: pushconstantrange(stage_flags, offset, size)
-
descriptorpoolcreateinfo = {
flags: descriptorpoolcreateflags,
max_sets: integer,
pool_sizes: {descriptorpoolsize}, [R]
-- EXTENSION VkDescriptorPoolInlineUniformBlockCreateInfoEXT:
max_inline_uniform_block_bindings: integer,
} (rfr: VkDescriptorPoolCreateInfo) -
descriptorpoolsize = {
type: descriptortype [R],
descriptor_count: integer (defaults to 1),
} (rfr: VkDescriptorPoolSize)
-
descriptorsetallocateinfo = {
set_layouts: {descriptor_set_layout},
-- EXTENSION VkDescriptorSetVariableDescriptorCountAllocateInfo:
descriptor_counts: {integer},
} (rfr: VkDescriptorSetAllocateInfo)
-
descriptorimageinfo = {
sampler: sampler [R],
image_view: image_view [R],
image_layout: imagelayout,
} (rfr: VkDescriptorImageInfo) -
descriptorbufferinfo = {
buffer: buffer [R],
offset: integer,
range: integer or 'whole size' (defaults to 'whole size'),
} (rfr: VkDescriptorBufferInfo) -
writedescriptorset = {
dst_set: descriptor_set [R],
dst_binding: integer,
dst_array_element: integer,
descriptor_type: descriptortype [R],
image_info: {descriptorimageinfo},
buffer_info: {descriptorbufferinfo},
texel_buffer_view: {buffer_view},
-- EXTENSION VkWriteDescriptorSetInlineUniformBlockEXT:
inline_uniform_block_data: binary string,
} (rfr: VkWriteDescriptorSet) -
copydescriptorset = {
src_set: descriptor_set [R],
src_binding: integer,
src_array_element: integer,
dst_set: descriptor_set [R],
dst_binding: integer,
dst_array_element: integer,
descriptor_count: integer,
} (rfr: VkCopyDescriptorSet)
-
querypoolcreateinfo = {
flags: querypoolcreateflags,
query_type: querytype [R],
query_count: integer,
pipeline_statistics: querypipelinestatisticflags,
-- EXTENSIONS:
query_pool_performance_info: querypoolperformancecreateinfo,
} (rfr: VkQueryPoolCreateInfo) -
querypoolperformancecreateinfo = {
queue_family_index: integer,
counter_indices: {integer},
} (rfr: VkQueryPoolPerformanceCreateInfoKHR) -
performancecounter = {
unit: performancecounterunit,
scope: performancecounterscope,
storage: performancecounterstorage,
uuid: binary string,
} (rfr: VkPerformanceCounterKHR) -
performancecounterdescription = {
flags: performancecounterdescriptionflags,
name: string,
category: string,
description: string,
} (rfr: VkPerformanceCounterDescriptionKHR) -
acquireprofilinglockinfo = {
flags: acquireprofilinglockflags,
timeout: integer,
} (rfr: VkAcquireProfilingLockInfoKHR)
-
graphicspipelinecreateinfo = {
flags: pipelinecreateflags,
stages: {pipelineshaderstagecreateinfo} [R],
vertex_input_state: pipelinevertexinputstatecreateinfo [R],
input_assembly_state: pipelineinputassemblystatecreateinfo [R],
tessellation_state: pipelinetessellationstatecreateinfo,
viewport_state: pipelineviewportstatecreateinfo,
rasterization_state: pipelinerasterizationstatecreateinfo [R],
multisample_state: pipelinemultisamplestatecreateinfo,
depth_stencil_state: pipelinedepthstencilstatecreateinfo,
color_blend_state: pipelinecolorblendstatecreateinfo,
dynamic_state: pipelinedynamicstatecreateinfo,
layout: pipeline_layout [R],
render_pass: render_pass [R],
subpass: integer,
base_pipeline_handle: pipeline,
base_pipeline_index: index,
-- EXTENSIONS:
discard_rectangle_state pipelinediscardrectanglestatecreateinfo,
creation_feedback_state pipelinecreationfeedbackcreateinfo,
fragment_shading_rate_state: pipelinefragmentshadingratestatecreateinfo,
rendering_state: pipelinerenderingcreateinfo,
} (rfr: VkGraphicsPipelineCreateInfo). -
computepipelinecreateinfo = {
flags: pipelinecreateflags,
stage: pipelineshaderstagecreateinfo [R],
layout: pipeline_layout [R],
base_pipeline_handle: pipeline,
base_pipeline_index: index,
-- EXTENSIONS:
creation_feedback_state pipelinecreationfeedbackcreateinfo,
} (rfr: VkComputePipelineCreateInfo) -
pipelineshaderstagecreateinfo = {
flags: pipelineshaderstagecreateflags,
stage: shaderstageflags,
module: shader_module [R],
name: string (defaults to 'main'),
specialization_info: specializationinfo,
-- EXTENSION VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT:
required_subgroup_size: integer,
} (rfr: VkPipelineShaderStageCreateInfo) -
specializationinfo = {
map_entries: {specializationmapentry},
data: binary string [R],
} (rfr: VkSpecializationInfo) -
specializationmapentry = {
constant_id: integer,
offset: integer,
size: integer,
} (rfr: VkSpecializationMapEntry) -
pipelinevertexinputstatecreateinfo = {
flags: pipelinevertexinputstatecreateflags,
vertex_binding_descriptions: {vertexinputbindingdescription},
vertex_attribute_descriptions: {vertexinputattributedescription},
-- EXTENSION VkPipelineVertexInputDivisorStateCreateInfoEXT:
vertex_binding_divisors: {vertexinputbindingdivisordescription},
} (rfr: VkPipelineVertexInputStateCreateInfo) -
vertexinputbindingdescription = {
binding: integer,
stride: integer,
input_rate: vertexinputrate,
} (rfr: VkVertexInputBindingDescription) -
vertexinputbindingdescription2 = {
binding: integer,
stride: integer,
input_rate: vertexinputrate,
divisor: integer,
} (rfr: VkVertexInputBindingDescription2EXT) -
vertexinputattributedescription = {
binding: integer,
location: integer,
format: format,
offset: integer,
} (rfr: VkVertexInputAttributeDescription) -
vertexinputattributedescription2 = {
binding: integer,
location: integer,
format: format,
offset: integer,
} (rfr: VkVertexInputAttributeDescription2EXT) -
vertexinputbindingdivisordescription = {
binding: integer,
divisor: integer,
} (rfr: VkVertexInputBindingDivisorDescriptionEXT) -
pipelineinputassemblystatecreateinfo = {
flags: pipelineinputassemblystatecreateflags,
topology: primitivetopology,
primitive_restart_enable: boolean,
} (rfr: VkPipelineInputAssemblyStateCreateInfo) -
pipelinetessellationstatecreateinfo = {
flags: pipelinetessellationstatecreateflags,
patch_control_points: integer,
-- EXTENSION VkPipelineTessellationDomainOriginStateCreateInfo:
domain_origin: tessellationdomainorigin,
} (rfr: VkPipelineTessellationStateCreateInfo) -
pipelineviewportstatecreateinfo = {
flags: pipelineviewportstatecreateflags,
viewports: {viewport},
scissors: {rect2d},
viewport_count: integer (forced to #viewports, if given, or defaults to 1),
scissor_count: integer (forced to #scissors, if given, or defaults to 1),
} (rfr: VkPipelineViewportStateCreateInfo) -
pipelinerasterizationstatecreateinfo = {
flags: pipelinerasterizationstatecreateflags,
depth_clamp_enable: boolean,
rasterizer_discard_enable: boolean,
polygon_mode: polygonmode,
cull_mode: cullmodeflags,
front_face: frontface,
depth_bias_enable: boolean,
depth_bias_constant_factor: float,
depth_bias_clamp: float,
depth_bias_slope_factor: float,
line_width: float (defaults to 1.0),
-- EXTENSION VkPipelineRasterizationConservativeStateCreateInfoEXT:
conservative_rasterization_create_flags: pipelinerasterizationconservativestatecreateflags,
conservative_rasterization_mode: conservativerasterizationmode,
extra_primitive_overestimation_size: float,
-- EXTENSION VkPipelineRasterizationStateStreamCreateInfoEXT:
rasterization_stream_create_flags: pipelinerasterizationstatestreamcreateflags,
rasterization_stream: integer,
-- EXTENSION VkPipelineRasterizationDepthClipStateCreateInfoEXT:
depth_clip_create_flags: pipelinerasterizationdepthclipstatecreateflags,
depth_clip_enable: boolean,
-- EXTENSION VkPipelineRasterizationProvokingVertexStateCreateInfoEXT:
provoking_vertex_mode: provokingvertexmode,
-- EXTENSION VkPipelineRasterizationLineStateCreateInfoEXT:
line_rasterization_mode: linerasterizationmode,
stippled_line_enable: boolean,
line_stipple_factor: integer,
line_stipple_pattern: integer,
} (rfr: VkPipelineRasterizationStateCreateInfo) -
pipelinemultisamplestatecreateinfo = {
flags: pipelinemultisamplestatecreateflags,
rasterization_samples: samplecountflags (defaults to 1),
sample_shading_enable: boolean,
min_sample_shading: float,
alpha_to_coverage_enable: boolean,
alpha_to_one_enable: boolean,
sample_mask: {integer},
-- EXTENSION VkPipelineSampleLocationsStateCreateInfoEXT:
sample_locations_enable: boolean,
sample_locations_info: samplelocationsinfo,
} (rfr: VkPipelineMultisampleStateCreateInfo) -
pipelinedepthstencilstatecreateinfo = {
flags: pipelinedepthstencilstatecreateflags,
depth_test_enable: boolean,
depth_write_enable: boolean,
depth_compare_op: compareop,
depth_bounds_test_enable: boolean,
stencil_test_enable: boolean,
front: stencilopstate,
back: stencilopstate,
min_depth_bounds: float,
max_depth_bounds: float,
} (rfr: VkPipelineDepthStencilStateCreateInfo) -
stencilopstate = {
fail_op: stencilop,
pass_op: stencilop,
depth_fail_op: stencilop,
compare_op: compareop,
compare_mask: integer,
write_mask: integer,
reference: integer,
} (rfr: VkStencilOpState) -
pipelinecolorblendstatecreateinfo = {
flags: pipelinecolorblendstatecreateflags,
logic_op_enable: boolean,
logic_op: logicop,
attachments: {pipelinecolorblendattachmentstate},
blend_constants: {float}[4],
-- EXTENSION VkPipelineColorBlendAdvancedStateCreateInfoEXT:
src_premultiplied: boolean,
dst_premultiplied: boolean,
blend_overlap: blendoverlap,
-- EXTENSION VkPipelineColorWriteCreateInfoEXT:
color_write_enables: {boolean},
} (rfr: VkPipelineColorBlendStateCreateInfo) -
pipelinecolorblendattachmentstate = {
blend_enable: boolean,
src_color_blend_factor: blendfactor,
dst_color_blend_factor: blendfactor,
color_blend_op: blendop,
src_alpha_blend_factor: blendfactor,
dst_alpha_blend_factor: blendfactor,
alpha_blend_op: blendop,
color_write_mask: colorcomponentflags,
} (rfr: VkPipelineColorBlendAttachmentState) -
pipelinedynamicstatecreateinfo = {
flags: pipelinedynamicstatecreateflags,
dynamic_states: {dynamicstate} [R],
} (rfr: VkPipelineDynamicStateCreateInfo) -
pipelinediscardrectanglestatecreateinfo = {
flags: discardrectanglestatecreateflags,
discard_rectangle_mode: discardrectanglemode [R],
discard_rectangles: {rect2d},
} (rfr: VkPipelineDiscardRectangleStateCreateInfoEXT) -
pipelinecreationfeedbackcreateinfo = {
pipeline_creation_feedback: pipelinecreationfeedback,
pipeline_stage_creation_feedbacks: {pipelinecreationfeedback},
} (rfr: VkPipelineCreationFeedbackCreateInfoEXT) -
pipelinecreationfeedback = {
flags: pipelinecreationfeedbackflags,
duration: integer,
} (rfr: VkPipelineCreationFeedbackEXT) -
pipelinefragmentshadingratestatecreateinfo = {
fragment_size: extent2d,
combiner_ops: {fragmentshadingratecombinerop}[2],
} (rfr: VkPipelineFragmentShadingRateStateCreateInfoKHR) -
pipelinerenderingcreateinfo = {
view_mask: integer,
color_attachments: {renderingattachmentinfo},
depth_attachment: renderingattachmentinfo,
stencil_attachment: renderingattachmentinfo,
} (rfr: VkPipelineRenderingCreateInfoKHR)
-
pipelineinfo = {
-- for future use,
} (rfr: VkPipelineInfoKHR) -
pipelineexecutableinfo = {
executable_index: integer,
} (rfr: VkPipelineExecutableInfoKHR) -
pipelineexecutableproperties = {
stages: shaderstageflags,
name: string,
description: string,
subgroup_size: integer,
} (rfr: VkPipelineExecutablePropertiesKHR) -
pipelineexecutablestatistic = {
name: string,
description: string,
format: pipelineexecutablestatisticformat,
value: boolean | integer | float,
} (rfr: VkPipelineExecutableStatisticKHR) -
pipelineexecutableinternalrepresentation = {
name: string,
description: string,
is_text: boolean,
data: string | binary string,
} (rfr: VkPipelineExecutableInternalRepresentationKHR)
-
copybufferinfo = {
src_buffer: buffer,
dst_buffer: buffer,
regions: {buffercopy},
} (rfr: VkCopyBufferInfo2KHR) -
buffercopy = {
src_offset: integer,
dst_offset: integer,
size: integer,
} (rfr: VkBufferCopy2KHR) -
copyimageinfo = {
src_image: image,
src_image_layout: imagelayout,
dst_image: image,
dst_image_layout: imagelayout,
regions: {imagecopy},
} (rfr: VkCopyImageInfo2KHR) -
imagecopy = {
src_subresource: imagesubresourcelayers [R],
dst_subresource: imagesubresourcelayers [R],
src_offset: offset3d,
dst_offset: offset3d,
extent: extent3d,
} (rfr: VkImageCopy2KHR) -
copybuffertoimageinfo = {
src_buffer: buffer,
dst_image: image,
dst_image_layout: imagelayout,
regions: {bufferimagecopy},
} (rfr: VkCopyBufferToImageInfo2KHR) -
copyimagetobufferinfo = {
src_image: image,
src_image_layout: imagelayout,
dst_buffer: buffer,
regions: {bufferimagecopy},
} (rfr: VkCopyImageToBufferInfo2KHR) -
bufferimagecopy = {
buffer_offset: integer,
buffer_row_length: integer,
buffer_image_height: integer,
image_subresource: imagesubresourcelayers [R],
image_offset: offset3d,
image_extent: extent3d,
} (rfr: VkBufferImageCopy2KHR) -
blitimageinfo = {
src_image: image,
src_image_layout: imagelayout,
dst_image: image,
dst_image_layout: imagelayout,
regions: {imageblit},
filter: filter,
} (rfr: VkBlitImageInfo2KHR) -
imageblit = {
src_subresource: imagesubresourcelayers [R],
dst_subresource: imagesubresourcelayers [R],
src_offsets: {offset3d}[2],
dst_offsets: {offset3d}[2],
} (rfr: VkImageBlit2KHR) -
imagesubresourcelayers = {
aspect_flags: imageaspectflags,
mip_level: integer,
base_array_layer: integer,
layer_count: integer,
} (rfr: VkImageSubresourceLayers)
Constructor: imagesubresourcelayers(aspect_mask, mip_level, base_array_layer, layer_count) -
resolveimageinfo = {
src_image: image,
src_image_layout: imagelayout,
dst_image: image,
dst_image_layout: imagelayout,
regions: {imageresolve},
} (rfr: VkResolveImageInfo2KHR) -
imageresolve = {
src_subresource: imagesubresourcelayers [R],
dst_subresource: imagesubresourcelayers [R],
src_offset: offset3d,
dst_offset: offset3d,
extent: extent3d,
} (rfr: VkImageResolve2KHR)
-
dependencyinfo = {
dependency_flags: dependencyflags,
memory_barriers: {memorybarrier2},
buffer_memory_barriers: {buffermemorybarrier2},
image_memory_barriers: {imagememorybarrier2},
} (rfr: VkDependencyInfoKHR) -
memorybarrier = {
src_access_mask: accessflags,
dst_access_mask: accessflags,
} (rfr: VkMemoryBarrier) -
memorybarrier2 = {
src_stage_mask: pipelinestageflags,
dst_stage_mask: pipelinestageflags,
src_access_mask: accessflags,
dst_access_mask: accessflags,
} (rfr: VkMemoryBarrier2KHR) -
buffermemorybarrier = {
src_access_mask: accessflags,
dst_access_mask: accessflags,
src_queue_family_index: index (default: ignored),
dst_queue_family_index: index (default: ignored),
buffer: buffer [R],
offset: integer,
size: integer,
} (rfr: VkBufferMemoryBarrier) -
buffermemorybarrier2 = {
src_stage_mask: pipelinestageflags,
dst_stage_mask: pipelinestageflags,
src_access_mask: accessflags,
dst_access_mask: accessflags,
src_queue_family_index: index (default: ignored),
dst_queue_family_index: index (default: ignored),
buffer: buffer [R],
offset: integer,
size: integer,
} (rfr: VkBufferMemoryBarrier2KHR) -
imagememorybarrier = {
src_access_mask: accessflags,
dst_access_mask: accessflags,
src_queue_family_index: index (default: ignored),
dst_queue_family_index: index (default: ignored),
old_layout: imagelayout,
new_layout: imagelayout,
image: image,
subresource_range: imagesubresourcerange,
} (rfr: VkImageMemoryBarrier) -
imagememorybarrier2 = {
src_stage_mask: pipelinestageflags,
dst_stage_mask: pipelinestageflags,
src_access_mask: accessflags,
dst_access_mask: accessflags,
src_queue_family_index: index (default: ignored),
dst_queue_family_index: index (default: ignored),
old_layout: imagelayout,
new_layout: imagelayout,
image: image,
subresource_range: imagesubresourcerange,
} (rfr: VkImageMemoryBarrier2KHR)
-
viewport = { x, y, width, height, min_depth, max_depth: float }
(rfr: VkViewport)
Constructor: viewport(x, y, width, height, min_depth, max_depth) -
offset2d = { x, y: integer }
(rfr: VkOffset2D)
Constructor: offset2d(x, y) -
offset3d = { x, y, z: integer }
(rfr: VkOffset3D)
Constructor: offset3d(x, y, z) -
extent2d = { width, height: integer }
(rfr: VkExtent2D)
Constructor: extent2d(width, height) -
extent3d = { width, height, depth: integer }
(rfr: VkExtent3D)
Constructor: extent3d(width, height, depth) -
rect2d = { offset: offset2d, extent: extent2d }
(rfr: VkRect2D)
Constructor: rect2d(x, y, width, height) -
samplelocation = { x, y: float }
(rfr: VkSampleLocationEXT) -
componentmapping = { r, g, b, a: componentswizzle }
(rfr: VkComponentMapping)
Constructor: componentmapping(r, g, b, a) -
clearcolorvalue =
{ [1],[2],[3],[4]: float } or
{ [1],[2],[3],[4]: float, t='float32' } or
{ [1],[2],[3],[4]: integer, t='uint32' } or
{ [1],[2],[3],[4]: integer, t='int32' }
(rfr: VkClearColorValue) -
clearvalue =
{ color: clearcolorvalue } or
{ depth: float, stencil: integer, }
(rfr: VkClearValue).
See also the example in the code snippets section. -
clearattachment = {
aspect_mask: imageaspectmask,
color_attachment: integer or 'unused' (defaults to 'unused'),
clear_value: clearvalue,
} (rfr: VkClearAttachment) -
clearrect = {
rect: rect2d,
base_array_layer: integer,
layer_count: integer,
} (rfr: VkClearRect) -
renderpassbegininfo = {
render_pass: render_pass [R],
framebuffer: framebuffer [R],
render_area: rect2d,
clear_values: {clearvalue},
-- EXTENSION VkRenderPassSampleLocationsBeginInfoEXT:
attachment_initial_sample_locations_count: {attachmentsamplelocations},
post_subpass_sample_locations_count: {subpasssamplelocations},
-- EXTENSION VkDeviceGroupRenderPassBeginInfo:
device_mask: integer,
device_render_areas: {rect2d},
-- EXTENSION VkRenderPassAttachmentBeginInfo:
attachments: {image_view},
} (rfr: VkRenderPassBeginInfo) -
subpassbegininfo = {
contents: subpasscontents [R},
} (rfr: VkSubpassBeginInfo) -
subpassendinfo = {
-- for future extensions
} (rfr: VkSubpassEndInfo) -
attachmentsamplelocations = {
attachment_index: index,
sample_locations_info, samplelocationsinfo,
} (rfr: VkAttachmentSampleLocationsEXT) -
subpasssamplelocations = {
subpass_index: index,
sample_locations_info, samplelocationsinfo,
} (rfr: VkSubpassSampleLocationsEXT) -
samplelocationsinfo = {
sample_locations_per_pixel: samplecountflags,
sample_location_grid_size: extent2d [R],
sample_locations: {samplelocation} [R],
} (rfr: VkSampleLocationsInfoEXT)
-
renderinginfo = {
flags: renderingflags,
render_area: rect2d,
layer_count: integer,
view_mask: integer,
color_attachments: {renderingattachmentinfo},
depth_attachment: renderingattachmentinfo,
stencil_attachment: renderingattachmentinfo,
-- EXTENSIONS:
fragment_shading_rate: renderingfragmentshadingrateattachmentinfo,
fragment_density_map: renderingfragmentdensitymapattachmentinfo,
} (rfr: VkRenderingInfoKHR) -
renderingattachmentinfo = {
image_view: image_view,
image_layout: imagelayout,
resolve_mode: resolvemodeflags,
resolve_image_view: image_view,
resolve_image_layout: imagelayout,
load_op: attachmentloadop,
store_op: attachmentstoreop,
clear_value: clearvalue,
} (rfr: VkRenderingAttachmentInfoKHR) -
renderingfragmentshadingrateattachmentinfo = {
image_view: image_view,
image_layout: imagelayout,
texel_size: extent2d,
} (rfr: VkRenderingFragmentShadingRateAttachmentInfoKHR) -
renderingfragmentdensitymapattachmentinfo = {
image_view: image_view,
image_layout: imagelayout,
} (rfr: VkRenderingFragmentDensityMapAttachmentInfoEXT)
-
surfacecapabilities = {
min_image_count: integer,
max_image_count: integer,
current_extent: extent2d (=nil if undefined, see Note1 below),
min_image_extent: extent2d,
max_image_extent: extent2d,
max_image_array_layers: integer,
supported_transforms: surfacetransformflags,
current_transform: surfacetransformflags,
supported_composite_alpha: compositealphaflags,
supported_usage_flags: imageusageflags,
-- EXTENSION VkSharedPresentSurfaceCapabilitiesKHR:
shared_present_supported_usage_flags: imageusageflags,
-- EXTENSION VkPhysicalDeviceSurfaceCapabilities2EXT:
supported_surface_counters: surfacecounterflags,
-- EXTENSION VkSurfaceProtectedCapabilitiesKHR:
supports_protected: boolean,
} (rfr: VkSurfaceCapabilities2KHR)
Note1: The current_extent field is nil when width and height in the underlying C struct have the special value 0xFFFFFFFF. -
surfaceformat = {
format: format,
color_space: colorspace,
} (rfr: VkSurfaceFormat2KHR)
-
swapchaincreateinfo = {
flags: swapchaincreateflags,
surface: surface [R],
min_image_count: integer,
image_format: format,
image_color_space: colorspace,
image_extent: extent2d,
image_array_layers: integer,
image_usage: imageusageflags,
image_sharing_mode: sharingmode,
queue_family_indices: {index},
pre_transform: surfacetransformflags,
composite_alpha: compositealphaflags,
present_mode: presentmode,
clipped: boolean,
old_swapchain: swapchain,
-- EXTENSION VkSwapchainCounterCreateInfoEXT:
surface_counters: surfacecounterflags,
-- EXTENSION VkDeviceGroupSwapchainCreateInfoKHR:
modes: devicegrouppresentmodeflags,
} (rfr: VkSwapchainCreateInfoKHR) -
acquirenextimageinfo = {
timeout: timeout,
semaphore: semaphore,
fence: fence,
device_mask: integer,
} (rfr: VkAcquireNextImageInfoKHR) -
presentinfo = {
swapchains: {swapchain},
image_indices: {integer} (same length as swapchains),
wait_semaphores: {semaphore},
-- EXTENSION VkDisplayPresentInfoKHR:
src_rect: extent2d,
dst_rect: extent2d,
persistent: boolean,
-- EXTENSION VkPresentRegionsKHR:
regions: {presentregion},
-- EXTENSION VkDeviceGroupPresentInfoKHR:
device_masks: {integer},
mode: devicegrouppresentmodeflags,
-- EXTENSION VkPresentIdKHR:
present_ids: {integer},
} (rfr: VkPresentInfoKHR) -
presentregion = { rectangles: {rectlayer} }
(rfr: VkPresentRegionKHR) -
rectlayer = {
offset: offset2d [R],
extent: extent2d [R],
layer: integer,
} (rfr: VkRectLayerKHR)
-
hdrmetadata = {
display_primary_red: xycolor,
display_primary_green: xycolor,
display_primary_blue: xycolor,
white_point: xycolor,
max_luminance: float,
min_luminance: float,
max_content_light_level: float,
max_frame_average_light_level: float,
} (rfr: VkHdrMetadataEXT) -
xycolor = { x, y: float, }
(rfr: VkXYColorEXT)
-
multidrawinfo = {
first_vertex: integer,
vertex_count: integer,
} (rfr: VkMultiDrawInfoEXT) -
multidrawindexedinfo = {
first_index: integer,
index_count: integer,
vertex_offset: integer,
} (rfr: VkMultiDrawIndexedInfoEXT)
-
displaypowerinfo = {
power_state: displaypowerstate,
} (rfr: VkDisplayPowerInfoEXT) -
displayproperties = {
display: display,
display_name: string,
physical_dimensions: extent2d,
physical_resolution: extent2d,
supported_transforms: surfacetransformflags,
plane_reorder_possible: boolean,
persistent_content: boolean,
} (rfr: VkDisplayProperties2KHR) -
displayplaneproperties = {
current_display: display (may be nil),
current_stack_index: index,
} (rfr: VkDisplayPlaneProperties2KHR) -
displaymodecreateinfo = {
display_mode: display_mode,
parameters: displaymodeparameters,
} (rfr: VkDisplayModeCreateInfoKHR) -
displaymodeproperties = {
flags: displaymodecreateinfoflags,
parameters: displaymodeparameters,
} (rfr: VkDisplayModeProperties2KHR) -
displaymodeparameters = {
visible_region: extent2d [R],
refresh_rate: integer,
} (rfr: VkDisplayModeParametersKHR) -
displayplaneinfo = {
plane_index: integer,
} (rfr: VkDisplayPlaneInfo2KHR) -
displayplanecapabilities = {
supported_alpha: displayplanealphaflags,
min_src_position: offset2d,
max_src_position: offset2d,
min_src_extent: extent2d,
max_src_extent: extent2d,
min_dst_position: offset2d,
max_dst_position: offset2d,
min_dst_extent: extent2d,
max_dst_extent: extent2d,
} (rfr: VkDisplayPlaneCapabilities2KHR) -
displaysurfacecreateinfo = {
flags: displaysurfacecreateflags,
plane_index: index,
plane_stack_index: index,
transform: surfacetransformflags,
global_alpha: float,
alpha_mode: displayplanealphaflags,
image_extent: extent2d [R],
} (rfr: VkDisplaySurfaceCreateInfoKHR)
-
devicegrouppresentcapabilities = {
present_mask: {integer},
modes: devicegrouppresentmodeflags,
} (rfr: VkDeviceGroupPresentCapabilitiesKHR)
-
descriptorupdatetemplatecreateinfo = {
flags: descriptorupdatetemplatecreateflags,
descriptor_update_entries: {descriptorupdatetemplateentry},
template_type: descriptorupdatetemplatetype [R],
descriptor_set_layout: descriptor_set_layout,
pipeline_bind_point: pipelinebindpoint,
pipeline_layout: pipeline_layout,
set: integer,
} (rfr: VkDescriptorUpdateTemplateCreateInfo) -
descriptorupdatetemplateentry = {
dst_binding: integer,
dst_array_element: integer,
descriptor_count: integer,
descriptor_type: descriptortype [R],
offset: integer,
stride: integer,
} (rfr: VkDescriptorUpdateTemplateEntry)
-
debugutilsmessengercreateinfo = {
flags: debugutilsmessengercreateflags,
message_severity: debugutilsmessageseverityflags,
message_type: debugutilsmessagetypeflags,
} (rfr: VkDebugUtilsMessengerCreateInfoEXT) -
debugutilsobjectnameinfo = {
object_type: objecttype [R],
object_handle: integer (raw handle) [R],
object_name: string [R],
} (rfr: VkDebugUtilsObjectNameInfoEXT) -
debugutilsobjecttaginfo = {
object_type: objecttype [R],
object_handle: integer (raw handle) [R],
tag_name: integer [R],
tag: string [R],
} (rfr: VkDebugUtilsObjectTagInfoEXT) -
debugutilslabel = {
label_name: string [R],
color: {float}[4],
} (rfr: VkDebugUtilsLabelEXT) -
debugutilsmessengercallbackdata = {
message_id_name: string [R],
message: string [R],
queue_labels: {debugutilslabel},
cmd_buf_labels: {debugutilslabel},
objects: {debugutilsobjectnameinfo},
} (rfr: VkDebugUtilsMessengerCallbackDataEXT)
-
conditionalrenderingbegininfo = {
buffer: buffer [R],
offset: integer,
flags: conditionalrenderingflags,
} (rfr: VkConditionalRenderingBeginInfoEXT)
-
calibratedtimestampinfo = {
time_domain: timedomain [R],
} (rfr: VkCalibratedTimestampInfoEXT)
Enums
Vulkan enums are mapped in MoonVulkan to sets of string literals (as is customary in Lua). Admitted literals are available in the vk table (e.g. vk.BLEND_OP_XXX for VK_BLEND_OP_XXX), and can also be inferred from the corresponding C enum names. For example, given the vk.BLEND_OP_XXX hint for the blendop enum type, the literals it admits are obtained by lowercasing the XXX part of the name and replacing any underscore with a space. Any extension suffix such as _KHR or _EXT is removed.
The example contained in the code snippets section should hopefully be clear enough.
If needed, the following function can be used to obtain the list of literals admitted by a particular enum type.
-
{literal} = vk.enum(enumtype)
Returns a table listing the literals admitted by enumtype (given as a string, e.g. 'blendop', 'format', etc).
Below is the list of the enum types, each with its hint, the list of string values it admits (if not too long), and a reference to the original Vulkan enum type where to look for semantic and usage information.
result: vk.XXX (results), vk.ERROR_XXX (errors)
Values: 'success', 'not ready', 'timeout', 'unknown', 'event set', 'event reset', 'incomplete', 'out of host memory', 'out of device memory', 'initialization failed', 'device lost', 'memory map failed', 'layer not present', 'extension not present', 'feature not present', 'incompatible driver', 'too many objects', 'format not supported', 'fragmented pool', 'surface lost', 'native window in use', 'suboptimal', 'out of date', 'incompatible display', 'validation failed', 'out of pool memory', 'invalid external handle', 'not permitted', 'fragmentation', 'invalid drm format modifier plane layout', 'invalid opaque capture address', 'full screen exclusive mode lost', 'thread idle', 'thread done', 'operation deferred', 'operation not deferred', 'pipeline compile required'.
Rfr: VkResult.
accelerationstructurebuildtype: vk.ACCELERATION_STRUCTURE_BUILD_TYPE_XXX
Values: 'host', 'device', 'host or device'.
Rfr: VkAccelerationStructureBuildTypeKHR.
accelerationstructurecompatibility: vk.ACCELERATION_STRUCTURE_COMPATIBILITY_XXX
Values: 'compatible', 'incompatible'.
Rfr: VkAccelerationStructureCompatibilityKHR.
accelerationstructuretype: vk.ACCELERATION_STRUCTURE_TYPE_XXX
Values: 'top level', 'bottom level', 'generic'.
Rfr: VkAccelerationStructureTypeKHR.
attachmentloadop: vk.ATTACHMENT_LOAD_OP_XXX
Values:
'load', 'clear', 'dont care' (default), 'none'.
Rfr: VkAttachmentLoadOp.
attachmentstoreop: vk.ATTACHMENT_STORE_OP_XXX
Values:
'store', 'dont care' (default), 'none'.
Rfr: VkAttachmentStoreOp.
blendfactor: vk.BLEND_FACTOR_XXX
Values:
'zero' (default), 'one', 'src color', 'one minus src color', 'dst color', 'one minus dst color', 'src alpha', 'one minus src alpha', 'dst alpha', 'one minus dst alpha', 'constant color', 'one minus constant color', 'constant alpha', 'one minus constant alpha', 'src alpha saturate', 'src1 color', 'one minus src1 color', 'src1 alpha', 'one minus src1 alpha'.
Rfr: VkBlendFactor.
blendop: vk.BLEND_OP_XXX, vk.BLEND_OP_XXX
Values:
'add' (default), 'subtract', 'reverse subtract', 'min', 'max', 'zero', 'src', 'dst', 'src over', 'dst over', 'src in', 'dst in', 'src out', 'dst out', 'src atop', 'dst atop', 'xor', 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'colordodge', 'colorburn', 'hardlight', 'softlight', 'difference', 'exclusion', 'invert', 'invert rgb', 'lineardodge', 'linearburn', 'vividlight', 'linearlight', 'pinlight', 'hardmix', 'hsl hue', 'hsl saturation', 'hsl color', 'hsl luminosity', 'plus', 'plus clamped', 'plus clamped alpha', 'plus darker', 'minus', 'minus clamped', 'contrast', 'invert ovg', 'red', 'green', 'blue'.
Rfr: VkBlendOp.
blendoverlap: vk.BLEND_OVERLAP_XXX
Values: 'uncorrelated' (default), 'disjoint', 'conjoint'.
Rfr: VkBlendOverlapEXT.
bordercolor: vk.BORDER_COLOR_XXX
Values:
'float transparent black' (default), 'int transparent black', 'float opaque black', 'int opaque black', 'float opaque white', 'int opaque white', 'float custom', 'int custom'.
Rfr: VkBorderColor.
buildaccelerationstructuremode: vk.BUILD_ACCELERATION_STRUCTURE_MODE_XXX
Values: 'build', 'update'.
Rfr: VkBuildAccelerationStructureModeKHR.
chromalocation: vk.CHROMA_LOCATION_XXX
Values: 'cosited even' (default), 'midpoint'.
Rfr: VkChromaLocation.
colorspace: vk.COLOR_SPACE_XXX, vk.COLOR_SPACE_XXX
Values:
'srgb nonlinear' (default), 'display p3 nonlinear', 'extended srgb linear', 'extended srgb nonlinear', 'dci p3 linear', 'dci p3 nonlinear', 'bt709 linear', 'bt709 nonlinear', 'bt2020 linear', 'hdr10 st2084', 'dolbyvision', 'hdr10 hlg', 'adobergb linear', 'adobergb nonlinear', 'pass through'.
Rfr: VkColorSpaceKHR.
commandbufferlevel: vk.COMMAND_BUFFER_LEVEL_XXX
Values:
'primary', 'secondary'.
Rfr: VkCommandBufferLevel.
compareop: vk.COMPARE_OP_XXX
Values:
'never' (default), 'less', 'equal', 'less or equal', 'greater', 'not equal', 'greater or equal', 'always'.
Rfr: VkCompareOp.
componentswizzle: vk.COMPONENT_SWIZZLE_XXX
Values:
'identity' (default), 'zero', 'one', 'r', 'g', 'b', 'a'.
Rfr: VkComponentSwizzle.
conservativerasterizationmode: vk.CONSERVATIVE_RASTERIZATION_MODE_XXX
Values: 'disabled', 'overestimate', 'underestimate'.
Rfr: VkConservativeRasterizationModeEXT.
copyaccelerationstructuremode: vk.COPY_ACCELERATION_STRUCTURE_MODE_XXX
Values: 'clone', 'compact', 'serialize', 'deserialize'.
Rfr: VkCopyAccelerationStructureModeKHR.
debugreportobjecttype: vk.DEBUG_REPORT_OBJECT_TYPE_XXX
Values: 'unknown', 'instance', 'physical device', 'device', 'queue', 'semaphore', 'command buffer', 'fence', 'device memory', 'buffer', 'image', 'event', 'query pool', 'buffer view', 'image view', 'shader module', 'pipeline cache', 'pipeline layout', 'render pass', 'pipeline', 'descriptor set layout', 'sampler', 'descriptor pool', 'descriptor set', 'framebuffer', 'command pool', 'surface', 'swapchain', 'debug report', 'display', 'display mode', 'validation cache', 'sampler ycbcr conversion', 'descriptor update template', 'acceleration structure'.
Rfr: VkDebugReportObjectTypeEXT.
descriptortype: vk.DESCRIPTOR_TYPE_XXX
Values:
'sampler', 'combined image sampler', 'sampled image', 'storage image', 'uniform texel buffer', 'storage texel buffer', 'uniform buffer', 'storage buffer', 'uniform buffer dynamic', 'storage buffer dynamic', 'input attachment', 'inline uniform block', 'acceleration structure'.
Rfr: VkDescriptorType.
descriptorupdatetemplatetype: vk.DESCRIPTOR_UPDATE_TEMPLATE_TYPE_XXX
Values: 'descriptor set', 'push descriptors'.
Rfr: VkDescriptorUpdateTemplateType.
deviceeventtype: vk.DEVICE_EVENT_TYPE_XXX
Values: 'display hotplug'.
Rfr: VkDeviceEventTypeEXT.
devicememoryreporteventtype: vk.DEVICE_MEMORY_REPORT_EVENT_TYPE_XXX
Values: 'allocate', 'free', 'import', 'unimport', 'allocation failed'.
Rfr: VkDeviceMemoryReportEventTypeEXT.
discardrectanglemode: vk.DISCARD_RECTANGLE_MODE_XXX
Values: 'inclusive', 'exclusive'.
Rfr: VkDiscardRectangleModeEXT.
displayeventtype: vk.DISPLAY_EVENT_TYPE_XXX
Values: 'first pixel out'.
Rfr: VkDisplayEventTypeEXT.
displaypowerstate: vk.DISPLAY_POWER_STATE_XXX
Values: 'off', 'suspend', 'on'.
Rfr: VkDisplayPowerStateEXT.
driverid: vk.DRIVER_ID_XXX
Values: 'amd proprietary', 'amd open source', 'mesa radv', 'nvidia proprietary', 'intel proprietary windows', 'intel open source mesa', 'imagination proprietary', 'qualcomm proprietary', 'arm proprietary', 'google swiftshader', 'ggp proprietary', 'broadcom proprietary', 'mesa llvmpipe', 'moltenvk', 'coreavi proprietary', 'juice proprietary', 'verisilicon proprietary', 'mesa turnip', 'mesa v3dv', 'mesa panvk'.
Rfr: VkDriverId.
dynamicstate: vk.DYNAMIC_STATE_XXX
Values: 'viewport', 'scissor', 'line width', 'depth bias', 'blend constants', 'depth bounds', 'stencil compare mask', 'stencil write mask', 'stencil reference', 'discard rectangle', 'sample locations', 'ray tracing pipeline stack size', 'fragment shading rate', 'line stipple', 'cull mode', 'front face', 'primitive topology', 'viewport with count', 'scissor with count', 'vertex input binding stride', 'depth test enable', 'depth write enable', 'depth compare op', 'depth bounds test enable', 'stencil test enable', 'stencil op', 'vertex input', 'patch control points', 'rasterizer discard enable', 'depth bias enable', 'logic op', 'primitive restart enable', 'color write enable'.
Rfr: VkDynamicState.
filter: vk.FILTER_XXX
Values:
'nearest' (default), 'linear', 'cubic'.
Rfr: VkFilter.
format: vk.FORMAT_XXX
Values:
'undefined' (default), 'r4g4 unorm pack8', 'r4g4b4a4 unorm pack16', etc.
Rfr: VkFormat.
fragmentshadingratecombinerop: vk.FRAGMENT_SHADING_RATE_COMBINER_OP_XXX
Values: 'keep', 'replace', 'min', 'max', 'mul'.
Rfr: VkFragmentShadingRateCombinerOpKHR.
frontface: vk.FRONT_FACE_XXX
Values:
'counter clockwise' (default), 'clockwise'.
Rfr: VkFrontFace.
fullscreenexclusive: vk.FULL_SCREEN_EXCLUSIVE_XXX
Values: 'default', 'allowed', 'disallowed', 'application controlled'.
Rfr: VkFullScreenExclusiveEXT.
geometrytype: vk.GEOMETRY_TYPE_XXX
Values: 'triangles', 'aabbs', 'instances'.
Rfr: VkGeometryTypeKHR.
imagelayout: vk.IMAGE_LAYOUT_XXX
Values:
'undefined' (default), 'general', 'color attachment optimal', 'depth stencil attachment optimal', 'depth stencil read only optimal', 'shader read only optimal', 'transfer src optimal', 'transfer dst optimal', 'preinitialized', 'present src', 'shared present', 'depth read only stencil attachment optimal', 'depth attachment stencil read only optimal', 'fragment density map optimal', 'depth attachment optimal', 'depth read only optimal', 'stencil attachment optimal', 'stencil read only optimal', 'fragment shading rate attachment optimal', 'read only optimal', 'attachment optimal'.
Rfr: VkImageLayout.
imagetiling: vk.IMAGE_TILING_XXX
Values:
'optimal' (default), 'linear', 'drm format modifier'.
Rfr: VkImageTiling.
imagetype: vk.IMAGE_TYPE_XXX
Values:
'1d', '2d', '3d'.
Rfr: VkImageType.
imageviewtype: vk.IMAGE_VIEW_TYPE_XXX
Values:
'1d', '2d', '3d', 'cube', '1d array', '2d array', 'cube array'.
Rfr: VkImageViewType.
indextype: vk.INDEX_TYPE_XXX
Values:
'uint16', 'uint32', 'none', 'uint8'.
Rfr: VkIndexType.
linerasterizationmode: vk.LINE_RASTERIZATION_MODE_XXX
Values: 'default', 'rectangular', 'bresenham', 'rectangular smooth'.
Rfr: VkLineRasterizationModeEXT.
logicop: vk.LOGIC_OP_XXX
Values:
'clear' (default), 'and', 'and reverse', 'copy', 'and inverted', 'no op', 'xor', 'or', 'nor', 'equivalent', 'invert', 'or reverse', 'copy inverted', 'or inverted', 'nand', 'set'.
Rfr: VkLogicOp.
objecttype: vk.OBJECT_TYPE_XXX
Values: 'unknown', 'instance', 'physical device', 'device', 'queue', 'semaphore', 'command buffer', 'fence', 'device memory', 'buffer', 'image', 'event', 'query pool', 'buffer view', 'image view', 'shader module', 'pipeline cache', 'pipeline layout', 'render pass', 'pipeline', 'descriptor set layout', 'sampler', 'descriptor pool', 'descriptor set', 'framebuffer', 'command pool', 'surface', 'swapchain', 'display', 'display mode', 'debug report callback', 'descriptor update template', 'sampler ycbcr conversion', 'validation cache', 'debug utils messenger', 'acceleration structure', 'deferred operation', 'private data slot'.
Rfr: VkObjectType.
performancecounterscope: vk.PERFORMANCE_COUNTER_SCOPE_XXX
Values: 'command buffer', 'render pass', 'command'.
Rfr: VkPerformanceCounterScopeKHR.
performancecounterstorage: vk.PERFORMANCE_COUNTER_STORAGE_XXX
Values: 'int32', 'int64', 'uint32', 'uint64', 'float32', 'float64'.
Rfr: VkPerformanceCounterStorageKHR.
performancecounterunit: vk.PERFORMANCE_COUNTER_UNIT_XXX
Values: 'generic', 'percentage', 'nanoseconds', 'bytes', 'bytes per second', 'kelvin', 'watts', 'volts', 'amps', 'hertz', 'cycles'.
Rfr: VkPerformanceCounterUnitKHR.
physicaldevicetype: vk.PHYSICAL_DEVICE_TYPE_XXX
Values:
'other', 'integrated gpu', 'discrete gpu', 'virtual gpu', 'cpu'.
Rfr: VkPhysicalDeviceType.
pipelinebindpoint: vk.PIPELINE_BIND_POINT_XXX
Values:
'graphics' (default), 'compute', 'ray tracing'.
Rfr: VkPipelineBindPoint.
pipelineexecutablestatisticformat: vk.PIPELINE_EXECUTABLE_STATISTIC_FORMAT_XXX
Values: 'bool32', 'int64', 'uint64', 'float64'.
Rfr: VkPipelineExecutableStatisticFormatKHR.
pointclippingbehavior: vk.POINT_CLIPPING_BEHAVIOR_XXX
Values: 'all clip planes', 'user clip planes only'.
Rfr: VkPointClippingBehavior.
polygonmode: vk.POLYGON_MODE_XXX
Values:
'fill' (default), 'line', 'point'.
Rfr: VkPolygonMode.
presentmode: vk.PRESENT_MODE_XXX
Values:
'immediate', 'mailbox', 'fifo' (default), 'fifo relaxed', 'shared demand refresh', 'shared continuous refresh'.
Rfr: VkPresentModeKHR.
primitivetopology: vk.PRIMITIVE_TOPOLOGY_XXX
Values:
'point list' (default), 'line list', 'line strip', 'triangle list', 'triangle strip', 'triangle fan', 'line list with adjacency', 'line strip with adjacency', 'triangle list with adjacency', 'triangle strip with adjacency', 'patch list'.
Rfr: VkPrimitiveTopology.
provokingvertexmode: vk.PROVOKING_VERTEX_MODE_XXX
Values: 'first vertex', 'last vertex'.
Rfr: VkProvokingVertexModeEXT.
querytype: vk.QUERY_TYPE_XXX
Values:
'occlusion', 'pipeline statistics', 'timestamp', 'transform feedback stream', 'performance query', 'acceleration structure compacted size', 'acceleration structure serialization size'.
Rfr: VkQueryType.
queueglobalpriority: vk.QUEUE_GLOBAL_PRIORITY_XXX
Values: 'low', 'medium', 'high', 'realtime'.
Rfr: VkQueueGlobalPriorityEXT.
raytracingshadergrouptype: vk.RAY_TRACING_SHADER_GROUP_TYPE_XXX
Values: 'general', 'triangles hit group', 'procedural hit group'.
Rfr: VkRayTracingShaderGroupTypeKHR.
sampleraddressmode: vk.SAMPLER_ADDRESS_MODE_XXX
Values:
'repeat' (default), 'mirrored repeat', 'clamp to edge', 'clamp to border', 'mirror clamp to edge'.
Rfr: VkSamplerAddressMode.
samplermipmapmode: vk.SAMPLER_MIPMAP_MODE_XXX
Values:
'nearest' (default), 'linear'.
Rfr: VkSamplerMipmapMode.
samplerreductionmode: vk.SAMPLER_REDUCTION_MODE_XXX
Values: 'weighted average' (default), 'min', 'max'.
Rfr: VkSamplerReductionMode.
samplerycbcrmodelconversion: vk.SAMPLER_YCBCR_MODEL_CONVERSION_XXX
Values: 'rgb identity' (default), 'ycbcr identity', 'ycbcr 709', 'ycbcr 601', 'ycbcr 2020'.
Rfr: VkSamplerYcbcrModelConversion.
samplerycbcrrange: vk.SAMPLER_YCBCR_RANGE_XXX
Values: 'itu full' (default), 'itu narrow'.
Rfr: VkSamplerYcbcrRange.
semaphoretype: vk.SEMAPHORE_TYPE_XXX
Values: 'binary', 'timeline'.
Rfr: VkSemaphoreType.
shaderfloatcontrolsindependence: vk.SHADER_FLOAT_CONTROLS_INDEPENDENCE_XXX
Values: '32 bit only', 'all', 'none'.
Rfr: VkShaderFloatControlsIndependence.
shadergroupshader: vk.SHADER_GROUP_SHADER_XXX
Values: 'general', 'closest hit', 'any hit', 'intersection'.
Rfr: VkShaderGroupShaderKHR.
stencilop: vk.STENCIL_OP_XXX
Values:
'keep' (default), 'zero', 'replace', 'increment and clamp', 'decrement and clamp', 'invert', 'increment and wrap', 'decrement and wrap'.
Rfr: VkStencilOp.
subpasscontents: vk.SUBPASS_CONTENTS_XXX
Values: 'inline', 'secondary command buffers'.
Rfr: VkSubpassContents.
tessellationdomainorigin: vk.TESSELLATION_DOMAIN_ORIGIN_XXX
Values: 'upper left', 'lower left'.
Rfr: VkTessellationDomainOrigin.
timedomain: vk.TIME_DOMAIN_XXX
Values: 'device', 'clock monotonic', 'clock monotonic raw', 'query performance counter'.
Rfr: VkTimeDomainEXT.
validationcacheheaderversion: vk.VALIDATION_CACHE_HEADER_VERSION_XXX
Values: 'one'.
Rfr: VkValidationCacheHeaderVersionEXT.
validationcheck: vk.VALIDATION_CHECK_XXX
Values: 'all', shaders'.
Rfr: VkValidationCheckEXT.
validationfeaturedisable: vk.VALIDATION_FEATURE_DISABLE_XXX
Values: 'all' ,'shaders' ,'thread safety' ,'api parameters' ,'object lifetimes' ,'core checks' ,'unique handles', 'shader validation cache'.
Rfr: VkValidationFeatureDisableEXT.
validationfeatureenable: vk.VALIDATION_FEATURE_ENABLE_XXX
Values: 'gpu assisted', 'gpu assisted reserve binding slot', 'best practices', 'debug printf', 'synchronization validation'.
Rfr: VkValidationFeatureEnableEXT.
vendorid: vk.VENDOR_ID_XXX
Values: 'viv', 'vsi', 'kazan', 'codeplay', 'mesa', 'pocl'.
Rfr: VkVendorId.
vertexinputrate: vk.VERTEX_INPUT_RATE_XXX
Values:
'vertex' (default), 'instance'.
Rfr: VkVertexInputRate.
Flags
Flags in MoonVulkan functions and structs are always represented as plain integers, and encoded in the same way as the corresponding flags in the C Vulkan API.
The vk table contains the VK_XXX_BIT values, renamed as vk.XXX_BIT (e.g. vk.STENCIL_FACE_FRONT_BIT, vk.STENCIL_FACE_BACK_BIT, etc.), without any extension suffix such as _KHR or _EXT.
For each flags type (see the list below), a utility function is also available to map an integer code to a list of string literals, each corresponding to an individual bit set in the code, and viceversa to encode an integer value from the individual bits given as a list of string literals. The generic definition of such functions is the following, where xxxflags stands for stencilfaceflags, commandbufferresetflags, etc:
-
code = xxxflags(s1, s2, …)
s1, s2, … = xxxflags(code)
Maps the integer code to/from the list of string values s1, s2, ….
See also the example contained in the code snippets section.
accessflags: vk.ACCESS_XXX_BIT
Values: 'none', 'indirect command read', 'index read', 'vertex attribute read', 'uniform read', 'input attachment read', 'shader read', 'shader write', 'color attachment read', 'color attachment write', 'depth stencil attachment read', 'depth stencil attachment write', 'transfer read', 'transfer write', 'host read', 'host write', 'memory read', 'memory write', 'color attachment read noncoherent', 'conditional rendering read', 'transform feedback write, 'transform feedback counter read, 'transform feedback counter write', 'fragment density map read', 'acceleration structure read', 'acceleration structure write', 'fragment shading rate attachment read', 'shader sampled read', 'shader storage read', 'shader storage write'.
Rfr. VkAccessFlagBits.
accelerationstructurecreateflags: vk.ACCELERATION_STRUCTURE_CREATE_XXX_BIT
Values: 'device address capture replay'.
Rfr: VkAccelerationStructureCreateFlagBitsKHR.
attachmentdescriptionflags: vk.ATTACHMENT_DESCRIPTION_XXX_BIT
Values:
'may alias'.
Rfr. VkAttachmentDescriptionFlagBits.
buffercreateflags: vk.BUFFER_CREATE_XXX_BIT
Values:
'sparse binding', 'sparse residency', 'sparse aliased', 'protected', 'device address capture replay'.
Rfr. VkBufferCreateFlagBits.
bufferusageflags: vk.BUFFER_USAGE_XXX_BIT
Values: 'transfer src', 'transfer dst', 'uniform texel buffer', 'storage texel buffer', 'uniform buffer', 'storage buffer', 'index buffer', 'vertex buffer', 'indirect buffer', 'conditional rendering', 'transform feedback buffer', 'transform feedback counter buffer', 'shader device address', 'acceleration structure build input read only', 'acceleration structure storage', 'shader binding table'.
Rfr. VkBufferUsageFlagBits.
buildaccelerationstructureflags: vk.BUILD_ACCELERATION_STRUCTURE_XXX_BIT
Values: 'allow update', 'allow compaction', 'prefer fast trace', 'prefer fast build', 'low memory'.
Rfr: VkBuildAccelerationStructureFlagBitsKHR.
colorcomponentflags: vk.COLOR_COMPONENT_XXX_BIT
Values:
'r', 'g', 'b', 'a'.
Rfr. VkColorComponentFlagBits.
commandbufferresetflags: vk.COMMAND_BUFFER_RESET_XXX_BIT
Values:
'release resources'.
Rfr. VkCommandBufferResetFlagBits.
commandbufferusageflags: vk.COMMAND_BUFFER_USAGE_XXX_BIT
Values:
'one time submit', 'render pass continue', 'simultaneous use'.
Rfr. VkCommandBufferUsageFlagBits.
commandpoolcreateflags: vk.COMMAND_POOL_CREATE_XXX_BIT
Values:
'transient', 'reset command buffer', 'protected'.
Rfr. VkCommandPoolCreateFlagBits.
commandpoolresetflags: vk.COMMAND_POOL_RESET_XXX_BIT
Values:
'release resources'.
Rfr. VkCommandPoolResetFlagBits.
compositealphaflags: vk.COMPOSITE_ALPHA_XXX_BIT
Values:
'opaque', 'pre multiplied', 'post multiplied', 'inherit'.
Rfr: VkCompositeAlphaFlagBitsKHR.
conditionalrenderingflags: vk.CONDITIONAL_RENDERING_XXX_BIT
Values: 'inverted'.
Rfr: VkConditionalRenderingFlagBitsEXT.
cullmodeflags: vk.CULL_MODE_XXX
Values:
'none' (=0), 'front', 'back', 'front and back'.
Rfr. VkCullModeFlagBits.
debugreportflags: vk.DEBUG_REPORT_XXX_BIT
Values:
'information', 'warning', 'performance warning', 'report', 'debug'.
Rfr: VkDebugReportFlagBitsEXT.
debugutilsmessageseverityflags: vk.DEBUG_UTILS_MESSAGE_SEVERITY_XXX_BIT
Values: 'verbose', 'info', 'warning', 'error'.
Rfr: VkDebugUtilsMessageSeverityFlagBitsEXT.
debugutilsmessagetypeflags: vk.DEBUG_UTILS_MESSAGE_TYPE_XXX_BIT
Values: 'general', 'validation', 'performance'.
Rfr: VkDebugUtilsMessageTypeFlagBitsEXT.
dependencyflags: vk.DEPENDENCY_XXX_BIT
Values:
'by region', 'device group', 'view local'.
Rfr. VkDependencyFlagBits.
descriptorbindingflags: vk.DESCRIPTOR_BINDING_XXX_BIT
Values:
'update after bind', 'update unused while pending', 'partially bound', 'variable descriptor count'.
Rfr: VkDescriptorBindingFlagBits.
descriptorpoolcreateflags: vk.DESCRIPTOR_POOL_CREATE_XXX_BIT
Values:
'free descriptor set', 'update after bind'.
Rfr. VkDescriptorPoolCreateFlagBits.
descriptorsetlayoutcreateflags: vk.DESCRIPTOR_SET_LAYOUT_CREATE_XXX_BIT
Values:
'push descriptor', 'update after bind pool'.
Rfr. VkDescriptorSetLayoutCreateFlagBits.
devicegrouppresentmodeflags: vk.DEVICE_GROUP_PRESENT_MODE_XXX_BIT
Values: 'local', 'remote', 'sum', 'local multi device'.
Rfr: VkDeviceGroupPresentModeFlagBitsKHR.
devicequeuecreateflags: vk.DEVICE_QUEUE_CREATE_XXX_BIT
Values: 'protected'.
Rfr: VkDeviceQueueCreateFlagBits.
displayplanealphaflags: vk.DISPLAY_PLANE_ALPHA_XXX_BIT
Values: 'opaque', 'global', 'per pixel', 'per pixel premultiplied'.
Rfr: VkDisplayPlaneAlphaFlagBitsKHR.
eventcreateflags: vk.EVENT_CREATE_XXX_BIT
Values: 'device only'.
Rfr: VkEventCreateFlagBits.
externalfencefeatureflags: vk.EXTERNAL_FENCE_FEATURE_XXX_BIT
Values: 'exportable', 'importable'.
Rfr: VkExternalFenceFeatureFlagBits.
externalfencehandletypeflags: vk.EXTERNAL_FENCE_HANDLE_TYPE_XXX_BIT
Values: 'opaque fd', 'opaque win32', 'opaque win32 kmt', 'sync fd'.
Rfr: VkExternalFenceHandleTypeFlagBits.
externalmemoryfeatureflags: vk.EXTERNAL_MEMORY_FEATURE_XXX_BIT
Values: 'dedicated only', 'exportable', 'importable'.
Rfr: VkExternalMemoryFeatureFlagBits.
externalmemoryhandletypeflags: vk.EXTERNAL_MEMORY_HANDLE_TYPE_XXX_BIT
Values: 'opaque fd', 'opaque win32', 'opaque win32 kmt', 'd3d11 texture', 'd3d11 texture kmt', 'd3d12 heap', 'd3d12 resource'.
Rfr: VkExternalMemoryHandleTypeFlagBits.
externalsemaphorefeatureflags: vk.EXTERNAL_SEMAPHORE_FEATURE_XXX_BIT
Values: 'exportable', 'importable'.
Rfr: VkExternalSemaphoreFeatureFlagBits.
externalsemaphorehandletypeflags: vk.EXTERNAL_SEMAPHORE_HANDLE_TYPE_XXX_BIT
Values: 'opaque fd', 'opaque win32', 'opaque win32 kmt', 'd3d12 fence', 'sync fd'.
Rfr: VkExternalSemaphoreHandleTypeFlagBits.
fencecreateflags: vk.FENCE_CREATE_XXX_BIT
Values:
'signaled'.
Rfr. VkFenceCreateFlagBits.
fenceimportflags: vk.FENCE_IMPORT_XXX_BIT
Values: 'temporary'.
Rfr: VkFenceImportFlagBits.
formatfeatureflags: vk.FORMAT_FEATURE_XXX_BIT
Values:
'sampled image', 'storage image', 'storage image atomic', 'uniform texel buffer', 'storage texel buffer', 'storage texel buffer atomic', 'vertex buffer', 'color attachment', 'color attachment blend', 'depth stencil attachment', 'blit src', 'blit dst', 'transfer src', 'transfer dst', 'sampled image filter linear', 'sampled image filter minmax', 'midpoint chroma samples', 'sampled image ycbcr conversion linear filter', 'sampled image ycbcr conversion separate reconstruction filter', 'sampled image ycbcr conversion chroma reconstruction explicit', 'sampled image ycbcr conversion chroma reconstruction explicit forceable', 'disjoint', 'cosited chroma samples', 'fragment density map', 'sampled image filter cubic', 'acceleration structure vertex buffer', 'fragment shading rate attachment', 'storage read without format', 'storage write without format', 'sampled image depth comparison'.
Rfr. VkFormatFeatureFlagBits2KHR.
framebuffercreateflags: vk.FRAMEBUFFER_CREATE_XXX_BIT
Values: 'imageless'.
Rfr: VkFramebufferCreateFlagBits.
geometryflags: vk.GEOMETRY_XXX_BIT
Values: 'opaque', 'no duplicate any hit invocation'.
Rfr: VkGeometryFlagBitsKHR.
geometryinstanceflags: vk.GEOMETRY_INSTANCE_XXX_BIT
Values: 'triangle facing cull disable', 'triangle flip facing', 'force opaque', 'force no opaque'.
Rfr: VkGeometryInstanceFlagBitsKHR.
imageaspectflags: vk.IMAGE_ASPECT_XXX_BIT
Values:
'color', 'depth', 'stencil', 'metadata', 'plane 0', 'plane 1', 'plane 2', 'memory plane 0', 'memory plane 1', 'memory plane 2', 'memory plane 3'.
Rfr. VkImageAspectFlagBits.
imagecreateflags: vk.IMAGE_CREATE_XXX_BIT
Values:
'sparse binding', 'sparse residency', 'sparse aliased', 'mutable format', 'cube compatible', 'block texel view compatible', 'extended usage', 'sample locations compatible depth', 'disjoint', 'alias','split instance bind regions', '2d array compatible', 'protected', 'subsampled'.
Rfr. VkImageCreateFlagBits.
imageusageflags: vk.IMAGE_USAGE_XXX_BIT
Values:
'transfer src', 'transfer dst', 'sampled', 'storage', 'color attachment', 'depth stencil attachment', 'transient attachment', 'input attachment', 'fragment density map'.
Rfr. VkImageUsageFlagBits.
imageviewcreateflags: vk.IMAGE_VIEW_CREATE_XXX_BIT
Values: 'fragment density map dynamic', 'fragment density map deferred'.
Rfr: VkImageViewCreateFlagBits.
memoryallocateflags: vk.MEMORY_ALLOCATE_XXX_BIT
Values: 'device mask', 'device address', 'device address capture replay'.
Rfr: VkMemoryAllocateFlagBits.
memoryheapflags: vk.MEMORY_HEAP_XXX_BIT
Values:
'device local', 'multi instance'.
Rfr. VkMemoryHeapFlagBits.
memorypropertyflags: vk.MEMORY_PROPERTY_XXX_BIT
Values:
'device local', 'host visible', 'host coherent', 'host cached', 'lazily allocated', 'protected'.
Rfr. VkMemoryPropertyFlagBits.
peermemoryfeatureflags: vk.PEER_MEMORY_FEATURE_XXX_BIT
Values: 'copy src', 'copy dst', 'generic src', 'generic dst'.
Rfr: VkPeerMemoryFeatureFlagBits.
performancecounterdescriptionflags: vk.PERFORMANCE_COUNTER_DESCRIPTION_XXX_BIT
Values: 'performance impacting', 'concurrently impacted'.
Rfr: VkPerformanceCounterDescriptionFlagBitsKHR.
pipelinecachecreateflags: vk.PIPELINE_CACHE_CREATE_XXX_BIT
Values: 'externally synchronized'.
Rfr: VkPipelineCacheCreateFlagBits.
pipelinecreateflags: vk.PIPELINE_CREATE_XXX_BIT
Values:
'disable optimization', 'allow derivatives', 'derivative', 'view index from device index', 'dispatch base', 'ray tracing no null any hit shaders', 'ray tracing no null closest hit shaders', 'ray tracing no null miss shaders', 'ray tracing no null intersection shaders', 'ray tracing skip triangles', 'ray tracing skip aabbs', 'ray tracing shader group handle capture replay', 'capture statistics', 'capture internal representations', 'library', 'fail on pipeline compile required', 'early return on failure'.
Rfr. VkPipelineCreateFlagBits.
pipelinecreationfeedbackflags: vk.PIPELINE_CREATION_FEEDBACK_XXX_BIT
Values:'valid', 'application pipeline cache hit', 'base pipeline acceleration'.
Rfr: VkPipelineCreationFeedbackFlagBitsEXT.
pipelineshaderstagecreateflags: vk.PIPELINE_SHADER_STAGE_CREATE_XXX_BIT
Values: 'allow varying subgroup size', 'require full subgroups'.
Rfr: VkPipelineShaderStageCreateFlagBits.
pipelinestageflags: vk.PIPELINE_STAGE_XXX_BIT
Values: 'none', 'top of pipe', 'draw indirect', 'vertex input', 'vertex shader', 'tessellation control shader', 'tessellation evaluation shader', 'geometry shader', 'fragment shader', 'early fragment tests', 'late fragment tests', 'color attachment output', 'compute shader', 'transfer', 'bottom of pipe', 'host', 'all graphics', 'all commands', 'conditional rendering', 'transform feedback', 'fragment density process', 'acceleration structure build', 'ray tracing shader', 'fragment shading rate attachment', 'copy', 'resolve', 'blit', 'clear', 'index input', 'vertex attribute input', 'pre rasterization shaders'.
Rfr. VkPipelineStageFlagBits.
querycontrolflags: vk.QUERY_CONTROL_XXX_BIT
Values:
'precise'.
Rfr. VkQueryControlFlagBits.
querypipelinestatisticflags: vk.QUERY_PIPELINE_STATISTIC_XXX_BIT
Values:
'input assembly vertices', 'input assembly primitives', 'vertex shader invocations', 'geometry shader invocations', 'geometry shader primitives', 'clipping invocations', 'clipping primitives', 'fragment shader invocations', 'tessellation control shader patches', 'tessellation evaluation shader invocations', 'compute shader invocations'.
Rfr. VkQueryPipelineStatisticFlagBits.
queryresultflags: vk.QUERY_RESULT_XXX_BIT
Values:
'64', 'wait', 'with availability', 'partial'.
Rfr. VkQueryResultFlagBits.
queueflags: vk.QUEUE_XXX_BIT
Values:
'graphics', 'compute', 'transfer', 'sparse binding', 'protected'.
Rfr. VkQueueFlagBits.
renderingflags: vk.RENDERING_XXX_BIT
Values:
'contents secondary command buffers', 'suspending', 'resuming'.
Rfr: VkRenderingFlagBitsKHR.
resolvemodeflags: vk.RESOLVE_MODE_XXX_BIT
Values: 'none', 'sample zero', 'average', 'min', 'max'.
Rfr: VkResolveModeFlagBits.
samplecountflags: vk.SAMPLE_COUNT_XXX_BIT
Values:
'1', '2', '4', '8', '16', '32', '64'.
Rfr. VkSampleCountFlagBits.
samplercreateflags: vk.SAMPLER_CREATE_XXX_BIT
Values: 'subsampled', 'subsampled coarse reconstruction'.
Rfr: VkSamplerCreateFlagBits.
semaphoreimportflags: vk.SEMAPHORE_IMPORT_XXX_BIT
Values: 'temporary'.
Rfr: VkSemaphoreImportFlagBits.
semaphorewaitflags: vk.SEMAPHORE_WAIT_XXX_BIT
Values: 'any'.
Rfr: VkSemaphoreWaitFlagBits.
shaderstageflags: vk.SHADER_STAGE_XXX_BIT
Values:
'vertex', 'tessellation control', 'tessellation evaluation', 'geometry', 'fragment', 'compute', 'all graphics', 'all', 'raygen', 'any hit', 'closest hit', 'miss', 'intersection', 'callable'.
Rfr. VkShaderStageFlagBits.
sparseimageformatflags: vk.SPARSE_IMAGE_FORMAT_XXX_BIT
Values:
'single miptail', 'aligned mip size', 'nonstandard block size'.
Rfr. VkSparseImageFormatFlagBits.
sparsememorybindflags: vk.SPARSE_MEMORY_BIND_XXX_BIT
Values:
'metadata'.
Rfr. VkSparseMemoryBindFlagBits.
stencilfaceflags: vk.STENCIL_FACE_XXX_BIT
Values:
'front', 'back', 'front and back'.
Rfr. VkStencilFaceFlagBits.
subgroupfeatureflags: vk.SUBGROUP_FEATURE_XXX_BIT
Values: 'basic', 'vote', 'arithmetic', 'ballot', 'shuffle', 'shuffle relative', 'clustered', 'quad'.
Rfr: VkSubgroupFeatureFlagBits.
submitflags: vk.SUBMIT_XXX_BIT
Values: 'protected'.
Rfr: VkSubmitFlagBitsKHR.
surfacecounterflags: vk.SURFACE_COUNTER_XXX_BIT
Values: 'vblank'.
Rfr: VkSurfaceCounterFlagBitsEXT.
surfacetransformflags: vk.SURFACE_TRANSFORM_XXX_BIT
Values:
'identity', 'rotate 90', 'rotate 180', 'rotate 270', 'horizontal mirror', 'horizontal mirror rotate 90', 'horizontal mirror rotate 180', 'horizontal mirror rotate 270', 'inherit'.
Rfr: VkSurfaceTransformFlagBitsKHR.
swapchaincreateflags: vk.SWAPCHAIN_CREATE_XXX_BIT
Values: 'split instance bind regions', 'protected', 'mutable format'.
Rfr: VkSwapchainCreateFlagBitsKHR.
toolpurposeflags: vk.TOOL_PURPOSE_XXX_BIT
Values: 'validation', 'profiling', 'tracing', 'additional features', 'modifying features', 'debug reporting', 'debug markers'.
Rfr: VkToolPurposeFlagBitsEXT.
Reserved for future use (must be set to 0):
acquireprofilinglockflags: 0
bufferviewcreateflags: 0
commandpooltrimflags: 0
debugutilsmessengercallbackdataflags: 0
debugutilsmessengercreateflags: 0
descriptorpoolresetflags: 0
descriptorupdatetemplatecreateflags: 0
devicecreateflags: 0
displaymodecreateflags: 0
displaysurfacecreateflags: 0
headlesssurfacecreateflags: 0
instancecreateflags: 0
memorymapflags: 0
pipelinecolorblendstatecreateflags: 0
pipelinerasterizationconservativestatecreateflags: 0
pipelinerasterizationstatestreamcreateflags: 0
pipelinerasterizationdepthclipstatecreateflags: 0
pipelinedepthstencilstatecreateflags: 0
pipelinediscardrectanglestatecreateflags: 0
pipelinedynamicstatecreateflags: 0
pipelineinputassemblystatecreateflags: 0
pipelinelayoutcreateflags: 0
pipelinemultisamplestatecreateflags: 0
pipelinerasterizationstatecreateflags: 0
pipelinetessellationstatecreateflags: 0
pipelinevertexinputstatecreateflags: 0
pipelineviewportstatecreateflags: 0
privatedataslotcreateflags: 0
querypoolcreateflags: 0
renderpasscreateflags: 0
semaphorecreateflags: 0
shadermodulecreateflags: 0
subpassdescriptionflags: 0
validationcachecreateflags: 0
Miscellanea
Version handling
-
version = enumerate_instance_version( )
Rfr: vkEnumerateInstanceVersion.
-
version = make_version(major, minor, patch, [variant=0])
Constructs version (an integer) from major, minor, patch, and variant numbers (also integers).
Rfr: Version Numbers.
-
major, minor, patch = version_numbers(version)
Extracts the major, minor, patch, and variant numbers (integers) from version (also an integer).
-
string = version_string(version)
Returns the 'x.y.z' string for version (an integer), where x, y, and z are the major, minor and patch numbers, respectively.
The vk table contains also the following version related information:
-
vk._VERSION: MoonVulkan version (a string).
-
vk.API_VERSION_n_m: Vulkan versions supported by MoonVulkan (e.g. vk.API_VERSION_1_0, vk.API_VERSION_2_0, …).
-
vk.API_VERSIONS: a table listing the supported versions as strings (e.g. { 'API_VERSION_1_0', 'API_VERSION_2_0', … }).
-
vk.HEADER_VERSION: Vulkan header version (VK_HEADER_VERSION). Note that this refers to the vulkan.h header that MoonVulkan is built against, which may not be aligned with the Vulkan implementation(s) installed on the system.
Common methods
The following methods are common to MoonVulkan objects.
-
handleRAW = object:raw( )
Returns the raw Vulkan handle (an integer) for the given object (e.g. instance:raw( ) returns a VkInstance handle cast to integer).
-
typestring = object:type( )
typestring = vk.type(object)
Returns a string denoting the type of the given object (e.g. instance:type( ) returns 'instance').
The vk.type( ) function returns nil if object is not a valid MoonVulkan object.
-
instance = object:instance( )
Returns the instance the given object belongs to.
-
device = object:device( )
Returns the device the given object belongs to.
-
parent = object:parent( )
Returns the parent object of the given object.
Constructors
MoonVulkan structs are plain Lua tables, and thus an instance of a struct is usually created manually by simply creating a new table with the specified fields.
Alternatively, for a few struct types, a table constructor is provided and can be used to save typing and reduce code verbosity. The constructor for a struct type, if available, is a function of the vk table, having the same name of the struct type, and returning a table initialized with the passed values.
Available constructors are listed just below the definitions of their respective types, see for example the extent2d type (notice that, for the sake of brevity, the return value is not indicated).
Note that whenever a table constructor accepts a flags parameter, this can be passed either as integer code, or as a table of admitted literals for that flags type.
The following examples illustrate the use of constructors for the extent2d and imagesubresource struct types:
-- Two alternative ways to create an instance of the 'offset2d' type:
ext1 = { width=300, height=200 } -- manually
ext2 = vk.extent2d(300, 200) -- using the table constructor
-- Two alternative way of passing an 'imageaspectflags' parameter:
subres1 = vk.imagesubresource(vk.IMAGE_ASPECT_COLOR_BIT, 0, 0) -- as an integer
subres2 = vk.imagesubresource({'color'}, 0, 0) -- as a table of admitted literals
Custom allocators
This section describes how to use custom memory allocators for Vulkan objects in MoonVulkan.
Almost all vk.create/allocate_xxx( ) functions accept the optional parameter allocator, that corresponds to the pAllocator parameter accepted by the underlying vkCreate/AllocateXxx( ) function of the Vulkan C API.
If the allocator parameter is not passed (or if it is nil), then the affected object(s) will be created/allocated with pAllocator=NULL, so that the Vulkan implementation will use its default. Otherwise, allocator must be a Lua lightuserdata encapsulating a valid pointer to the VkAllocationCallbacks to be used as pAllocator parameter.
How custom allocators are obtained/implemented is not a MoonVulkan concern. A working example is however provided in the examples/allocator directory.
Note that MoonVulkan has no means to check that the pointer encapsulated in a lightuserdata is actually what it is meant to be, so this functionality must be handled with care.
Notice also that there is no need (and no way) to pass the allocator at object destruction because MoonVulkan stores for this purpose the value it receives at object creation.
Creating surfaces
Surfaces in MoonVulkan can be created using the bindings to platform-specific API, or they can be created by means other than MoonVulkan itself - for example using MoonGLFW or similar libraries that access the Vulkan API directly to provide surface-creation services - and then passed to MoonVulkan using the created_surface( ) function.
The second method is more platform-agnostic, at least from the point of view of the Lua application, since most of the platform-specific details are handled by MoonGLFW (or by whatever is used in lieu of it).
The two methods are described in the following subsections.
Creating surfaces with the platform-specific API
The procedure to create a surface using the platform-specific API is the following:
-
Create a MoonVulkan instance, enabling (at least) the extensions required for the specific platform.
-
Use the platform-native API to create a window (or connection or whatever) and/or to obtain the window system specific handles and parameters.
-
Pass the relevant handles and parameters to Lua (handles must be passed as lightuserdata).
-
Create a MoonVulkan surface object using the platform-specific create_xxx_surface( ) function (where xxx may be xcb, xlib, etc.), passing it the handles and parameters obtained in the previous steps.
Note that MoonVulkan itself does not provide Lua bindings to platform native API (e.g. xcb_connect( ) etc.), so steps 2 and 3 involve writing some C/C++ code or relying on other Lua libraries.
Creating surfaces by other means
The procedure to create a surface by other means is summarized in the steps listed below, where MoonGLFW is used as example and prototype of 'other means': [5]
-
Get from MoonGLFW the list of extensions it needs in order to create a surface.
-
Create a MoonVulkan instance, enabling (at least) the extensions required by MoonGLFW.
-
Use MoonGLFW to create (a window and) a surface for the instance. In order to do this, we need the raw VkInstance handle which we can retrieve using the instance:raw( ) method. MoonGLFW will return the raw VkSurfaceKHR handle.
-
Finally, pass the VkSurfaceKHR handle to MoonVulkan using created_surface( ).
Once passed to created_surface( ), the surface handle is to be considered as owned by MoonVulkan. In particular, the surface MUST NOT be destroyed (vkDestroySurfaceKHR) by means other than those provided by MoonVulkan (that is, by automatic destruction at exit or by explictly calling destroy_surface( )).
A working example can be found in the code snippets section.
Data handling
This section describes additional utilities that can be used to encode data from Lua variables to binary strings and viceversa.
-
val1, …, valN = flatten(table)
Flattens out the given table and returns the terminal elements in the order they are found.
Similar to Lua’s table.unpack( ), but it also unpacks any nested table. Only the array part of the table and of nested tables is considered.
-
size = sizeof(datatype)
Returns the size in bytes of the given datatype.
-
data = pack(datatype, val1, …, valN)
data = pack(datatype, table)
Packs the numbers val1, …, valN, encoding them according to the given datatype, and returns the resulting binary string.
The values may also be passed in a (possibly nested) table. Only the array part of the table (and of nested tables) is considered.
datatype: 'byte', 'ubyte', 'int8', 'uint8',
'short', 'ushort', 'int16', 'uint16',
'int', 'uint', 'int32', 'uint32',
'long', 'ulong', 'int64', 'uint64',
'float', 'double'.
(byte, short, int and long are aliases for int8, int16, int32 and int64, respectively).
The following functions can be used to pack (serialize) data when updating descriptor sets with template.
-
data = pack_descriptorimageinfo(sampler, image_view, imagelayout)
Constructs a VkDescriptorImageInfo with the given parameters and returns it as a binary string.
-
data = pack_descriptorbufferinfo(buffer, offset, range)
offset: integer
range: integer or 'whole size' (defaults to 'whole size')
Constructs a VkDescriptorBufferInfo with the given parameters and returns it as a binary string.
-
data = pack_bufferview(buffer_view, application_data)
Returns a binary string obtained by serializing buffer_view and concatenating it with application_data (a binary string).
The application_data binary string encodes application specific data and may be constructed using Lua’s string.pack( ).
Tracing utilities
-
trace_objects(boolean)
Enable/disable tracing of objects creation and destruction (which by default is disabled). If enabled, a printf is generated whenever an object is created/allocated or destructed/freed, indicating the object type and the value of its raw Vulkan handle.
-
t = now( )
Returns the current time in seconds (a Lua number).
This is implemented with monotonic clock_gettime(3), if available, or with gettimeofday(3) otherwise.
-
dt = since(t)
Returns the time in seconds (a Lua number) elapsed since the time t, previously obtained with the now( ) function.
Platforms support
A few MoonVulkan functions are available only on specific platforms, in the same way the underlying Vulkan functions are. In order to use such functions, MoonVulkan must be compiled as described in this section.
To enable support for a specific platform, set the PLATFORM_XXX environment variable before compiling MoonVulkan (XXX here stands for XCB, XLIB, WAYLAND, etc.). For example:
[moonvulkan]$ export PLATFORM_XCB=1 # enable XCB support
[moonvulkan]$ export PLATFORM_XLIB=1 # enable XLIB support
[moonvulkan]$ make && sudo make install # compile and install MoonVulkan
As a prerequisite, you’ll need to make sure that the platform libraries are installed on the system and that the relevant header files are where vulkan.h expects them to be.
(Functions that need platform-specific support are those that have a PLATFORM_XXX link to this section in their references. For example, the create_xlib_surface( ) function has a PLATFORM_XLIB link, meaning that it requires MoonVulkan to be compiled with the PLATFORM_XLIB environment variable set).
Code snippets
clearvalue = { color = { 0.2, 0.5, 0.1, 1.0 } } -- t defaults to 'float32'
clearvalue = { color = { 0.2, 0.5, 0.1, 1.0, t='float32' } }
clearvalue = { color = { 20, 112, 200, 1, t='uint32' } }
clearvalue = { depth = 1.0, stencil = 0 }
-- Alternative and equivalent ways to assign values of the 'blendop' enum type
-- (whose hint is vk.BLEND_OP_XXX):
op1 = vk.BLEND_OP_ADD
op2 = 'add' -- XXX=ADD
op3 = vk.BLEND_OP_REVERSE_SUBTRACT
op4 = 'reverse subtract' -- XXX=REVERSE_SUBTRACT
print(op1) --> 'add'
print(op2) --> 'add'
print(op3) --> 'reverse subtract'
print(op4) --> 'reverse subtract'
print(op1 == 'add') --> true
print(op3 == op4) --> true
-- List the literals admitted by the 'blendop' enum type:
ops = vk.enum('blendop')
print(table.concat(ops, ', ')) --> 'add', 'subtract', 'reverse subtract', 'min', 'max'
-- Two alternative equivalent ways to produce a 'stencilfaceflags' value:
code1 = vk.STENCIL_FACE_FRONT_BIT | vk.STENCIL_FACE_BACK_BIT
code2 = vk.stencilfaceflags('front', 'back')
assert(code1 == code2) -- true
print(code1) --> 3
print(vk.stencilfaceflags(code1)) --> front back
print(vk.stencilfaceflags(code2)) --> ditto
if (code1 & vk.STENCIL_FACE_FRONT_BIT) ~= 0 then -- NB: 0 is not false in Lua
print("'front' bit is set")
else
print("'front' bit is not set")
end
glfw = require("moonglfw")
vk = require("moonvulkan")
-- 1) Get the list of extensions required by GLFW to create surfaces:
extension_names = glfw.get_required_instance_extensions()
print("Required extensions: " .. table.concat(extension_names, ', '))
-- 2) Create a Vulkan instance, enabling the required extensions:
instance = vk.create_instance({ enabled_extension_names = extension_names })
-- 3.1) Create a window, not tied to any particular API:
glfw.window_hint('client api', 'no api')
window = glfw.create_window(640, 480, "My first GLFW/Vulkan window")
-- 3.2) Create a surface for the window:
surfaceRAW = glfw.create_window_surface(window, instance:raw())
-- 4) Finally, pass the surface to MoonVulkan:
surface = vk.created_surface(instance, surfaceRAW)
-- Event loop:
while not glfw.window_should_close(window) do
glfw.poll_events()
end
print("MoonVulkan version:", vk._VERSION)
print("Header version (vulkan.h):", vk.HEADER_VERSION)
print("Supported versions:", table.concat(vk.API_VERSIONS, ","))
for _, s in ipairs(vk.API_VERSIONS) do
local ver = vk[s]
local major, minor, patch = vk.version_numbers(ver)
print(s .. ": " .. ver .. " (" .. vk.version_string(ver) ..")" ..
" major="..major.." minor="..minor.." patch="..patch)
end
if not vk.API_VERSION_1_0 then print("API_VERSION_1_0 is not supported") end
if not vk.API_VERSION_2_0 then print("API_VERSION_2_0 is not supported") end
assert(vk.make_version(1, 0, 0) == vk.API_VERSION_1_0) --> true