shvulkan pre-release
by mrsinho.
Loading...
Searching...
No Matches
shVulkan.h File Reference
#include <vulkan/vulkan.h>
#include <stdint.h>
#include <stdlib.h>

Go to the source code of this file.

Data Structures

struct  ShVkPipeline
 Structure representing a Vulkan pipeline. More...
 
struct  ShVkPipelinePool
 Represents a collection of Vulkan pipeline objects and their related resources. More...
 

Macros

#define SH_TRUE   1
 
#define SH_FALSE   0
 
#define VK_MAKE_API_VERSION(variant, major, minor, patch)
 
#define shVkError(condition, error_msg, failure_expression)
 Error-checking macro for Vulkan conditions.
 
#define shVkResultError(result, error_msg, failure_expression)
 Error-checking macro for Vulkan VkResult.
 
#define SH_MAX_STACK_VALIDATION_LAYER_COUNT   32
 
#define SH_MAX_STACK_QUEUE_FAMILY_COUNT   32
 
#define SH_MAX_STACK_PHYSICAL_DEVICE_COUNT   8
 
#define SH_MAX_STACK_QUEUE_COUNT   64
 
#define SH_MAX_STACK_DEVICE_SURFACE_FORMAT_COUNT   256
 
#define SH_MAX_STACK_SURFACE_PRESENT_MODE_COUNT   16
 
#define SH_MAX_STACK_DEVICE_COLOR_FORMATS_QUERIES   44
 
#define SH_FORMAT_UINT   0
 
#define SH_FORMAT_SINT   1
 
#define SH_FORMAT_SFLOAT   2
 
#define SH_FORMAT_UNDEFINED   3
 
#define SH_VEC1_SIGNED_FLOAT   VK_FORMAT_R32_SFLOAT
 
#define SH_VEC2_SIGNED_FLOAT   VK_FORMAT_R32G32_SFLOAT
 
#define SH_VEC3_SIGNED_FLOAT   VK_FORMAT_R32G32B32_SFLOAT
 
#define SH_VEC4_SIGNED_FLOAT   VK_FORMAT_R32G32B32A32_SFLOAT
 
#define SH_VEC1_SIGNED_DOUBLE   VK_FORMAT_R64_SFLOAT
 
#define SH_VEC2_SIGNED_DOUBLE   VK_FORMAT_R64G64_SFLOAT
 
#define SH_VEC3_SIGNED_DOUBLE   VK_FORMAT_R64G64B64_SFLOAT
 
#define SH_VEC4_SIGNED_DOUBLE   VK_FORMAT_R64G64B64A64_SFLOAT
 
#define SH_VEC1_SIGNED_INT   VK_FORMAT_R32_SINT
 
#define SH_VEC2_SIGNED_INT   VK_FORMAT_R32G32_SINT
 
#define SH_VEC3_SIGNED_INT   VK_FORMAT_R32G32B32_SINT
 
#define SH_VEC4_SIGNED_INT   VK_FORMAT_R32G32B32A32_SINT
 
#define SH_VEC1_UNSIGNED_INT   VK_FORMAT_R32_UINT
 
#define SH_VEC2_UNSIGNED_INT   VK_FORMAT_R32G32_UINT
 
#define SH_VEC3_UNSIGNED_INT   VK_FORMAT_R32G32B32_UINT
 
#define SH_VEC4_UNSIGNED_INT   VK_FORMAT_R32G32B32A32_UINT
 
#define SH_VEC1_UNSIGNED_LONG   VK_FORMAT_R64_UINT
 
#define SH_VEC2_UNSIGNED_LONG   VK_FORMAT_R64G64_UINT
 
#define SH_VEC3_UNSIGNED_LONG   VK_FORMAT_R64G64B64_UINT
 
#define SH_VEC4_UNSIGNED_LONG   VK_FORMAT_R64G64B64A64_UINT
 
#define SH_MAX_STACK_BUFFER_REGION_COUNT   256
 
#define SH_MAX_PIPELINE_VERTEX_BINDING_COUNT   32
 
#define SH_MAX_PIPELINE_VERTEX_ATTRIBUTE_COUNT   32
 
#define SH_MAX_PIPELINE_SHADER_STAGE_COUNT   6
 
#define SH_MAX_PIPELINE_SUBPASS_COLOR_ATTACHMENT_COUNT   9
 
#define SH_PIPELINE_POOL_MAX_PIPELINE_COUNT   64
 
#define SH_MAX_PIPELINE_POOL_DESCRIPTOR_COUNT   64
 
#define shAllocatePipelinePool()
 Allocates a new ShVkPipelinePool structure.
 
#define shFreePipelinePool   free
 Frees the memory of an ShVkPipelinePool structure.
 

Typedefs

typedef enum ShImageChannelTypeFlags ShImageChannelTypeFlags
 
typedef struct ShVkPipeline ShVkPipeline
 Structure representing a Vulkan pipeline.
 
typedef struct ShVkPipelinePool ShVkPipelinePool
 Represents a collection of Vulkan pipeline objects and their related resources.
 

Enumerations

enum  ShImageChannelTypeFlags {
  SH_IMAGE_CHANNEL_TYPE_UNORM = 1 << 0 , SH_IMAGE_CHANNEL_TYPE_SNORM = 1 << 1 , SH_IMAGE_CHANNEL_TYPE_UINT = 1 << 2 , SH_IMAGE_CHANNEL_TYPE_SINT = 1 << 3 ,
  SH_IMAGE_CHANNEL_TYPE_SFLOAT = 1 << 4 , SH_IMAGE_CHANNEL_TYPE_UNDEFINED = UINT32_MAX
}
 

Functions

const char * shTranslateVkResult (VkResult vk_result)
 Translates a VkResult enum into a literal string.
 
uint8_t shFindValidationLayer (const char *validation_layer_name)
 Searches for a specific Vulkan validation layer.
 
uint8_t shCreateInstance (const char *application_name, const char *engine_name, const uint8_t enable_validation_layers, const uint32_t extension_count, const char **pp_extension_names, uint32_t api_version, VkInstance *p_instance)
 Creates a Vulkan instance.
 
uint8_t shGetPhysicalDeviceQueueFamilies (VkPhysicalDevice physical_device, VkSurfaceKHR surface, uint32_t *p_queue_family_count, uint32_t *p_graphics_queue_family_count, uint32_t *p_surface_queue_family_count, uint32_t *p_compute_queue_family_count, uint32_t *p_transfer_queue_family_count, uint32_t *p_graphics_queue_family_indices, uint32_t *p_surface_queue_family_indices, uint32_t *p_compute_queue_family_indices, uint32_t *p_transfer_queue_family_indices, VkQueueFamilyProperties *p_queue_families_properties)
 Retrieves the queue family indices for a physical device.
 
uint8_t shGetQueueFamilySurfaceSupport (VkPhysicalDevice physical_device, uint32_t queue_family_index, VkSurfaceKHR surface, uint8_t *p_support)
 Checks if a queue family supports presenting to a surface.
 
uint8_t shSelectPhysicalDevice (VkInstance instance, VkSurfaceKHR surface, VkQueueFlags requirements, VkPhysicalDevice *p_physical_device, VkPhysicalDeviceProperties *p_physical_device_properties, VkPhysicalDeviceFeatures *p_physical_device_features, VkPhysicalDeviceMemoryProperties *p_physical_device_memory_properties)
 Selects a physical device that meets specified requirements.
 
uint8_t shGetPhysicalDeviceSurfaceSupport (VkPhysicalDevice physical_device, uint32_t queue_family_index, VkSurfaceKHR surface, uint8_t *p_supported)
 Queries if a queue family supports presenting to a surface.
 
uint8_t shGetPhysicalDeviceSurfaceCapabilities (VkPhysicalDevice physical_device, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR *p_surface_capabilities)
 Retrieves the surface capabilities of a physical device.
 
uint8_t shQueryForDeviceQueueInfo (uint32_t queue_family_index, uint32_t queue_count, float *p_queue_priorities, uint8_t protected, VkDeviceQueueCreateInfo *p_device_queue_info)
 Queries information for device queue creation.
 
uint8_t shSetLogicalDevice (VkPhysicalDevice physical_device, VkDevice *p_device, uint32_t extension_count, char **pp_extension_names, uint32_t device_queue_count, VkDeviceQueueCreateInfo *p_device_queue_infos)
 Sets up a Vulkan logical device.
 
uint8_t shGetDeviceQueues (VkDevice device, uint32_t queue_count, uint32_t *p_queue_family_indices, VkQueue *p_queues)
 Retrieves the Vulkan queues from a device.
 
uint8_t shCheckSupportedDeviceColorFormat (VkPhysicalDevice physical_device, VkFormat format, uint8_t *p_color_attachment_supported)
 
uint8_t shFindSupportedDeviceColorFormats (VkPhysicalDevice physical_device, uint32_t min_channel_count, uint32_t max_channel_count, uint32_t min_channel_size, uint32_t max_channel_size, ShImageChannelTypeFlags channel_types, uint32_t *p_supported_format_count, VkFormat *p_supported_formats, uint32_t *p_channels_count, uint32_t *p_single_channels_sizes, uint32_t *p_channels_types)
 
uint8_t shCreateSwapchain (VkDevice device, VkPhysicalDevice physical_device, VkSurfaceKHR surface, VkFormat image_format, VkFormat *p_image_format, uint32_t swapchain_image_count, VkSharingMode image_sharing_mode, uint8_t vsync, uint32_t *p_swapchain_image_count, VkSwapchainKHR *p_swapchain)
 Creates a Vulkan swapchain.
 
uint8_t shCombineMaxSamples (VkPhysicalDeviceProperties physical_device_properties, uint32_t sample_count, uint8_t combine_color_sample, uint8_t combine_depth_sample, uint32_t *p_sample_count)
 Combines sample counts based on physical device properties.
 
uint8_t shGetSwapchainImages (VkDevice device, VkSwapchainKHR swapchain, uint32_t *p_swapchain_image_count, VkImage *p_swapchain_images)
 Retrieves the images in a swapchain.
 
uint8_t shCreateImageView (VkDevice device, VkImage image, VkImageViewType view_type, VkImageAspectFlagBits image_aspect, uint32_t mip_levels, VkFormat format, VkImageView *p_image_view)
 Creates a Vulkan image view.
 
uint8_t shCreateSwapchainImageViews (VkDevice device, VkFormat format, uint32_t swapchain_image_count, VkImage *p_swapchain_images, VkImageView *p_swapchain_image_views)
 Creates image views for swapchain images.
 
uint8_t shCreateCommandPool (VkDevice device, uint32_t queue_family_index, VkCommandPool *p_cmd_pool)
 Creates a Vulkan command pool.
 
uint8_t shAllocateCommandBuffers (VkDevice device, VkCommandPool cmd_pool, uint32_t cmd_buffer_count, VkCommandBuffer *p_cmd_buffer)
 Allocates command buffers from a command pool.
 
uint8_t shCreateRenderpassAttachment (VkFormat format, uint32_t sample_count, VkAttachmentLoadOp load_treatment, VkAttachmentStoreOp store_treatment, VkAttachmentLoadOp stencil_load_treatment, VkAttachmentStoreOp stencil_store_treatment, VkImageLayout initial_layout, VkImageLayout final_layout, VkAttachmentDescription *p_attachment_description)
 Creates a Vulkan render pass attachment description.
 
uint8_t shCreateRenderpassAttachmentReference (uint32_t attachment_idx, VkImageLayout layout, VkAttachmentReference *p_attachment_reference)
 Creates a Vulkan render pass attachment reference.
 
uint8_t shCreateSubpass (VkPipelineBindPoint bind_point, uint32_t input_attachment_count, VkAttachmentReference *p_input_attachments_reference, uint32_t color_attachment_count, VkAttachmentReference *p_color_attachments_reference, VkAttachmentReference *p_depth_stencil_attachment_reference, VkAttachmentReference *p_resolve_attachment_reference, uint32_t preserve_attachment_count, uint32_t *p_preserve_attachments, VkSubpassDescription *p_subpass)
 Creates a Vulkan subpass description.
 
uint8_t shCreateRenderpass (VkDevice device, uint32_t attachment_count, VkAttachmentDescription *p_attachments_descriptions, uint32_t subpass_count, VkSubpassDescription *p_subpasses, VkRenderPass *p_renderpass)
 Creates a Vulkan render pass.
 
uint8_t shCreateFramebuffer (VkDevice device, VkRenderPass renderpass, uint32_t image_view_count, VkImageView *p_image_views, uint32_t x, uint32_t y, uint32_t z, VkFramebuffer *p_framebuffer)
 Creates a Vulkan framebuffer.
 
uint8_t shWaitDeviceIdle (VkDevice device)
 Waits for a Vulkan device to become idle.
 
uint8_t shDestroySwapchain (VkDevice device, VkSwapchainKHR swapchain)
 Destroys a Vulkan swapchain.
 
uint8_t shDestroyFramebuffers (VkDevice device, uint32_t framebuffer_count, VkFramebuffer *p_framebuffers)
 Destroys Vulkan framebuffers.
 
uint8_t shDestroyImageViews (VkDevice device, uint32_t image_view_count, VkImageView *p_image_views)
 Destroys Vulkan image views.
 
uint8_t shDestroySurface (VkInstance instance, VkSurfaceKHR surface)
 Destroys a Vulkan surface.
 
uint8_t shDestroyCommandBuffers (VkDevice device, VkCommandPool cmd_pool, uint32_t cmd_buffer_count, VkCommandBuffer *p_cmd_buffers)
 Destroys Vulkan command buffers.
 
uint8_t shDestroyCommandPool (VkDevice device, VkCommandPool cmd_pool)
 Destroys a Vulkan command pool.
 
uint8_t shDestroyRenderpass (VkDevice device, VkRenderPass render_pass)
 Destroys a Vulkan render pass.
 
uint8_t shDestroyDevice (VkDevice device)
 Destroys a Vulkan device.
 
uint8_t shDestroyInstance (VkInstance instance)
 Destroys a Vulkan instance.
 
uint8_t shResetCommandBuffer (VkCommandBuffer cmd_buffer)
 Resets a Vulkan command buffer.
 
uint8_t shBeginCommandBuffer (VkCommandBuffer cmd_buffer)
 Begins recording commands into a Vulkan command buffer.
 
uint8_t shEndCommandBuffer (VkCommandBuffer cmd_buffer)
 Ends recording commands into a Vulkan command buffer.
 
uint8_t shCmdDispatch (VkCommandBuffer cmd_buffer, uint32_t group_count_x, uint32_t group_count_y, uint32_t group_count_z)
 Dispatches compute work from a Vulkan command buffer.
 
uint8_t shQueueSubmit (uint32_t cmd_buffer_count, VkCommandBuffer *p_cmd_buffers, VkQueue queue, VkFence fence, uint32_t semaphores_to_wait_for_count, VkSemaphore *p_semaphores_to_wait_for, VkPipelineStageFlags wait_stage, uint32_t signal_semaphore_count, VkSemaphore *p_signal_semaphores)
 Submits command buffers to a Vulkan queue.
 
uint8_t shWaitForQueue (VkQueue queue)
 Waits for a Vulkan queue to become idle.
 
uint8_t shCreateFences (VkDevice device, uint32_t fence_count, uint8_t signaled, VkFence *p_fences)
 Creates Vulkan fences.
 
uint8_t shCreateSemaphores (VkDevice device, uint32_t semaphore_count, VkSemaphore *p_semaphores)
 Creates Vulkan semaphores.
 
uint8_t shDestroyFences (VkDevice device, uint32_t fence_count, VkFence *p_fences)
 Destroys Vulkan fences.
 
uint8_t shDestroySemaphores (VkDevice device, uint32_t semaphore_count, VkSemaphore *p_semaphores)
 Destroys Vulkan semaphores.
 
uint8_t shResetFences (VkDevice device, uint32_t fence_count, VkFence *p_fences)
 Resets Vulkan fences.
 
uint8_t shResetSemaphores (VkDevice device, uint32_t semaphore_count, VkSemaphore *p_semaphores)
 Resets Vulkan semaphores.
 
uint8_t shWaitForFences (VkDevice device, uint32_t fence_count, VkFence *p_fences, uint8_t wait_for_all, uint64_t timeout_ns)
 Waits for Vulkan fences to become signaled.
 
uint8_t shWaitForSemaphores (VkDevice device, uint32_t semaphore_count, VkSemaphore *p_semaphores, uint8_t wait_for_all, uint64_t timeout_ns, uint64_t *p_semaphores_values)
 Waits for Vulkan semaphores to become signaled.
 
uint8_t shAcquireSwapchainImage (VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout_ns, VkSemaphore acquired_signal_semaphore, VkFence acquired_signal_fence, uint32_t *p_swapchain_image_index, uint8_t *p_swapchain_suboptimal)
 Acquires an image from the Vulkan swapchain.
 
uint8_t shBeginRenderpass (VkCommandBuffer graphics_cmd_buffer, VkRenderPass renderpass, int32_t render_offset_x, int32_t render_offset_y, uint32_t render_size_x, uint32_t render_size_y, uint32_t clear_value_count, VkClearValue *p_clear_values, VkFramebuffer framebuffer)
 Begins a Vulkan render pass.
 
uint8_t shEndRenderpass (VkCommandBuffer graphics_cmd_buffer)
 Ends a Vulkan render pass.
 
uint8_t shDraw (VkCommandBuffer graphics_cmd_buffer, uint32_t vertex_count, uint32_t first_vertex, uint32_t instance_count, uint32_t first_instance)
 Records a draw command into a Vulkan command buffer.
 
uint8_t shDrawIndexed (VkCommandBuffer graphics_cmd_buffer, uint32_t index_count, uint32_t instance_count, uint32_t first_index, int32_t vertex_offset, uint32_t first_instance)
 Records an indexed draw command into a Vulkan command buffer.
 
uint8_t shQueuePresentSwapchainImage (VkQueue present_queue, uint32_t semaphores_to_wait_for_count, VkSemaphore *p_semaphores_to_wait_for, VkSwapchainKHR swapchain, uint32_t swapchain_image_idx)
 Presents an image from a Vulkan swapchain to the screen.
 
uint8_t shCreateBuffer (VkDevice device, uint32_t size, VkBufferUsageFlags usage, VkSharingMode sharing_mode, VkBuffer *p_buffer)
 Creates a Vulkan buffer.
 
uint8_t shGetMemoryType (VkDevice device, VkPhysicalDevice physical_device, VkMemoryPropertyFlags property_flags, uint32_t *p_memory_type_index)
 Retrieves the memory type index that supports the specified memory properties.
 
uint8_t shAllocateBufferMemory (VkDevice device, VkPhysicalDevice physical_device, VkBuffer buffer, VkMemoryPropertyFlags property_flags, VkDeviceMemory *p_memory)
 Allocates memory for a Vulkan buffer.
 
uint8_t shCopyBuffer (VkCommandBuffer transfer_cmd_buffer, VkBuffer src_buffer, uint32_t src_offset, uint32_t dst_offset, uint64_t size, VkBuffer dst_buffer)
 Copies data from one Vulkan buffer to another.
 
uint8_t shCopyBufferRegions (VkCommandBuffer transfer_cmd_buffer, VkBuffer src_buffer, uint32_t region_count, uint32_t *p_src_offsets, uint32_t *p_dst_offsets, uint32_t *p_sizes, VkBuffer dst_buffer)
 Copies multiple regions of data from one Vulkan buffer to another.
 
uint8_t shCopyImage (VkCommandBuffer transfer_cmd_buffer, uint32_t width, uint32_t height, VkImageAspectFlags src_image_aspect, VkImageAspectFlags dst_image_aspect, VkImage src_image, VkImage dst_image)
 
uint8_t shBindBufferMemory (VkDevice device, VkBuffer buffer, uint32_t offset, VkDeviceMemory buffer_memory)
 Binds a Vulkan buffer to a specified memory offset.
 
uint8_t shReadMemory (VkDevice device, VkDeviceMemory memory, uint32_t offset, uint64_t data_size, void **pp_map_data, void *p_dst_data)
 Reads data from a Vulkan memory object.
 
uint8_t shUnmapMemory (VkDevice device, VkDeviceMemory memory)
 
uint8_t shWriteMemory (VkDevice device, VkDeviceMemory memory, uint32_t offset, uint32_t data_size, void *p_data)
 Writes data to a Vulkan memory object.
 
uint8_t shClearBufferMemory (VkDevice device, VkBuffer buffer, VkDeviceMemory memory)
 Clears memory associated with a Vulkan buffer.
 
uint8_t shCreateImage (VkDevice device, VkImageType type, uint32_t x, uint32_t y, uint32_t z, VkFormat format, uint32_t mip_levels, VkSampleCountFlagBits sample_count, VkImageTiling image_tiling, VkImageUsageFlags usage, VkSharingMode sharing_mode, VkImage *p_image)
 Creates a Vulkan image.
 
uint8_t shAllocateImageMemory (VkDevice device, VkPhysicalDevice physical_device, VkImage image, VkMemoryPropertyFlags memory_property_flags, VkDeviceMemory *p_image_memory)
 Allocates memory for a Vulkan image.
 
uint8_t shBindImageMemory (VkDevice device, VkImage image, uint32_t offset, VkDeviceMemory image_memory)
 Binds a Vulkan image to a specified memory offset.
 
uint8_t shClearImageMemory (VkDevice device, VkImage image, VkDeviceMemory image_memory)
 Clears memory associated with a Vulkan image.
 
uint8_t shGetImageSubresourceLayout (VkDevice device, VkImage image, VkImageAspectFlags image_aspect_mask, VkSubresourceLayout *p_subresource_layout)
 
uint8_t shSetBufferMemoryBarrier (VkDevice device, VkCommandBuffer cmd_buffer, VkBuffer buffer, VkAccessFlags access_before_barrier, VkAccessFlags access_after_barrier, uint32_t performing_queue_family_index_before_barrier, uint32_t performing_queue_family_index_after_barrier, VkPipelineStageFlags pipeline_stage_before_barrier, VkPipelineStageFlags pipeline_stage_after_barrier)
 Creates a buffer memory barrier.
 
uint8_t shSetImageMemoryBarrier (VkDevice device, VkCommandBuffer cmd_buffer, VkImage image, VkImageAspectFlags image_aspect_mask, VkAccessFlags access_before_barrier, VkAccessFlags access_after_barrier, VkImageLayout image_layout_before_barrier, VkImageLayout image_layout_after_barrier, uint32_t performing_queue_family_index_before_barrier, uint32_t performing_queue_family_index_after_barrier, VkPipelineStageFlags pipeline_stage_before_barrier, VkPipelineStageFlags pipeline_stage_after_barrier)
 Creates an image memory barrier.
 
uint8_t shGetMemoryBudgetProperties (VkPhysicalDevice physical_device, VkPhysicalDeviceMemoryBudgetPropertiesEXT *p_memory_budget_properties)
 Retrieves memory budget properties for a Vulkan physical device.
 
uint8_t shBindVertexBuffers (VkCommandBuffer graphics_cmd_buffer, uint32_t first_binding, uint32_t binding_count, VkBuffer *p_vertex_buffers, VkDeviceSize *p_vertex_offsets)
 Binds vertex buffers to a Vulkan command buffer.
 
uint8_t shBindIndexBuffer (VkCommandBuffer graphics_cmd_buffer, uint32_t index_offset, VkBuffer index_buffer)
 Binds an index buffer to a Vulkan command buffer.
 
uint8_t shSetVertexBinding (uint32_t binding, uint32_t size, VkVertexInputRate input_rate, VkVertexInputBindingDescription *p_vertex_input_binding)
 Sets the vertex input binding description.
 
uint8_t shSetVertexAttribute (uint32_t location, uint32_t binding, VkFormat format, uint32_t offset, VkVertexInputAttributeDescription *p_vertex_input_attribute)
 Sets the vertex attribute description.
 
uint8_t shSetVertexInputState (uint32_t vertex_binding_count, VkVertexInputBindingDescription *p_vertex_bindings, uint32_t vertex_attribute_count, VkVertexInputAttributeDescription *p_vertex_attributes, VkPipelineVertexInputStateCreateInfo *p_vertex_input_state)
 Sets the vertex input state for a pipeline.
 
uint8_t shCreateInputAssembly (VkPrimitiveTopology primitive_topology, VkBool32 primitive_restart_enable, VkPipelineInputAssemblyStateCreateInfo *p_input_assembly)
 Creates the input assembly state for a pipeline.
 
uint8_t shCreateRasterizer (VkPolygonMode polygon_mode, VkCullModeFlagBits cull_mode, VkPipelineRasterizationStateCreateInfo *p_rasterizer)
 Creates the rasterization state for a pipeline.
 
uint8_t shSetMultisampleState (VkSampleCountFlagBits sample_count, float min_sample_shading_size, VkPipelineMultisampleStateCreateInfo *p_multisample_state)
 Sets the multisample state for a pipeline.
 
uint8_t shSetViewport (uint32_t viewport_pos_x, uint32_t viewport_pos_y, uint32_t viewport_width, uint32_t viewport_height, VkViewport *p_viewport, uint32_t scissors_pos_x, uint32_t scissors_pos_y, uint32_t scissors_width, uint32_t scissors_height, VkRect2D *p_scissors, VkPipelineViewportStateCreateInfo *p_viewport_state)
 Sets the viewport and scissor state for a pipeline.
 
uint8_t shColorBlendSettings (uint8_t enable_color_blending, uint8_t enable_alpha_blending, uint32_t subpass_color_attachment_count, VkPipelineColorBlendAttachmentState *p_color_blend_attachment_states, VkPipelineColorBlendStateCreateInfo *p_color_blend_state)
 Configures color blending and alpha blending states.
 
uint8_t shCreateShaderModule (VkDevice device, uint32_t size, char *code, VkShaderModule *p_shader_module)
 Creates a Vulkan shader module.
 
uint8_t shCreateShaderStage (VkShaderModule shader_module, VkShaderStageFlags shader_stage_flag, VkPipelineShaderStageCreateInfo *p_shader_stage)
 Creates a Vulkan shader stage.
 
uint8_t shSetPushConstants (VkShaderStageFlags shader_stage, uint32_t offset, uint32_t size, VkPushConstantRange *p_push_constant_range)
 Sets push constants for a shader stage.
 
uint8_t shCreateDescriptorSetLayoutBinding (uint32_t binding, VkDescriptorType descriptor_type, uint32_t descriptor_set_count, VkShaderStageFlags shader_stage, VkDescriptorSetLayoutBinding *p_binding)
 Creates a descriptor set layout binding.
 
uint8_t shCreateDescriptorSetLayout (VkDevice device, uint32_t binding_count, VkDescriptorSetLayoutBinding *p_bindings, VkDescriptorSetLayout *p_descriptor_set_layout)
 Creates a descriptor set layout.
 
uint8_t shCreateDescriptorPool (VkDevice device, uint32_t pool_size_count, VkDescriptorPoolSize *p_pool_sizes, VkDescriptorPool *p_descriptor_pool)
 Creates a descriptor pool.
 
uint8_t shSetDescriptorBufferInfo (VkBuffer buffer, uint32_t buffer_offset, uint32_t buffer_size, VkDescriptorBufferInfo *p_buffer_info)
 Sets buffer information for a descriptor buffer.
 
uint8_t shAllocateDescriptorSetUnits (VkDevice device, VkDescriptorPool descriptor_pool, VkDescriptorType descriptor_type, uint32_t binding, uint32_t descriptor_set_unit_count, VkDescriptorSetLayout *p_descriptor_set_layouts, VkDescriptorSet *p_descriptor_sets, VkDescriptorBufferInfo *p_buffer_infos, VkWriteDescriptorSet *p_write_descriptor_sets)
 Allocates descriptor sets from a descriptor pool.
 
uint8_t shCreatePipelineLayout (VkDevice device, uint32_t push_constant_range_count, VkPushConstantRange *p_push_constants_range, uint32_t src_descriptor_set_layout_count, VkDescriptorSetLayout *p_src_descriptor_set_layouts, VkPipelineLayout *p_pipeline_layout)
 Creates a pipeline layout.
 
uint8_t shDestroyDescriptorPool (VkDevice device, VkDescriptorPool descriptor_pool)
 Destroys a Vulkan descriptor pool.
 
uint8_t shDestroyDescriptorSetLayout (VkDevice device, VkDescriptorSetLayout descriptor_set_layout)
 Destroys a Vulkan descriptor set layout.
 
uint8_t shDestroyShaderModule (VkDevice device, VkShaderModule shader_module)
 Destroys a Vulkan shader module.
 
uint8_t shDestroyPipelineLayout (VkDevice device, VkPipelineLayout pipeline_layout)
 Destroys a Vulkan pipeline layout.
 
uint8_t shDestroyPipeline (VkDevice device, VkPipeline pipeline)
 Destroys a Vulkan pipeline.
 
uint8_t shClearPipeline (ShVkPipeline *p_pipeline)
 Clears the pipeline structure.
 
uint8_t shPipelineSetVertexBinding (uint32_t binding, uint32_t size, VkVertexInputRate input_rate, ShVkPipeline *p_pipeline)
 Sets vertex binding information in the pipeline.
 
uint8_t shPipelineSetVertexAttribute (uint32_t location, uint32_t binding, VkFormat format, uint32_t offset, ShVkPipeline *p_pipeline)
 Sets vertex attribute information in the pipeline.
 
uint8_t shPipelineSetVertexInputState (ShVkPipeline *p_pipeline)
 Sets vertex input state information in the pipeline.
 
uint8_t shPipelineCreateInputAssembly (VkPrimitiveTopology primitive_topology, VkBool32 primitive_restart_enable, ShVkPipeline *p_pipeline)
 Creates input assembly state information for the pipeline.
 
uint8_t shPipelineCreateRasterizer (VkPolygonMode polygon_mode, VkCullModeFlagBits cull_mode, ShVkPipeline *p_pipeline)
 Creates rasterizer state information for the pipeline.
 
uint8_t shPipelineSetMultisampleState (VkSampleCountFlagBits sample_count, float min_sample_shading_size, ShVkPipeline *p_pipeline)
 Sets multisample state information in the pipeline.
 
uint8_t shPipelineSetViewport (uint32_t viewport_pos_x, uint32_t viewport_pos_y, uint32_t viewport_width, uint32_t viewport_height, uint32_t scissors_pos_x, uint32_t scissors_pos_y, uint32_t scissors_width, uint32_t scissors_height, ShVkPipeline *p_pipeline)
 Sets viewport and scissor information in the pipeline.
 
uint8_t shPipelineColorBlendSettings (uint8_t enable_color_blending, uint8_t enable_alpha_blending, uint32_t subpass_color_attachment_count, ShVkPipeline *p_pipeline)
 Configures color blending settings in the pipeline.
 
uint8_t shPipelineCreateShaderModule (VkDevice device, uint32_t size, char *code, ShVkPipeline *p_pipeline)
 Creates a shader module and adds it to the pipeline.
 
uint8_t shPipelineCreateShaderStage (VkShaderStageFlags shader_stage, ShVkPipeline *p_pipeline)
 Creates a shader stage and adds it to the pipeline.
 
uint8_t shPipelineSetPushConstants (VkShaderStageFlags shader_stage, uint32_t offset, uint32_t size, ShVkPipeline *p_pipeline)
 Sets push constants in the pipeline.
 
uint8_t shPipelineCreateLayout (VkDevice device, uint32_t first_descriptor_set_layout, uint32_t descriptor_set_layout_count, ShVkPipelinePool *p_pipeline_pool, ShVkPipeline *p_pipeline)
 Creates a pipeline layout and updates the pipeline structure.
 
uint8_t shSetupComputePipeline (VkDevice device, ShVkPipeline *p_pipeline)
 Sets up a compute pipeline.
 
uint8_t shSetupGraphicsPipeline (VkDevice device, VkRenderPass render_pass, ShVkPipeline *p_pipeline)
 Sets up a graphics pipeline.
 
uint8_t shPipelinePushConstants (VkCommandBuffer cmd_buffer, void *p_data, ShVkPipeline *p_pipeline)
 Pushes constants to a pipeline using the command buffer.
 
uint8_t shBindPipeline (VkCommandBuffer cmd_buffer, VkPipelineBindPoint bind_point, ShVkPipeline *p_pipeline)
 Binds a pipeline to a command buffer.
 
uint8_t shPipelineBindDescriptorSetUnits (VkCommandBuffer cmd_buffer, uint32_t first_descriptor_set, uint32_t first_descriptor_set_unit_idx, uint32_t descriptor_set_unit_count, VkPipelineBindPoint bind_point, uint32_t dynamic_descriptors_count, uint32_t *p_dynamic_offsets, ShVkPipelinePool *p_pipeline_pool, ShVkPipeline *p_pipeline)
 Binds descriptor set units to a pipeline within a command buffer.
 
uint8_t shPipelineDestroyShaderModules (VkDevice device, uint32_t first_module, uint32_t module_count, ShVkPipeline *p_pipeline)
 Destroys shader modules associated with the pipeline.
 
uint8_t shPipelineDestroyLayout (VkDevice device, ShVkPipeline *p_pipeline)
 Destroys the pipeline layout associated with the pipeline.
 
uint8_t shPipelinePoolCreateDescriptorSetLayoutBinding (uint32_t binding, VkDescriptorType descriptor_type, uint32_t descriptor_set_count, VkShaderStageFlags shader_stage, ShVkPipelinePool *p_pipeline_pool)
 Creates a descriptor set layout binding for the pipeline pool.
 
uint8_t shPipelinePoolCreateDescriptorSetLayout (VkDevice device, uint32_t first_binding_idx, uint32_t binding_count, uint32_t set_layout_idx, ShVkPipelinePool *p_pipeline_pool)
 Creates descriptor set layouts in the pipeline pool.
 
uint8_t shPipelinePoolCopyDescriptorSetLayout (uint32_t src_set_layout_idx, uint32_t first_dst_set_layout_idx, uint32_t dst_set_layout_count, ShVkPipelinePool *p_pipeline_pool)
 Copies descriptor set layouts within the pipeline pool.
 
uint8_t shPipelinePoolCreateDescriptorPool (VkDevice device, uint32_t pool_idx, VkDescriptorType descriptor_type, uint32_t descriptor_count, ShVkPipelinePool *p_pipeline_pool)
 Creates a descriptor pool in the pipeline pool.
 
uint8_t shPipelinePoolAllocateDescriptorSetUnits (VkDevice device, uint32_t binding, uint32_t pool_idx, VkDescriptorType descriptor_type, uint32_t first_descriptor_set_unit, uint32_t descriptor_set_unit_count, ShVkPipelinePool *p_pipeline_pool)
 Allocates descriptor set units in the pipeline pool.
 
uint8_t shPipelinePoolSetDescriptorBufferInfos (uint32_t first_descriptor, uint32_t descriptor_count, VkBuffer buffer, uint32_t buffer_offset, uint32_t buffer_size, ShVkPipelinePool *p_pipeline_pool)
 Sets descriptor buffer infos in the pipeline pool.
 
uint8_t shPipelinePoolDestroyDescriptorSetLayouts (VkDevice device, uint32_t first_set_layout, uint32_t set_layout_count, ShVkPipelinePool *p_pipeline_pool)
 Destroys descriptor set layouts in the pipeline pool.
 
uint8_t shPipelinePoolDestroyDescriptorPools (VkDevice device, uint32_t first_pool, uint32_t pool_count, ShVkPipelinePool *p_pipeline_pool)
 Destroys descriptor pools in the pipeline pool.
 
uint8_t shPipelinePoolUpdateDescriptorSetUnits (VkDevice device, uint32_t first_descriptor_set_unit, uint32_t descriptor_set_unit_count, ShVkPipelinePool *p_pipeline_pool)
 Updates descriptor set units in the pipeline pool.
 

Macro Definition Documentation

◆ SH_FALSE

#define SH_FALSE   0

◆ SH_FORMAT_SFLOAT

#define SH_FORMAT_SFLOAT   2

◆ SH_FORMAT_SINT

#define SH_FORMAT_SINT   1

◆ SH_FORMAT_UINT

#define SH_FORMAT_UINT   0

◆ SH_FORMAT_UNDEFINED

#define SH_FORMAT_UNDEFINED   3

◆ SH_MAX_PIPELINE_POOL_DESCRIPTOR_COUNT

#define SH_MAX_PIPELINE_POOL_DESCRIPTOR_COUNT   64

◆ SH_MAX_PIPELINE_SHADER_STAGE_COUNT

#define SH_MAX_PIPELINE_SHADER_STAGE_COUNT   6

◆ SH_MAX_PIPELINE_SUBPASS_COLOR_ATTACHMENT_COUNT

#define SH_MAX_PIPELINE_SUBPASS_COLOR_ATTACHMENT_COUNT   9

◆ SH_MAX_PIPELINE_VERTEX_ATTRIBUTE_COUNT

#define SH_MAX_PIPELINE_VERTEX_ATTRIBUTE_COUNT   32

◆ SH_MAX_PIPELINE_VERTEX_BINDING_COUNT

#define SH_MAX_PIPELINE_VERTEX_BINDING_COUNT   32

◆ SH_MAX_STACK_BUFFER_REGION_COUNT

#define SH_MAX_STACK_BUFFER_REGION_COUNT   256

◆ SH_MAX_STACK_DEVICE_COLOR_FORMATS_QUERIES

#define SH_MAX_STACK_DEVICE_COLOR_FORMATS_QUERIES   44

◆ SH_MAX_STACK_DEVICE_SURFACE_FORMAT_COUNT

#define SH_MAX_STACK_DEVICE_SURFACE_FORMAT_COUNT   256

◆ SH_MAX_STACK_PHYSICAL_DEVICE_COUNT

#define SH_MAX_STACK_PHYSICAL_DEVICE_COUNT   8

◆ SH_MAX_STACK_QUEUE_COUNT

#define SH_MAX_STACK_QUEUE_COUNT   64

◆ SH_MAX_STACK_QUEUE_FAMILY_COUNT

#define SH_MAX_STACK_QUEUE_FAMILY_COUNT   32

◆ SH_MAX_STACK_SURFACE_PRESENT_MODE_COUNT

#define SH_MAX_STACK_SURFACE_PRESENT_MODE_COUNT   16

◆ SH_MAX_STACK_VALIDATION_LAYER_COUNT

#define SH_MAX_STACK_VALIDATION_LAYER_COUNT   32

◆ SH_PIPELINE_POOL_MAX_PIPELINE_COUNT

#define SH_PIPELINE_POOL_MAX_PIPELINE_COUNT   64

◆ SH_TRUE

#define SH_TRUE   1

◆ SH_VEC1_SIGNED_DOUBLE

#define SH_VEC1_SIGNED_DOUBLE   VK_FORMAT_R64_SFLOAT

◆ SH_VEC1_SIGNED_FLOAT

#define SH_VEC1_SIGNED_FLOAT   VK_FORMAT_R32_SFLOAT

◆ SH_VEC1_SIGNED_INT

#define SH_VEC1_SIGNED_INT   VK_FORMAT_R32_SINT

◆ SH_VEC1_UNSIGNED_INT

#define SH_VEC1_UNSIGNED_INT   VK_FORMAT_R32_UINT

◆ SH_VEC1_UNSIGNED_LONG

#define SH_VEC1_UNSIGNED_LONG   VK_FORMAT_R64_UINT

◆ SH_VEC2_SIGNED_DOUBLE

#define SH_VEC2_SIGNED_DOUBLE   VK_FORMAT_R64G64_SFLOAT

◆ SH_VEC2_SIGNED_FLOAT

#define SH_VEC2_SIGNED_FLOAT   VK_FORMAT_R32G32_SFLOAT

◆ SH_VEC2_SIGNED_INT

#define SH_VEC2_SIGNED_INT   VK_FORMAT_R32G32_SINT

◆ SH_VEC2_UNSIGNED_INT

#define SH_VEC2_UNSIGNED_INT   VK_FORMAT_R32G32_UINT

◆ SH_VEC2_UNSIGNED_LONG

#define SH_VEC2_UNSIGNED_LONG   VK_FORMAT_R64G64_UINT

◆ SH_VEC3_SIGNED_DOUBLE

#define SH_VEC3_SIGNED_DOUBLE   VK_FORMAT_R64G64B64_SFLOAT

◆ SH_VEC3_SIGNED_FLOAT

#define SH_VEC3_SIGNED_FLOAT   VK_FORMAT_R32G32B32_SFLOAT

◆ SH_VEC3_SIGNED_INT

#define SH_VEC3_SIGNED_INT   VK_FORMAT_R32G32B32_SINT

◆ SH_VEC3_UNSIGNED_INT

#define SH_VEC3_UNSIGNED_INT   VK_FORMAT_R32G32B32_UINT

◆ SH_VEC3_UNSIGNED_LONG

#define SH_VEC3_UNSIGNED_LONG   VK_FORMAT_R64G64B64_UINT

◆ SH_VEC4_SIGNED_DOUBLE

#define SH_VEC4_SIGNED_DOUBLE   VK_FORMAT_R64G64B64A64_SFLOAT

◆ SH_VEC4_SIGNED_FLOAT

#define SH_VEC4_SIGNED_FLOAT   VK_FORMAT_R32G32B32A32_SFLOAT

◆ SH_VEC4_SIGNED_INT

#define SH_VEC4_SIGNED_INT   VK_FORMAT_R32G32B32A32_SINT

◆ SH_VEC4_UNSIGNED_INT

#define SH_VEC4_UNSIGNED_INT   VK_FORMAT_R32G32B32A32_UINT

◆ SH_VEC4_UNSIGNED_LONG

#define SH_VEC4_UNSIGNED_LONG   VK_FORMAT_R64G64B64A64_UINT

◆ shAllocatePipelinePool

#define shAllocatePipelinePool ( )
Value:
((ShVkPipelinePool*)calloc(1, sizeof(ShVkPipelinePool)))
Represents a collection of Vulkan pipeline objects and their related resources.
Definition shVulkan.h:2506

Allocates a new ShVkPipelinePool structure.

This macro allocates heap memory for a new ShVkPipelinePool structure and initializes it to zero.

Returns
Pointer to the newly allocated ShVkPipelinePool structure, or NULL if allocation fails.

◆ shFreePipelinePool

#define shFreePipelinePool   free

Frees the memory of an ShVkPipelinePool structure.

This macro frees the memory allocated on the heap for an ShVkPipelinePool structure.

Parameters
ptrPointer to the ShVkPipelinePool structure to be freed.

◆ shVkError

#define shVkError ( condition,
error_msg,
failure_expression )
Value:
if ((int)(condition)) {\
printf("shvulkan error: %s\n", (const char*)(error_msg));\
failure_expression;\
}

Error-checking macro for Vulkan conditions.

This macro checks a given condition. If the condition evaluates to true, it prints an error message and executes a failure expression (like returning from a function or exiting).

Parameters
conditionThe condition to check (non-zero for an error).
error_msgA message to be printed if the condition is true.
failure_expressionThe expression to execute when the condition is true (e.g., return or exit).
Note
This macro does not return any value but executes the failure_expression if the condition is met.

◆ shVkResultError

#define shVkResultError ( result,
error_msg,
failure_expression )
Value:
if ((VkResult)(result) != VK_SUCCESS) {\
printf("shvulkan error: %s, %s\n", error_msg, shTranslateVkResult((VkResult)(result)));\
failure_expression;\
}
const char * shTranslateVkResult(VkResult vk_result)
Translates a VkResult enum into a literal string.

Error-checking macro for Vulkan VkResult.

This macro checks the result of a Vulkan API call. If the result is not VK_SUCCESS, it prints an error message along with the translated Vulkan error code and executes a failure expression (like returning from a function or exiting).

Parameters
resultThe VkResult from a Vulkan function (VK_SUCCESS or an error code).
error_msgA message to be printed if the result is not VK_SUCCESS.
failure_expressionThe expression to execute when the result is an error (e.g., return or exit).
Note
This macro calls shTranslateVkResult() to convert the VkResult enum into a string representation.

◆ VK_MAKE_API_VERSION

#define VK_MAKE_API_VERSION ( variant,
major,
minor,
patch )
Value:
((((uint32_t)(variant)) << 29U) | (((uint32_t)(major)) << 22U) | (((uint32_t)(minor)) << 12U) | ((uint32_t)(patch)))

Typedef Documentation

◆ ShImageChannelTypeFlags

◆ ShVkPipeline

typedef struct ShVkPipeline ShVkPipeline

Structure representing a Vulkan pipeline.

This structure holds all the necessary state and configuration for creating and managing a Vulkan pipeline.

◆ ShVkPipelinePool

typedef struct ShVkPipelinePool ShVkPipelinePool

Represents a collection of Vulkan pipeline objects and their related resources.

This structure holds arrays of Vulkan pipelines, descriptor set layouts, descriptor pools, and other related resources required to manage and use Vulkan pipelines in a pipeline pool.

Enumeration Type Documentation

◆ ShImageChannelTypeFlags

Enumerator
SH_IMAGE_CHANNEL_TYPE_UNORM 
SH_IMAGE_CHANNEL_TYPE_SNORM 
SH_IMAGE_CHANNEL_TYPE_UINT 
SH_IMAGE_CHANNEL_TYPE_SINT 
SH_IMAGE_CHANNEL_TYPE_SFLOAT 
SH_IMAGE_CHANNEL_TYPE_UNDEFINED 

Function Documentation

◆ shAcquireSwapchainImage()

uint8_t shAcquireSwapchainImage ( VkDevice device,
VkSwapchainKHR swapchain,
uint64_t timeout_ns,
VkSemaphore acquired_signal_semaphore,
VkFence acquired_signal_fence,
uint32_t * p_swapchain_image_index,
uint8_t * p_swapchain_suboptimal )
extern

Acquires an image from the Vulkan swapchain.

This function acquires an image from the specified swapchain and optionally signals a semaphore or fence.

Parameters
deviceValid Vulkan device.
swapchainValid Vulkan swapchain from which to acquire an image.
timeout_nsTimeout in nanoseconds to wait for the image.
acquired_signal_semaphoreValid Vulkan semaphore to signal upon acquisition.
acquired_signal_fenceValid Vulkan fence to signal upon acquisition.
p_swapchain_image_indexValid destination pointer to the index of the acquired swapchain image.
p_swapchain_suboptimalValid destination pointer to a flag indicating if the swapchain is suboptimal.
Returns
1 if successful, 0 otherwise.

◆ shAllocateBufferMemory()

uint8_t shAllocateBufferMemory ( VkDevice device,
VkPhysicalDevice physical_device,
VkBuffer buffer,
VkMemoryPropertyFlags property_flags,
VkDeviceMemory * p_memory )
extern

Allocates memory for a Vulkan buffer.

This function allocates memory for a specified Vulkan buffer with the desired memory properties.

Parameters
deviceValid Vulkan device.
physical_deviceValid Vulkan physical device.
bufferValid Vulkan buffer for which memory is to be allocated.
property_flagsVulkan memory property flags for the allocated memory.
p_memoryValid destination pointer to the newly allocated Vulkan device memory.
Returns
1 if successful, 0 otherwise.

◆ shAllocateCommandBuffers()

uint8_t shAllocateCommandBuffers ( VkDevice device,
VkCommandPool cmd_pool,
uint32_t cmd_buffer_count,
VkCommandBuffer * p_cmd_buffer )
extern

Allocates command buffers from a command pool.

This function allocates a specified number of command buffers from a command pool.

Parameters
deviceValid Vulkan device.
cmd_poolValid pointer to the command pool from which to allocate.
cmd_buffer_countNumber of command buffers to allocate.
p_cmd_bufferValid destination pointer to an array of newly created VkCommandBuffer handles.
Returns
1 if successful, 0 otherwise.

◆ shAllocateDescriptorSetUnits()

uint8_t shAllocateDescriptorSetUnits ( VkDevice device,
VkDescriptorPool descriptor_pool,
VkDescriptorType descriptor_type,
uint32_t binding,
uint32_t descriptor_set_unit_count,
VkDescriptorSetLayout * p_descriptor_set_layouts,
VkDescriptorSet * p_descriptor_sets,
VkDescriptorBufferInfo * p_buffer_infos,
VkWriteDescriptorSet * p_write_descriptor_sets )
extern

Allocates descriptor sets from a descriptor pool.

This function allocates descriptor sets of the specified type from the given descriptor pool.

Parameters
deviceValid Vulkan device.
descriptor_poolValid Vulkan descriptor pool from which to allocate descriptor sets.
descriptor_typeVulkan descriptor type (e.g., uniform buffer, sampled image).
bindingBinding index for the descriptor sets.
descriptor_set_unit_countNumber of descriptor sets to allocate.
p_descriptor_set_layoutsValid pointer to an array of Vulkan descriptor set layouts.
p_descriptor_setsValid destination pointer to an array of Vulkan descriptor sets.
p_buffer_infosValid pointer to an array of Vulkan descriptor buffer info structures.
p_write_descriptor_setsValid pointer to an array of Vulkan write descriptor set structures.
Returns
1 if successful, 0 otherwise.

◆ shAllocateImageMemory()

uint8_t shAllocateImageMemory ( VkDevice device,
VkPhysicalDevice physical_device,
VkImage image,
VkMemoryPropertyFlags memory_property_flags,
VkDeviceMemory * p_image_memory )
extern

Allocates memory for a Vulkan image.

This function allocates memory for a specified Vulkan image with the desired memory properties.

Parameters
deviceValid Vulkan device.
physical_deviceValid Vulkan physical device.
imageValid Vulkan image for which memory is to be allocated.
memory_property_flagsVulkan memory property flags for the allocated memory.
p_image_memoryValid destination pointer to the newly allocated Vulkan device memory.
Returns
1 if successful, 0 otherwise.

◆ shBeginCommandBuffer()

uint8_t shBeginCommandBuffer ( VkCommandBuffer cmd_buffer)
extern

Begins recording commands into a Vulkan command buffer.

This function begins recording commands into the specified command buffer.

Parameters
cmd_bufferValid Vulkan command buffer to begin recording.
Returns
1 if successful, 0 otherwise.

◆ shBeginRenderpass()

uint8_t shBeginRenderpass ( VkCommandBuffer graphics_cmd_buffer,
VkRenderPass renderpass,
int32_t render_offset_x,
int32_t render_offset_y,
uint32_t render_size_x,
uint32_t render_size_y,
uint32_t clear_value_count,
VkClearValue * p_clear_values,
VkFramebuffer framebuffer )
extern

Begins a Vulkan render pass.

This function begins recording commands for a render pass in the specified command buffer.

Parameters
graphics_cmd_bufferValid Vulkan command buffer to begin the render pass.
renderpassValid Vulkan render pass to begin.
render_offset_xX offset for the render area.
render_offset_yY offset for the render area.
render_size_xWidth of the render area.
render_size_yHeight of the render area.
clear_value_countNumber of clear values.
p_clear_valuesValid pointer to an array of Vulkan clear values.
framebufferValid Vulkan framebuffer to use for the render pass.
Returns
1 if successful, 0 otherwise.

◆ shBindBufferMemory()

uint8_t shBindBufferMemory ( VkDevice device,
VkBuffer buffer,
uint32_t offset,
VkDeviceMemory buffer_memory )
extern

Binds a Vulkan buffer to a specified memory offset.

This function binds a Vulkan buffer to a specific memory offset.

Parameters
deviceValid Vulkan device.
bufferValid Vulkan buffer to bind.
offsetOffset in the memory where the buffer will be bound.
buffer_memoryValid Vulkan device memory to bind to the buffer.
Returns
1 if successful, 0 otherwise.

◆ shBindImageMemory()

uint8_t shBindImageMemory ( VkDevice device,
VkImage image,
uint32_t offset,
VkDeviceMemory image_memory )
extern

Binds a Vulkan image to a specified memory offset.

This function binds a Vulkan image to a specific memory offset.

Parameters
deviceValid Vulkan device.
imageValid Vulkan image to bind.
offsetOffset in the memory where the image will be bound.
image_memoryValid Vulkan device memory to bind to the image.
Returns
1 if successful, 0 otherwise.

◆ shBindIndexBuffer()

uint8_t shBindIndexBuffer ( VkCommandBuffer graphics_cmd_buffer,
uint32_t index_offset,
VkBuffer index_buffer )
extern

Binds an index buffer to a Vulkan command buffer.

This function binds an index buffer to a Vulkan command buffer.

Parameters
graphics_cmd_bufferValid Vulkan command buffer to bind the index buffer to.
index_offsetOffset in the index buffer.
index_bufferValid Vulkan index buffer to bind.
Returns
1 if successful, 0 otherwise.

◆ shBindPipeline()

uint8_t shBindPipeline ( VkCommandBuffer cmd_buffer,
VkPipelineBindPoint bind_point,
ShVkPipeline * p_pipeline )
extern

Binds a pipeline to a command buffer.

This function binds a pipeline (graphics or compute) to the command buffer for subsequent commands.

Parameters
cmd_bufferValid Vulkan command buffer.
bind_pointPipeline bind point (e.g., VK_PIPELINE_BIND_POINT_GRAPHICS).
p_pipelineValid destination pointer to the ShVkPipeline structure to be bound.
Returns
1 if successful, 0 otherwise.

◆ shBindVertexBuffers()

uint8_t shBindVertexBuffers ( VkCommandBuffer graphics_cmd_buffer,
uint32_t first_binding,
uint32_t binding_count,
VkBuffer * p_vertex_buffers,
VkDeviceSize * p_vertex_offsets )
extern

Binds vertex buffers to a Vulkan command buffer.

This function binds one or more vertex buffers to a Vulkan command buffer.

Parameters
graphics_cmd_bufferValid Vulkan command buffer to bind vertex buffers to.
first_bindingBinding index to start from.
binding_countNumber of vertex buffers to bind.
p_vertex_buffersValid pointer to an array of Vulkan vertex buffers.
p_vertex_offsetsValid pointer to an array of offsets for each vertex buffer.
Returns
1 if successful, 0 otherwise.

◆ shCheckSupportedDeviceColorFormat()

uint8_t shCheckSupportedDeviceColorFormat ( VkPhysicalDevice physical_device,
VkFormat format,
uint8_t * p_color_attachment_supported )
extern

◆ shClearBufferMemory()

uint8_t shClearBufferMemory ( VkDevice device,
VkBuffer buffer,
VkDeviceMemory memory )
extern

Clears memory associated with a Vulkan buffer.

This function clears the memory bound to a Vulkan buffer.

Parameters
deviceValid Vulkan device.
bufferValid Vulkan buffer.
memoryValid Vulkan device memory bound to the buffer.
Returns
1 if successful, 0 otherwise.

◆ shClearImageMemory()

uint8_t shClearImageMemory ( VkDevice device,
VkImage image,
VkDeviceMemory image_memory )
extern

Clears memory associated with a Vulkan image.

This function clears the memory bound to a Vulkan image.

Parameters
deviceValid Vulkan device.
imageValid Vulkan image.
image_memoryValid Vulkan device memory bound to the image.
Returns
1 if successful, 0 otherwise.

◆ shClearPipeline()

uint8_t shClearPipeline ( ShVkPipeline * p_pipeline)
extern

Clears the pipeline structure.

This function resets all fields of the ShVkPipeline structure to their default values.

Parameters
p_pipelineValid destination pointer to the ShVkPipeline structure to be cleared.
Returns
1 if successful, 0 otherwise.

◆ shCmdDispatch()

uint8_t shCmdDispatch ( VkCommandBuffer cmd_buffer,
uint32_t group_count_x,
uint32_t group_count_y,
uint32_t group_count_z )
extern

Dispatches compute work from a Vulkan command buffer.

This function dispatches a compute workload with specified group counts.

Parameters
cmd_bufferValid Vulkan command buffer from which to dispatch.
group_count_xNumber of groups in the x dimension.
group_count_yNumber of groups in the y dimension.
group_count_zNumber of groups in the z dimension.
Returns
1 if successful, 0 otherwise.

◆ shColorBlendSettings()

uint8_t shColorBlendSettings ( uint8_t enable_color_blending,
uint8_t enable_alpha_blending,
uint32_t subpass_color_attachment_count,
VkPipelineColorBlendAttachmentState * p_color_blend_attachment_states,
VkPipelineColorBlendStateCreateInfo * p_color_blend_state )
extern

Configures color blending and alpha blending states.

This function configures the color blending and alpha blending states for a Vulkan pipeline.

Parameters
enable_color_blendingBoolean flag to enable or disable color blending.
enable_alpha_blendingBoolean flag to enable or disable alpha blending.
subpass_color_attachment_countNumber of color attachments in the subpass.
p_color_blend_attachment_statesValid pointer to an array of Vulkan color blend attachment states.
p_color_blend_stateValid destination pointer to the Vulkan pipeline color blend state create info.
Returns
1 if successful, 0 otherwise.

◆ shCombineMaxSamples()

uint8_t shCombineMaxSamples ( VkPhysicalDeviceProperties physical_device_properties,
uint32_t sample_count,
uint8_t combine_color_sample,
uint8_t combine_depth_sample,
uint32_t * p_sample_count )
extern

Combines sample counts based on physical device properties.

This function determines the maximum number of samples that can be used for color and depth attachments, considering the physical device properties.

Parameters
physical_device_propertiesProperties of the physical device.
sample_countSample count to combine.
combine_color_sampleFlag indicating whether to combine color samples.
combine_depth_sampleFlag indicating whether to combine depth samples.
p_sample_countDestination pointer to the resulting maximum supported sample count for the current hardware.
Returns
1 if successful, 0 otherwise.

◆ shCopyBuffer()

uint8_t shCopyBuffer ( VkCommandBuffer transfer_cmd_buffer,
VkBuffer src_buffer,
uint32_t src_offset,
uint32_t dst_offset,
uint64_t size,
VkBuffer dst_buffer )
extern

Copies data from one Vulkan buffer to another.

This function copies data from a source buffer to a destination buffer.

Parameters
transfer_cmd_bufferValid Vulkan command buffer for the copy operation.
src_bufferValid Vulkan source buffer.
src_offsetOffset in the source buffer to start copying from.
dst_offsetOffset in the destination buffer to start copying to.
sizeNumber of bytes to copy.
dst_bufferValid Vulkan destination buffer.
Returns
1 if successful, 0 otherwise.

◆ shCopyBufferRegions()

uint8_t shCopyBufferRegions ( VkCommandBuffer transfer_cmd_buffer,
VkBuffer src_buffer,
uint32_t region_count,
uint32_t * p_src_offsets,
uint32_t * p_dst_offsets,
uint32_t * p_sizes,
VkBuffer dst_buffer )

Copies multiple regions of data from one Vulkan buffer to another.

This function copies multiple regions of data from a source buffer to a destination buffer.

Parameters
transfer_cmd_bufferValid Vulkan command buffer for the copy operation.
src_bufferValid Vulkan source buffer.
region_countNumber of regions to copy.
p_src_offsetsValid pointer to an array of offsets in the source buffer.
p_dst_offsetsValid pointer to an array of offsets in the destination buffer.
p_sizesValid pointer to an array of sizes for each region to copy.
dst_bufferValid Vulkan destination buffer.
Returns
1 if successful, 0 otherwise.

◆ shCopyImage()

uint8_t shCopyImage ( VkCommandBuffer transfer_cmd_buffer,
uint32_t width,
uint32_t height,
VkImageAspectFlags src_image_aspect,
VkImageAspectFlags dst_image_aspect,
VkImage src_image,
VkImage dst_image )

◆ shCreateBuffer()

uint8_t shCreateBuffer ( VkDevice device,
uint32_t size,
VkBufferUsageFlags usage,
VkSharingMode sharing_mode,
VkBuffer * p_buffer )
extern

Creates a Vulkan buffer.

This function creates a Vulkan buffer with the specified size and usage.

Parameters
deviceValid Vulkan device.
sizeSize of the buffer in bytes.
usageVulkan buffer usage flags indicating how the buffer will be used.
sharing_modeVulkan sharing mode specifying how the buffer is shared between queues.
p_bufferValid destination pointer to the newly created Vulkan buffer.
Returns
1 if successful, 0 otherwise.

◆ shCreateCommandPool()

uint8_t shCreateCommandPool ( VkDevice device,
uint32_t queue_family_index,
VkCommandPool * p_cmd_pool )
extern

Creates a Vulkan command pool.

This function creates a command pool for a specified queue family.

Parameters
deviceValid Vulkan device.
queue_family_indexQueue family index for the command pool.
p_cmd_poolValid destination pointer to the newly created VkCommandPool.
Returns
1 if successful, 0 otherwise.

◆ shCreateDescriptorPool()

uint8_t shCreateDescriptorPool ( VkDevice device,
uint32_t pool_size_count,
VkDescriptorPoolSize * p_pool_sizes,
VkDescriptorPool * p_descriptor_pool )
extern

Creates a descriptor pool.

This function creates a descriptor pool with the specified pool sizes.

Parameters
deviceValid Vulkan device.
pool_size_countNumber of pool sizes.
p_pool_sizesValid pointer to an array of Vulkan descriptor pool sizes.
p_descriptor_poolValid destination pointer to the newly created Vulkan descriptor pool.
Returns
1 if successful, 0 otherwise.

◆ shCreateDescriptorSetLayout()

uint8_t shCreateDescriptorSetLayout ( VkDevice device,
uint32_t binding_count,
VkDescriptorSetLayoutBinding * p_bindings,
VkDescriptorSetLayout * p_descriptor_set_layout )
extern

Creates a descriptor set layout.

This function creates a descriptor set layout with the specified bindings.

Parameters
deviceValid Vulkan device.
binding_countNumber of descriptor set layout bindings.
p_bindingsValid pointer to an array of Vulkan descriptor set layout bindings.
p_descriptor_set_layoutValid destination pointer to the newly created Vulkan descriptor set layout.
Returns
1 if successful, 0 otherwise.

◆ shCreateDescriptorSetLayoutBinding()

uint8_t shCreateDescriptorSetLayoutBinding ( uint32_t binding,
VkDescriptorType descriptor_type,
uint32_t descriptor_set_count,
VkShaderStageFlags shader_stage,
VkDescriptorSetLayoutBinding * p_binding )
extern

Creates a descriptor set layout binding.

This function creates a descriptor set layout binding with the specified parameters.

Parameters
bindingBinding index for the descriptor set layout.
descriptor_typeVulkan descriptor type (e.g., uniform buffer, sampled image).
descriptor_set_countNumber of descriptors in the set.
shader_stageVulkan shader stage flags that use this descriptor.
p_bindingValid destination pointer to the Vulkan descriptor set layout binding.
Returns
1 if successful, 0 otherwise.

◆ shCreateFences()

uint8_t shCreateFences ( VkDevice device,
uint32_t fence_count,
uint8_t signaled,
VkFence * p_fences )
extern

Creates Vulkan fences.

This function creates a specified number of Vulkan fences.

Parameters
deviceValid Vulkan device.
fence_countNumber of fences to create.
signaledWhether to initialize fences as signaled.
p_fencesValid destination pointer to an array of newly created Vulkan fences.
Returns
1 if successful, 0 otherwise.

◆ shCreateFramebuffer()

uint8_t shCreateFramebuffer ( VkDevice device,
VkRenderPass renderpass,
uint32_t image_view_count,
VkImageView * p_image_views,
uint32_t x,
uint32_t y,
uint32_t z,
VkFramebuffer * p_framebuffer )
extern

Creates a Vulkan framebuffer.

This function creates a framebuffer with specified image views and dimensions for use with a render pass.

Parameters
deviceValid Vulkan device.
renderpassValid Vulkan render pass.
image_view_countNumber of image views in the framebuffer.
p_image_viewsValid pointer to an array of VkImageView handles.
xWidth of the framebuffer.
yHeight of the framebuffer.
zDepth of the framebuffer.
p_framebufferValid destination pointer to the newly created VkFramebuffer.
Returns
1 if successful, 0 otherwise.

◆ shCreateImage()

uint8_t shCreateImage ( VkDevice device,
VkImageType type,
uint32_t x,
uint32_t y,
uint32_t z,
VkFormat format,
uint32_t mip_levels,
VkSampleCountFlagBits sample_count,
VkImageTiling image_tiling,
VkImageUsageFlags usage,
VkSharingMode sharing_mode,
VkImage * p_image )
extern

Creates a Vulkan image.

This function creates a Vulkan image with the specified parameters.

Parameters
deviceValid Vulkan device.
typeVulkan image type.
xWidth of the image.
yHeight of the image.
zDepth of the image.
formatVulkan image format.
mip_levelsNumber of mipmap levels.
sample_countVulkan sample count flag bits.
image_tilingVulkan image tiling mode.
usageVulkan image usage flags.
sharing_modeVulkan sharing mode.
p_imageValid destination pointer to the newly created Vulkan image.
Returns
1 if successful, 0 otherwise.

◆ shCreateImageView()

uint8_t shCreateImageView ( VkDevice device,
VkImage image,
VkImageViewType view_type,
VkImageAspectFlagBits image_aspect,
uint32_t mip_levels,
VkFormat format,
VkImageView * p_image_view )
extern

Creates a Vulkan image view.

This function creates a Vulkan image view for a specified image, view type, format, and aspect.

Parameters
deviceValid Vulkan device.
imageValid Vulkan image.
view_typeType of the image view.
image_aspectAspect flags of the image (e.g., color, depth).
mip_levelsNumber of mipmap levels.
formatFormat of the image.
p_image_viewValid destination pointer to the newly created VkImageView.
Returns
1 if successful, 0 otherwise.

◆ shCreateInputAssembly()

uint8_t shCreateInputAssembly ( VkPrimitiveTopology primitive_topology,
VkBool32 primitive_restart_enable,
VkPipelineInputAssemblyStateCreateInfo * p_input_assembly )
extern

Creates the input assembly state for a pipeline.

This function creates the input assembly state with the specified topology and restart enable flag.

Parameters
primitive_topologyVulkan primitive topology type.
primitive_restart_enableBoolean flag to enable or disable primitive restart.
p_input_assemblyValid destination pointer to the Vulkan pipeline input assembly state create info.
Returns
1 if successful, 0 otherwise.

◆ shCreateInstance()

uint8_t shCreateInstance ( const char * application_name,
const char * engine_name,
const uint8_t enable_validation_layers,
const uint32_t extension_count,
const char ** pp_extension_names,
uint32_t api_version,
VkInstance * p_instance )
extern

Creates a Vulkan instance.

This function initializes a Vulkan instance with the specified application name, engine name, validation layers, and extensions.

Parameters
application_nameThe name of the application.
engine_nameThe name of the engine.
enable_validation_layersFlag to enable (1) or disable (0) validation layers.
extension_countNumber of Vulkan extensions to enable.
pp_extension_namesValid array of extension names to enable, if required.
api_versionThe Vulkan API version to use.
p_instanceValid destination pointer to the newly created VkInstance.
Returns
1 if the instance is created successfully, 0 otherwise.

◆ shCreatePipelineLayout()

uint8_t shCreatePipelineLayout ( VkDevice device,
uint32_t push_constant_range_count,
VkPushConstantRange * p_push_constants_range,
uint32_t src_descriptor_set_layout_count,
VkDescriptorSetLayout * p_src_descriptor_set_layouts,
VkPipelineLayout * p_pipeline_layout )
extern

Creates a pipeline layout.

This function creates a Vulkan pipeline layout with the specified push constant ranges and descriptor set layouts.

Parameters
deviceValid Vulkan device.
push_constant_range_countNumber of push constant ranges.
p_push_constants_rangeValid pointer to an array of Vulkan push constant ranges.
src_descriptor_set_layout_countNumber of descriptor set layouts.
p_src_descriptor_set_layoutsValid pointer to an array of Vulkan descriptor set layouts.
p_pipeline_layoutValid destination pointer to the newly created Vulkan pipeline layout.
Returns
1 if successful, 0 otherwise.

◆ shCreateRasterizer()

uint8_t shCreateRasterizer ( VkPolygonMode polygon_mode,
VkCullModeFlagBits cull_mode,
VkPipelineRasterizationStateCreateInfo * p_rasterizer )
extern

Creates the rasterization state for a pipeline.

This function creates the rasterization state with the specified polygon mode and cull mode.

Parameters
polygon_modeVulkan polygon mode for rasterization.
cull_modeVulkan cull mode flag bits.
p_rasterizerValid destination pointer to the Vulkan pipeline rasterization state create info.
Returns
1 if successful, 0 otherwise.

◆ shCreateRenderpass()

uint8_t shCreateRenderpass ( VkDevice device,
uint32_t attachment_count,
VkAttachmentDescription * p_attachments_descriptions,
uint32_t subpass_count,
VkSubpassDescription * p_subpasses,
VkRenderPass * p_renderpass )
extern

Creates a Vulkan render pass.

This function creates a render pass with specified attachments and subpasses.

Parameters
deviceValid pointer to Vulkan device.
attachment_countNumber of attachments in the render pass.
p_attachments_descriptionsValid pointer to an array of VkAttachmentDescription structures.
subpass_countNumber of subpasses in the render pass.
p_subpassesValid pointer to an array of VkSubpassDescription structures.
p_renderpassValid destination pointer to the newly created VkRenderPass.
Returns
1 if successful, 0 otherwise.

◆ shCreateRenderpassAttachment()

uint8_t shCreateRenderpassAttachment ( VkFormat format,
uint32_t sample_count,
VkAttachmentLoadOp load_treatment,
VkAttachmentStoreOp store_treatment,
VkAttachmentLoadOp stencil_load_treatment,
VkAttachmentStoreOp stencil_store_treatment,
VkImageLayout initial_layout,
VkImageLayout final_layout,
VkAttachmentDescription * p_attachment_description )
extern

Creates a Vulkan render pass attachment description.

This function creates an attachment description to use in a render pass.

Parameters
formatFormat of the attachment.
sample_countSample count for the attachment.
load_treatmentLoad operation for the attachment.
store_treatmentStore operation for the attachment.
stencil_load_treatmentLoad operation for stencil attachment.
stencil_store_treatmentStore operation for stencil attachment.
initial_layoutInitial layout of the attachment.
final_layoutFinal layout of the attachment.
p_attachment_descriptionValid destination pointer to the newly created VkAttachmentDescription.
Returns
1 if successful, 0 otherwise.

◆ shCreateRenderpassAttachmentReference()

uint8_t shCreateRenderpassAttachmentReference ( uint32_t attachment_idx,
VkImageLayout layout,
VkAttachmentReference * p_attachment_reference )
extern

Creates a Vulkan render pass attachment reference.

This function creates an attachment reference for use in a subpass of a render pass.

Parameters
attachment_idxIndex of the attachment in the render pass.
layoutLayout of the attachment within the subpass.
p_attachment_referenceValid destination pointer to the newly created VkAttachmentReference.
Returns
1 if successful, 0 otherwise.

◆ shCreateSemaphores()

uint8_t shCreateSemaphores ( VkDevice device,
uint32_t semaphore_count,
VkSemaphore * p_semaphores )
extern

Creates Vulkan semaphores.

This function creates a specified number of Vulkan semaphores.

Parameters
deviceValid Vulkan device.
semaphore_countNumber of semaphores to create.
p_semaphoresValid destination pointer to an array of newly created Vulkan semaphores.
Returns
1 if successful, 0 otherwise.

◆ shCreateShaderModule()

uint8_t shCreateShaderModule ( VkDevice device,
uint32_t size,
char * code,
VkShaderModule * p_shader_module )
extern

Creates a Vulkan shader module.

This function creates a shader module from the provided shader code.

Parameters
deviceValid Vulkan device.
sizeSize of the shader code in bytes.
codePointer to the shader code.
p_shader_moduleValid destination pointer to the newly created Vulkan shader module.
Returns
1 if successful, 0 otherwise.

◆ shCreateShaderStage()

uint8_t shCreateShaderStage ( VkShaderModule shader_module,
VkShaderStageFlags shader_stage_flag,
VkPipelineShaderStageCreateInfo * p_shader_stage )
extern

Creates a Vulkan shader stage.

This function creates a shader stage using the provided shader module and stage flag.

Parameters
shader_moduleValid Vulkan shader module.
shader_stage_flagVulkan shader stage flag (e.g., vertex, fragment).
p_shader_stageValid destination pointer to the Vulkan pipeline shader stage create info.
Returns
1 if successful, 0 otherwise.

◆ shCreateSubpass()

uint8_t shCreateSubpass ( VkPipelineBindPoint bind_point,
uint32_t input_attachment_count,
VkAttachmentReference * p_input_attachments_reference,
uint32_t color_attachment_count,
VkAttachmentReference * p_color_attachments_reference,
VkAttachmentReference * p_depth_stencil_attachment_reference,
VkAttachmentReference * p_resolve_attachment_reference,
uint32_t preserve_attachment_count,
uint32_t * p_preserve_attachments,
VkSubpassDescription * p_subpass )
extern

Creates a Vulkan subpass description.

This function creates a subpass description including input, color, depth/stencil, and resolve attachments.

Parameters
bind_pointPipeline bind point for the subpass.
input_attachment_countNumber of input attachments.
p_input_attachments_referenceValid pointer to an array of input attachment references.
color_attachment_countNumber of color attachments.
p_color_attachments_referenceValid pointer to an array of color attachment references.
p_depth_stencil_attachment_referenceValid pointer to the depth/stencil attachment reference.
p_resolve_attachment_referenceValid pointer to the resolve attachment reference.
preserve_attachment_countNumber of attachments to preserve.
p_preserve_attachmentsValid pointer to an array of indices of attachments to preserve.
p_subpassValid destination pointer to the newly created VkSubpassDescription.
Returns
1 if successful, 0 otherwise.

◆ shCreateSwapchain()

uint8_t shCreateSwapchain ( VkDevice device,
VkPhysicalDevice physical_device,
VkSurfaceKHR surface,
VkFormat image_format,
VkFormat * p_image_format,
uint32_t swapchain_image_count,
VkSharingMode image_sharing_mode,
uint8_t vsync,
uint32_t * p_swapchain_image_count,
VkSwapchainKHR * p_swapchain )
extern

Creates a Vulkan swapchain.

This function sets up a Vulkan swapchain with the specified surface, image format, and other parameters.

Parameters
deviceValid Vulkan device.
physical_deviceValid Vulkan physical device.
surfaceValid Vulkan surface.
image_formatFormat of the images in the swapchain.
p_image_formatValid destination pointer to the format of the swapchain images.
swapchain_image_countNumber of images in the swapchain.
image_sharing_modeSharing mode for the swapchain images.
vsyncFlag to enable (1) or disable (0) V-Sync.
p_swapchain_image_countValid destination pointer to the number of swapchain images.
p_swapchainValid destination pointer to the newly created VkSwapchainKHR.
Note
p_swapchain_image_count might be different from swapchain_image_count when swapchain_image_count is not supported! Please take this in consideration for your API implementations.
Returns
1 if the swapchain is created successfully, 0 otherwise.

◆ shCreateSwapchainImageViews()

uint8_t shCreateSwapchainImageViews ( VkDevice device,
VkFormat format,
uint32_t swapchain_image_count,
VkImage * p_swapchain_images,
VkImageView * p_swapchain_image_views )
extern

Creates image views for swapchain images.

This function creates Vulkan image views for all images in a swapchain.

Parameters
deviceValid Vulkan device.
formatFormat of the image views.
swapchain_image_countNumber of swapchain images.
p_swapchain_imagesPointer to an array of VkImage handles.
p_swapchain_image_viewsValid destination pointer to an array of VkImageView handles.
Returns
1 if successful, 0 otherwise.

◆ shDestroyCommandBuffers()

uint8_t shDestroyCommandBuffers ( VkDevice device,
VkCommandPool cmd_pool,
uint32_t cmd_buffer_count,
VkCommandBuffer * p_cmd_buffers )
extern

Destroys Vulkan command buffers.

This function destroys an array of Vulkan command buffers from a command pool.

Parameters
deviceValid Vulkan device.
cmd_poolValid Vulkan command pool.
cmd_buffer_countNumber of command buffers to destroy.
p_cmd_buffersValid pointer to an array of VkCommandBuffer handles.
Returns
1 if successful, 0 otherwise.

◆ shDestroyCommandPool()

uint8_t shDestroyCommandPool ( VkDevice device,
VkCommandPool cmd_pool )
extern

Destroys a Vulkan command pool.

This function destroys a Vulkan command pool.

Parameters
deviceValid Vulkan device.
cmd_poolValid Vulkan command pool to destroy.
Returns
1 if successful, 0 otherwise.

◆ shDestroyDescriptorPool()

uint8_t shDestroyDescriptorPool ( VkDevice device,
VkDescriptorPool descriptor_pool )
extern

Destroys a Vulkan descriptor pool.

This function destroys the specified Vulkan descriptor pool.

Parameters
deviceValid Vulkan device.
descriptor_poolVulkan descriptor pool to destroy.
Returns
1 if successful, 0 otherwise.

◆ shDestroyDescriptorSetLayout()

uint8_t shDestroyDescriptorSetLayout ( VkDevice device,
VkDescriptorSetLayout descriptor_set_layout )
extern

Destroys a Vulkan descriptor set layout.

This function destroys the specified Vulkan descriptor set layout.

Parameters
deviceValid Vulkan device.
descriptor_set_layoutVulkan descriptor set layout to destroy.
Returns
1 if successful, 0 otherwise.

◆ shDestroyDevice()

uint8_t shDestroyDevice ( VkDevice device)
extern

Destroys a Vulkan device.

This function destroys a Vulkan device.

Parameters
deviceValid Vulkan device to destroy.
Returns
1 if successful, 0 otherwise.

◆ shDestroyFences()

uint8_t shDestroyFences ( VkDevice device,
uint32_t fence_count,
VkFence * p_fences )
extern

Destroys Vulkan fences.

This function destroys a specified number of Vulkan fences.

Parameters
deviceValid Vulkan device.
fence_countNumber of fences to destroy.
p_fencesValid pointer to an array of Vulkan fences to destroy.
Returns
1 if successful, 0 otherwise.

◆ shDestroyFramebuffers()

uint8_t shDestroyFramebuffers ( VkDevice device,
uint32_t framebuffer_count,
VkFramebuffer * p_framebuffers )
extern

Destroys Vulkan framebuffers.

This function destroys an array of Vulkan framebuffers.

Parameters
deviceValid Vulkan device.
framebuffer_countNumber of framebuffers to destroy.
p_framebuffersValid pointer to an array of VkFramebuffer handles.
Returns
1 if successful, 0 otherwise.

◆ shDestroyImageViews()

uint8_t shDestroyImageViews ( VkDevice device,
uint32_t image_view_count,
VkImageView * p_image_views )
extern

Destroys Vulkan image views.

This function destroys an array of Vulkan image views.

Parameters
deviceValid Vulkan device.
image_view_countNumber of image views to destroy.
p_image_viewsValid pointer to an array of VkImageView handles.
Returns
1 if successful, 0 otherwise.

◆ shDestroyInstance()

uint8_t shDestroyInstance ( VkInstance instance)
extern

Destroys a Vulkan instance.

This function destroys a Vulkan instance.

Parameters
instanceValid Vulkan instance to destroy.
Returns
1 if successful, 0 otherwise.

◆ shDestroyPipeline()

uint8_t shDestroyPipeline ( VkDevice device,
VkPipeline pipeline )
extern

Destroys a Vulkan pipeline.

This function destroys the specified Vulkan pipeline.

Parameters
deviceValid Vulkan device.
pipelineVulkan pipeline to destroy.
Returns
1 if successful, 0 otherwise.

◆ shDestroyPipelineLayout()

uint8_t shDestroyPipelineLayout ( VkDevice device,
VkPipelineLayout pipeline_layout )
extern

Destroys a Vulkan pipeline layout.

This function destroys the specified Vulkan pipeline layout.

Parameters
deviceValid Vulkan device.
pipeline_layoutVulkan pipeline layout to destroy.
Returns
1 if successful, 0 otherwise.

◆ shDestroyRenderpass()

uint8_t shDestroyRenderpass ( VkDevice device,
VkRenderPass render_pass )
extern

Destroys a Vulkan render pass.

This function destroys a Vulkan render pass.

Parameters
deviceValid Vulkan device.
render_passValid Vulkan render pass to destroy.
Returns
1 if successful, 0 otherwise.

◆ shDestroySemaphores()

uint8_t shDestroySemaphores ( VkDevice device,
uint32_t semaphore_count,
VkSemaphore * p_semaphores )
extern

Destroys Vulkan semaphores.

This function destroys a specified number of Vulkan semaphores.

Parameters
deviceValid Vulkan device.
semaphore_countNumber of semaphores to destroy.
p_semaphoresValid pointer to an array of Vulkan semaphores to destroy.
Returns
1 if successful, 0 otherwise.

◆ shDestroyShaderModule()

uint8_t shDestroyShaderModule ( VkDevice device,
VkShaderModule shader_module )
extern

Destroys a Vulkan shader module.

This function destroys the specified Vulkan shader module.

Parameters
deviceValid Vulkan device.
shader_moduleVulkan shader module to destroy.
Returns
1 if successful, 0 otherwise.

◆ shDestroySurface()

uint8_t shDestroySurface ( VkInstance instance,
VkSurfaceKHR surface )
extern

Destroys a Vulkan surface.

This function destroys a Vulkan surface associated with an instance.

Parameters
instanceValid Vulkan instance.
surfaceValid VkSurfaceKHR to destroy.
Returns
1 if successful, 0 otherwise.

◆ shDestroySwapchain()

uint8_t shDestroySwapchain ( VkDevice device,
VkSwapchainKHR swapchain )
extern

Destroys a Vulkan swapchain.

This function destroys the specified Vulkan swapchain.

Parameters
deviceValid Vulkan device.
swapchainValid VkSwapchainKHR to destroy.
Returns
1 if successful, 0 otherwise.

◆ shDraw()

uint8_t shDraw ( VkCommandBuffer graphics_cmd_buffer,
uint32_t vertex_count,
uint32_t first_vertex,
uint32_t instance_count,
uint32_t first_instance )
extern

Records a draw command into a Vulkan command buffer.

This function records a draw command into the specified command buffer.

Parameters
graphics_cmd_bufferValid Vulkan command buffer to record the draw command.
vertex_countNumber of vertices to draw.
first_vertexIndex of the first vertex to draw.
instance_countNumber of instances to draw.
first_instanceIndex of the first instance to draw.
Returns
1 if successful, 0 otherwise.

◆ shDrawIndexed()

uint8_t shDrawIndexed ( VkCommandBuffer graphics_cmd_buffer,
uint32_t index_count,
uint32_t instance_count,
uint32_t first_index,
int32_t vertex_offset,
uint32_t first_instance )
extern

Records an indexed draw command into a Vulkan command buffer.

This function records an indexed draw command into the specified command buffer.

Parameters
graphics_cmd_bufferValid Vulkan command buffer to record the draw command.
index_countNumber of indices to draw.
instance_countNumber of instances to draw.
first_indexIndex of the first index to draw.
vertex_offsetOffset added to each index to obtain the vertex index.
first_instanceIndex of the first instance to draw.
Returns
1 if successful, 0 otherwise.

◆ shEndCommandBuffer()

uint8_t shEndCommandBuffer ( VkCommandBuffer cmd_buffer)
extern

Ends recording commands into a Vulkan command buffer.

This function ends the recording of commands into the specified command buffer.

Parameters
cmd_bufferValid Vulkan command buffer to end recording.
Returns
1 if successful, 0 otherwise.

◆ shEndRenderpass()

uint8_t shEndRenderpass ( VkCommandBuffer graphics_cmd_buffer)
extern

Ends a Vulkan render pass.

This function ends the recording of commands for a render pass in the specified command buffer.

Parameters
graphics_cmd_bufferValid Vulkan command buffer to end the render pass.
Returns
1 if successful, 0 otherwise.

◆ shFindSupportedDeviceColorFormats()

uint8_t shFindSupportedDeviceColorFormats ( VkPhysicalDevice physical_device,
uint32_t min_channel_count,
uint32_t max_channel_count,
uint32_t min_channel_size,
uint32_t max_channel_size,
ShImageChannelTypeFlags channel_types,
uint32_t * p_supported_format_count,
VkFormat * p_supported_formats,
uint32_t * p_channels_count,
uint32_t * p_single_channels_sizes,
uint32_t * p_channels_types )
extern

◆ shFindValidationLayer()

uint8_t shFindValidationLayer ( const char * validation_layer_name)
extern

Searches for a specific Vulkan validation layer.

This function searches through the available Vulkan validation layers to find a match with the provided validation layer name.

Parameters
validation_layer_nameThe name of the validation layer to find.
Returns
1 if the validation layer is found, 0 otherwise.
Note
This function is typically used to check if a specific validation layer (e.g., "VK_LAYER_KHRONOS_validation") is available for use.

◆ shGetDeviceQueues()

uint8_t shGetDeviceQueues ( VkDevice device,
uint32_t queue_count,
uint32_t * p_queue_family_indices,
VkQueue * p_queues )
extern

Retrieves the Vulkan queues from a device.

This function retrieves the Vulkan queues from a logical device based on specified queue family indices.

Parameters
deviceValid Vulkan device.
queue_countNumber of queues to retrieve.
p_queue_family_indicesValid pointer to an array of queue family indices.
p_queuesValid destination pointer to an array of VkQueue handles.
Returns
1 if successful, 0 otherwise.

◆ shGetImageSubresourceLayout()

uint8_t shGetImageSubresourceLayout ( VkDevice device,
VkImage image,
VkImageAspectFlags image_aspect_mask,
VkSubresourceLayout * p_subresource_layout )
extern

◆ shGetMemoryBudgetProperties()

uint8_t shGetMemoryBudgetProperties ( VkPhysicalDevice physical_device,
VkPhysicalDeviceMemoryBudgetPropertiesEXT * p_memory_budget_properties )
extern

Retrieves memory budget properties for a Vulkan physical device.

This function retrieves memory budget properties for a Vulkan physical device.

Parameters
physical_deviceValid Vulkan physical device.
p_memory_budget_propertiesValid destination pointer to Vulkan memory budget properties.
Returns
1 if successful, 0 otherwise.

◆ shGetMemoryType()

uint8_t shGetMemoryType ( VkDevice device,
VkPhysicalDevice physical_device,
VkMemoryPropertyFlags property_flags,
uint32_t * p_memory_type_index )
extern

Retrieves the memory type index that supports the specified memory properties.

This function finds the index of a memory type that matches the specified memory property flags.

Parameters
deviceValid Vulkan device.
physical_deviceValid Vulkan physical device.
property_flagsVulkan memory property flags to match.
p_memory_type_indexValid destination pointer to the index of the memory type.
Returns
1 if successful, 0 otherwise.

◆ shGetPhysicalDeviceQueueFamilies()

uint8_t shGetPhysicalDeviceQueueFamilies ( VkPhysicalDevice physical_device,
VkSurfaceKHR surface,
uint32_t * p_queue_family_count,
uint32_t * p_graphics_queue_family_count,
uint32_t * p_surface_queue_family_count,
uint32_t * p_compute_queue_family_count,
uint32_t * p_transfer_queue_family_count,
uint32_t * p_graphics_queue_family_indices,
uint32_t * p_surface_queue_family_indices,
uint32_t * p_compute_queue_family_indices,
uint32_t * p_transfer_queue_family_indices,
VkQueueFamilyProperties * p_queue_families_properties )
extern

Retrieves the queue family indices for a physical device.

This function retrieves and categorizes the queue families available for a specified physical device and surface, such as graphics, compute, transfer, and presentation (surface support).

Parameters
physical_deviceThe current physical device to query for queue families.
surfaceThe Vulkan surface (for surface support queries).
p_queue_family_countValid destination pointer to the total number of queue families available.
p_graphics_queue_family_countValid destination pointer to Number of graphics-capable queue families.
p_surface_queue_family_countValid destination pointer to Number of surface-capable queue families.
p_compute_queue_family_countValid destination pointer to Number of compute-capable queue families.
p_transfer_queue_family_countValid destination pointer to Number of transfer-capable queue families.
p_graphics_queue_family_indicesValid destination pointer to the indices of the graphics-capable queue families.
p_surface_queue_family_indicesValid destination pointer to the indices of the surface-capable queue families.
p_compute_queue_family_indicesValid destination pointer to the indices of the compute-capable queue families.
p_transfer_queue_family_indicesValid destination pointer to the indices of the transfer-capable queue families.
p_queue_families_propertiesValid destination pointer to a VkQueueFamilyProperties structure.
Returns
1 if successful, 0 otherwise.

◆ shGetPhysicalDeviceSurfaceCapabilities()

uint8_t shGetPhysicalDeviceSurfaceCapabilities ( VkPhysicalDevice physical_device,
VkSurfaceKHR surface,
VkSurfaceCapabilitiesKHR * p_surface_capabilities )
extern

Retrieves the surface capabilities of a physical device.

This function queries the surface capabilities (such as min/max image count and extent) for a physical device and surface combination.

Parameters
physical_deviceValid physical device.
surfaceValid Vulkan surface to query capabilities for.
p_surface_capabilitiesValid destination pointer to a structure where the surface capabilities will be stored.
Returns
1 if successful, 0 otherwise.

◆ shGetPhysicalDeviceSurfaceSupport()

uint8_t shGetPhysicalDeviceSurfaceSupport ( VkPhysicalDevice physical_device,
uint32_t queue_family_index,
VkSurfaceKHR surface,
uint8_t * p_supported )
extern

Queries if a queue family supports presenting to a surface.

This function queries whether a specific queue family of a physical device supports presenting to a Vulkan surface.

Parameters
physical_deviceValid physical device.
queue_family_indexIndex of the queue family to check.
surfaceValid surface to check for support.
p_supportedValid destination pointer to Flag indicating support (1 if supported, 0 otherwise).
Returns
1 if successful, 0 otherwise.

◆ shGetQueueFamilySurfaceSupport()

uint8_t shGetQueueFamilySurfaceSupport ( VkPhysicalDevice physical_device,
uint32_t queue_family_index,
VkSurfaceKHR surface,
uint8_t * p_support )
extern

Checks if a queue family supports presenting to a surface.

This function checks whether a queue family of a physical device supports presentation to a surface.

Parameters
physical_deviceValid physical device to query.
queue_family_indexIndex of the queue family to check.
surfaceValid surface to check for support.
p_supportValid destination pointer to Flag indicating support (1 if supported, 0 otherwise).
Returns
1 if successful, 0 otherwise.

◆ shGetSwapchainImages()

uint8_t shGetSwapchainImages ( VkDevice device,
VkSwapchainKHR swapchain,
uint32_t * p_swapchain_image_count,
VkImage * p_swapchain_images )
extern

Retrieves the images in a swapchain.

This function retrieves the Vulkan images present in a swapchain.

Parameters
deviceValid Vulkan device.
swapchainValid Vulkan swapchain.
p_swapchain_image_countValid destination pointer to the number of swapchain images.
p_swapchain_imagesValid destination pointer to an array of VkImage handles.
Returns
1 if successful, 0 otherwise.

◆ shPipelineBindDescriptorSetUnits()

uint8_t shPipelineBindDescriptorSetUnits ( VkCommandBuffer cmd_buffer,
uint32_t first_descriptor_set,
uint32_t first_descriptor_set_unit_idx,
uint32_t descriptor_set_unit_count,
VkPipelineBindPoint bind_point,
uint32_t dynamic_descriptors_count,
uint32_t * p_dynamic_offsets,
ShVkPipelinePool * p_pipeline_pool,
ShVkPipeline * p_pipeline )
extern

Binds descriptor set units to a pipeline within a command buffer.

This function binds descriptor set units to a pipeline and command buffer, specifying dynamic offsets if needed.

Parameters
cmd_bufferValid Vulkan command buffer.
first_descriptor_setIndex of the first descriptor set.
first_descriptor_set_unit_idxIndex of the first descriptor set unit.
descriptor_set_unit_countNumber of descriptor set units to bind.
bind_pointPipeline bind point (e.g., VK_PIPELINE_BIND_POINT_GRAPHICS).
dynamic_descriptors_countNumber of dynamic descriptors.
p_dynamic_offsetsArray of dynamic offsets for the descriptors.
p_pipeline_poolValid pointer to the ShVkPipelinePool structure.
p_pipelineValid destination pointer to the ShVkPipeline structure.
Returns
1 if successful, 0 otherwise.

◆ shPipelineColorBlendSettings()

uint8_t shPipelineColorBlendSettings ( uint8_t enable_color_blending,
uint8_t enable_alpha_blending,
uint32_t subpass_color_attachment_count,
ShVkPipeline * p_pipeline )
extern

Configures color blending settings in the pipeline.

This function sets color blending and alpha blending settings in the ShVkPipeline structure.

Parameters
enable_color_blendingFlag indicating if color blending is enabled.
enable_alpha_blendingFlag indicating if alpha blending is enabled.
subpass_color_attachment_countNumber of color attachments for the subpass.
p_pipelineValid destination pointer to the ShVkPipeline structure to update.
Returns
1 if successful, 0 otherwise.

◆ shPipelineCreateInputAssembly()

uint8_t shPipelineCreateInputAssembly ( VkPrimitiveTopology primitive_topology,
VkBool32 primitive_restart_enable,
ShVkPipeline * p_pipeline )
extern

Creates input assembly state information for the pipeline.

This function sets the input assembly state information in the ShVkPipeline structure.

Parameters
primitive_topologyPrimitive topology used in the input assembly.
primitive_restart_enableFlag indicating if primitive restart is enabled.
p_pipelineValid destination pointer to the ShVkPipeline structure to update.
Returns
1 if successful, 0 otherwise.

◆ shPipelineCreateLayout()

uint8_t shPipelineCreateLayout ( VkDevice device,
uint32_t first_descriptor_set_layout,
uint32_t descriptor_set_layout_count,
ShVkPipelinePool * p_pipeline_pool,
ShVkPipeline * p_pipeline )
extern

Creates a pipeline layout and updates the pipeline structure.

This function creates a Vulkan pipeline layout using the specified descriptor set layouts and updates the ShVkPipeline structure.

Parameters
deviceValid Vulkan device.
first_descriptor_set_layoutIndex of the first descriptor set layout.
descriptor_set_layout_countNumber of descriptor set layouts.
p_pipeline_poolValid pointer to the ShVkPipelinePool structure.
p_pipelineValid destination pointer to the ShVkPipeline structure to update.
Returns
1 if successful, 0 otherwise.

◆ shPipelineCreateRasterizer()

uint8_t shPipelineCreateRasterizer ( VkPolygonMode polygon_mode,
VkCullModeFlagBits cull_mode,
ShVkPipeline * p_pipeline )
extern

Creates rasterizer state information for the pipeline.

This function sets the rasterizer state information in the ShVkPipeline structure.

Parameters
polygon_modePolygon mode used in rasterization.
cull_modeCulling mode used in rasterization.
p_pipelineValid destination pointer to the ShVkPipeline structure to update.
Returns
1 if successful, 0 otherwise.

◆ shPipelineCreateShaderModule()

uint8_t shPipelineCreateShaderModule ( VkDevice device,
uint32_t size,
char * code,
ShVkPipeline * p_pipeline )
extern

Creates a shader module and adds it to the pipeline.

This function creates a Vulkan shader module and updates the ShVkPipeline structure.

Parameters
deviceValid Vulkan device.
sizeSize of the shader code.
codePointer to the shader code.
p_pipelineValid destination pointer to the ShVkPipeline structure to update.
Returns
1 if successful, 0 otherwise.

◆ shPipelineCreateShaderStage()

uint8_t shPipelineCreateShaderStage ( VkShaderStageFlags shader_stage,
ShVkPipeline * p_pipeline )
extern

Creates a shader stage and adds it to the pipeline.

This function creates a Vulkan shader stage and updates the ShVkPipeline structure.

Parameters
shader_stageVulkan shader stage flags (e.g., vertex, fragment).
p_pipelineValid destination pointer to the ShVkPipeline structure to update.
Returns
1 if successful, 0 otherwise.

◆ shPipelineDestroyLayout()

uint8_t shPipelineDestroyLayout ( VkDevice device,
ShVkPipeline * p_pipeline )
extern

Destroys the pipeline layout associated with the pipeline.

This function destroys the pipeline layout used by the ShVkPipeline structure.

Parameters
deviceValid Vulkan device.
p_pipelineValid destination pointer to the ShVkPipeline structure.
Returns
1 if successful, 0 otherwise.

◆ shPipelineDestroyShaderModules()

uint8_t shPipelineDestroyShaderModules ( VkDevice device,
uint32_t first_module,
uint32_t module_count,
ShVkPipeline * p_pipeline )
extern

Destroys shader modules associated with the pipeline.

This function destroys a range of shader modules that are part of the ShVkPipeline structure.

Parameters
deviceValid Vulkan device.
first_moduleIndex of the first shader module to destroy.
module_countNumber of shader modules to destroy.
p_pipelineValid destination pointer to the ShVkPipeline structure.
Returns
1 if successful, 0 otherwise.

◆ shPipelinePoolAllocateDescriptorSetUnits()

uint8_t shPipelinePoolAllocateDescriptorSetUnits ( VkDevice device,
uint32_t binding,
uint32_t pool_idx,
VkDescriptorType descriptor_type,
uint32_t first_descriptor_set_unit,
uint32_t descriptor_set_unit_count,
ShVkPipelinePool * p_pipeline_pool )
extern

Allocates descriptor set units in the pipeline pool.

This function allocates descriptor set units for the pipeline pool.

Parameters
deviceValid Vulkan device.
bindingBinding index in the descriptor set layout.
pool_idxIndex of the descriptor pool.
descriptor_typeType of the descriptor (e.g., VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER).
first_descriptor_set_unitIndex of the first descriptor set unit to allocate.
descriptor_set_unit_countNumber of descriptor set units to allocate.
[in,out]p_pipeline_poolValid pointer to the ShVkPipelinePool structure.
Returns
1 if successful, 0 otherwise.

◆ shPipelinePoolCopyDescriptorSetLayout()

uint8_t shPipelinePoolCopyDescriptorSetLayout ( uint32_t src_set_layout_idx,
uint32_t first_dst_set_layout_idx,
uint32_t dst_set_layout_count,
ShVkPipelinePool * p_pipeline_pool )
extern

Copies descriptor set layouts within the pipeline pool.

This function copies descriptor set layouts from source indices to destination indices in the pipeline pool.

Parameters
src_set_layout_idxIndex of the source descriptor set layout.
first_dst_set_layout_idxIndex of the first destination descriptor set layout.
dst_set_layout_countNumber of destination descriptor set layouts.
[in,out]p_pipeline_poolValid pointer to the ShVkPipelinePool structure.
Returns
1 if successful, 0 otherwise.

◆ shPipelinePoolCreateDescriptorPool()

uint8_t shPipelinePoolCreateDescriptorPool ( VkDevice device,
uint32_t pool_idx,
VkDescriptorType descriptor_type,
uint32_t descriptor_count,
ShVkPipelinePool * p_pipeline_pool )
extern

Creates a descriptor pool in the pipeline pool.

This function initializes a descriptor pool in the pipeline pool.

Parameters
deviceValid Vulkan device.
pool_idxIndex of the pool to initialize.
descriptor_typeType of the descriptor (e.g., VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER).
descriptor_countNumber of descriptors in the pool.
[in,out]p_pipeline_poolValid pointer to the ShVkPipelinePool structure.
Returns
1 if successful, 0 otherwise.

◆ shPipelinePoolCreateDescriptorSetLayout()

uint8_t shPipelinePoolCreateDescriptorSetLayout ( VkDevice device,
uint32_t first_binding_idx,
uint32_t binding_count,
uint32_t set_layout_idx,
ShVkPipelinePool * p_pipeline_pool )
extern

Creates descriptor set layouts in the pipeline pool.

This function initializes descriptor set layouts in the pipeline pool.

Parameters
deviceValid Vulkan device.
first_binding_idxIndex of the first binding in the layout.
binding_countNumber of bindings.
set_layout_idxIndex of the set layout to initialize.
[in,out]p_pipeline_poolValid pointer to the ShVkPipelinePool structure.
Returns
1 if successful, 0 otherwise.

◆ shPipelinePoolCreateDescriptorSetLayoutBinding()

uint8_t shPipelinePoolCreateDescriptorSetLayoutBinding ( uint32_t binding,
VkDescriptorType descriptor_type,
uint32_t descriptor_set_count,
VkShaderStageFlags shader_stage,
ShVkPipelinePool * p_pipeline_pool )
extern

Creates a descriptor set layout binding for the pipeline pool.

This function initializes a descriptor set layout binding in the pipeline pool.

Parameters
bindingBinding index in the descriptor set layout.
descriptor_typeType of the descriptor (e.g., VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER).
descriptor_set_countNumber of descriptor sets.
shader_stageShader stages that use this descriptor.
[in,out]p_pipeline_poolValid pointer to the ShVkPipelinePool structure.
Returns
1 if successful, 0 otherwise.

◆ shPipelinePoolDestroyDescriptorPools()

uint8_t shPipelinePoolDestroyDescriptorPools ( VkDevice device,
uint32_t first_pool,
uint32_t pool_count,
ShVkPipelinePool * p_pipeline_pool )
extern

Destroys descriptor pools in the pipeline pool.

This function destroys a range of descriptor pools in the pipeline pool.

Parameters
deviceValid Vulkan device.
first_poolIndex of the first descriptor pool to destroy.
pool_countNumber of descriptor pools to destroy.
[in,out]p_pipeline_poolValid pointer to the ShVkPipelinePool structure.
Returns
1 if successful, 0 otherwise.

◆ shPipelinePoolDestroyDescriptorSetLayouts()

uint8_t shPipelinePoolDestroyDescriptorSetLayouts ( VkDevice device,
uint32_t first_set_layout,
uint32_t set_layout_count,
ShVkPipelinePool * p_pipeline_pool )
extern

Destroys descriptor set layouts in the pipeline pool.

This function destroys a range of descriptor set layouts in the pipeline pool.

Parameters
deviceValid Vulkan device.
first_set_layoutIndex of the first descriptor set layout to destroy.
set_layout_countNumber of descriptor set layouts to destroy.
[in,out]p_pipeline_poolValid pointer to the ShVkPipelinePool structure.
Returns
1 if successful, 0 otherwise.

◆ shPipelinePoolSetDescriptorBufferInfos()

uint8_t shPipelinePoolSetDescriptorBufferInfos ( uint32_t first_descriptor,
uint32_t descriptor_count,
VkBuffer buffer,
uint32_t buffer_offset,
uint32_t buffer_size,
ShVkPipelinePool * p_pipeline_pool )
extern

Sets descriptor buffer infos in the pipeline pool.

This function sets the buffer information for descriptors in the pipeline pool.

Parameters
first_descriptorIndex of the first descriptor to set.
descriptor_countNumber of descriptors to update.
bufferVulkan buffer to associate with the descriptors.
buffer_offsetOffset into the buffer.
buffer_sizeSize of the buffer.
[in,out]p_pipeline_poolValid pointer to the ShVkPipelinePool structure.
Returns
1 if successful, 0 otherwise.

◆ shPipelinePoolUpdateDescriptorSetUnits()

uint8_t shPipelinePoolUpdateDescriptorSetUnits ( VkDevice device,
uint32_t first_descriptor_set_unit,
uint32_t descriptor_set_unit_count,
ShVkPipelinePool * p_pipeline_pool )
extern

Updates descriptor set units in the pipeline pool.

This function updates the descriptor set units within the pipeline pool.

Parameters
deviceValid Vulkan device.
first_descriptor_set_unitIndex of the first descriptor set unit to update.
descriptor_set_unit_countNumber of descriptor set units to update.
[in,out]p_pipeline_poolValid pointer to the ShVkPipelinePool structure.
Returns
1 if successful, 0 otherwise.

◆ shPipelinePushConstants()

uint8_t shPipelinePushConstants ( VkCommandBuffer cmd_buffer,
void * p_data,
ShVkPipeline * p_pipeline )
extern

Pushes constants to a pipeline using the command buffer.

This function updates the push constants for a pipeline within a command buffer.

Parameters
cmd_bufferValid Vulkan command buffer.
p_dataPointer to the data to be pushed to the constants.
p_pipelineValid destination pointer to the ShVkPipeline structure containing push constants information.
Returns
1 if successful, 0 otherwise.

◆ shPipelineSetMultisampleState()

uint8_t shPipelineSetMultisampleState ( VkSampleCountFlagBits sample_count,
float min_sample_shading_size,
ShVkPipeline * p_pipeline )
extern

Sets multisample state information in the pipeline.

This function sets the multisample state information in the ShVkPipeline structure.

Parameters
sample_countNumber of samples used in multisampling.
min_sample_shading_sizeMinimum sample shading size.
p_pipelineValid destination pointer to the ShVkPipeline structure to update.
Returns
1 if successful, 0 otherwise.

◆ shPipelineSetPushConstants()

uint8_t shPipelineSetPushConstants ( VkShaderStageFlags shader_stage,
uint32_t offset,
uint32_t size,
ShVkPipeline * p_pipeline )
extern

Sets push constants in the pipeline.

This function sets the push constant range for a specific shader stage in the ShVkPipeline structure.

Parameters
shader_stageVulkan shader stage flags (e.g., vertex, fragment).
offsetOffset of the push constants.
sizeSize of the push constants.
p_pipelineValid destination pointer to the ShVkPipeline structure to update.
Returns
1 if successful, 0 otherwise.

◆ shPipelineSetVertexAttribute()

uint8_t shPipelineSetVertexAttribute ( uint32_t location,
uint32_t binding,
VkFormat format,
uint32_t offset,
ShVkPipeline * p_pipeline )
extern

Sets vertex attribute information in the pipeline.

This function sets the vertex attribute description for a specific location in the ShVkPipeline structure.

Parameters
locationLocation index.
bindingBinding index.
formatVertex attribute format.
offsetOffset of the vertex attribute.
p_pipelineValid destination pointer to the ShVkPipeline structure to update.
Returns
1 if successful, 0 otherwise.

◆ shPipelineSetVertexBinding()

uint8_t shPipelineSetVertexBinding ( uint32_t binding,
uint32_t size,
VkVertexInputRate input_rate,
ShVkPipeline * p_pipeline )
extern

Sets vertex binding information in the pipeline.

This function sets the vertex binding description for a specific binding index in the ShVkPipeline structure.

Parameters
bindingBinding index.
sizeSize of the vertex binding.
input_rateVertex input rate.
p_pipelineValid destination pointer to the ShVkPipeline structure to update.
Returns
1 if successful, 0 otherwise.

◆ shPipelineSetVertexInputState()

uint8_t shPipelineSetVertexInputState ( ShVkPipeline * p_pipeline)
extern

Sets vertex input state information in the pipeline.

This function sets the vertex input state information in the ShVkPipeline structure.

Parameters
p_pipelineValid destination pointer to the ShVkPipeline structure to update.
Returns
1 if successful, 0 otherwise.

◆ shPipelineSetViewport()

uint8_t shPipelineSetViewport ( uint32_t viewport_pos_x,
uint32_t viewport_pos_y,
uint32_t viewport_width,
uint32_t viewport_height,
uint32_t scissors_pos_x,
uint32_t scissors_pos_y,
uint32_t scissors_width,
uint32_t scissors_height,
ShVkPipeline * p_pipeline )
extern

Sets viewport and scissor information in the pipeline.

This function sets the viewport and scissor information in the ShVkPipeline structure.

Parameters
viewport_pos_xX position of the viewport.
viewport_pos_yY position of the viewport.
viewport_widthWidth of the viewport.
viewport_heightHeight of the viewport.
scissors_pos_xX position of the scissors rectangle.
scissors_pos_yY position of the scissors rectangle.
scissors_widthWidth of the scissors rectangle.
scissors_heightHeight of the scissors rectangle.
p_pipelineValid destination pointer to the ShVkPipeline structure to update.
Returns
1 if successful, 0 otherwise.

◆ shQueryForDeviceQueueInfo()

uint8_t shQueryForDeviceQueueInfo ( uint32_t queue_family_index,
uint32_t queue_count,
float * p_queue_priorities,
uint8_t protected,
VkDeviceQueueCreateInfo * p_device_queue_info )
extern

Queries information for device queue creation.

This function sets up the necessary information for creating device queues, including the queue family index, queue count, priorities, and queue protection settings.

Parameters
queue_family_indexIndex of the queue family.
queue_countNumber of queues to create in the specified family.
p_queue_prioritiesValid pointer to an array of queue priorities.
protectedFlag indicating whether the queue should be protected (1 for protected, 0 for unprotected).
p_device_queue_infoValid destination pointer to a VkDeviceQueueCreateInfo structure where the queue info will be stored.
Returns
1 if successful, 0 otherwise.

◆ shQueuePresentSwapchainImage()

uint8_t shQueuePresentSwapchainImage ( VkQueue present_queue,
uint32_t semaphores_to_wait_for_count,
VkSemaphore * p_semaphores_to_wait_for,
VkSwapchainKHR swapchain,
uint32_t swapchain_image_idx )
extern

Presents an image from a Vulkan swapchain to the screen.

This function presents an image from the specified swapchain using the provided queue.

Parameters
present_queueValid Vulkan queue to present the image.
semaphores_to_wait_for_countNumber of semaphores to wait for before presenting.
p_semaphores_to_wait_forValid pointer to an array of Vulkan semaphores to wait for.
swapchainValid Vulkan swapchain containing the image to present.
swapchain_image_idxIndex of the swapchain image to present.
Returns
1 if successful, 0 otherwise.

◆ shQueueSubmit()

uint8_t shQueueSubmit ( uint32_t cmd_buffer_count,
VkCommandBuffer * p_cmd_buffers,
VkQueue queue,
VkFence fence,
uint32_t semaphores_to_wait_for_count,
VkSemaphore * p_semaphores_to_wait_for,
VkPipelineStageFlags wait_stage,
uint32_t signal_semaphore_count,
VkSemaphore * p_signal_semaphores )
extern

Submits command buffers to a Vulkan queue.

This function submits command buffers to a Vulkan queue and optionally waits for a fence and signals semaphores.

Parameters
cmd_buffer_countNumber of command buffers to submit.
p_cmd_buffersValid pointer to an array of Vulkan command buffers.
queueValid Vulkan queue to which to submit.
fenceValid Vulkan fence to signal upon completion.
semaphores_to_wait_for_countNumber of semaphores to wait for.
p_semaphores_to_wait_forValid pointer to an array of Vulkan semaphores to wait for.
wait_stagePipeline stage flags to wait for.
signal_semaphore_countNumber of semaphores to signal.
p_signal_semaphoresValid pointer to an array of Vulkan semaphores to signal.
Returns
1 if successful, 0 otherwise.

◆ shReadMemory()

uint8_t shReadMemory ( VkDevice device,
VkDeviceMemory memory,
uint32_t offset,
uint64_t data_size,
void ** pp_map_data,
void * p_dst_data )
extern

Reads data from a Vulkan memory object.

This function reads data from a specified offset in a Vulkan memory object into a user-provided buffer.

Parameters
deviceValid Vulkan device.
memoryValid Vulkan device memory to read from.
offsetOffset in the memory to start reading from.
data_sizeNumber of bytes to read.
p_dataValid destination pointer to a buffer to store the read data.
Returns
1 if successful, 0 otherwise.

◆ shResetCommandBuffer()

uint8_t shResetCommandBuffer ( VkCommandBuffer cmd_buffer)
extern

Resets a Vulkan command buffer.

This function resets a command buffer to the initial state.

Parameters
cmd_bufferValid Vulkan command buffer to reset.
Returns
1 if successful, 0 otherwise.

◆ shResetFences()

uint8_t shResetFences ( VkDevice device,
uint32_t fence_count,
VkFence * p_fences )
extern

Resets Vulkan fences.

This function resets a specified number of Vulkan fences to their initial state.

Parameters
deviceValid Vulkan device.
fence_countNumber of fences to reset.
p_fencesValid pointer to an array of Vulkan fences to reset.
Returns
1 if successful, 0 otherwise.

◆ shResetSemaphores()

uint8_t shResetSemaphores ( VkDevice device,
uint32_t semaphore_count,
VkSemaphore * p_semaphores )
extern

Resets Vulkan semaphores.

This function resets a specified number of Vulkan semaphores to their initial state.

Parameters
deviceValid Vulkan device.
semaphore_countNumber of semaphores to reset.
p_semaphoresValid pointer to an array of Vulkan semaphores to reset.
Returns
1 if successful, 0 otherwise.

◆ shSelectPhysicalDevice()

uint8_t shSelectPhysicalDevice ( VkInstance instance,
VkSurfaceKHR surface,
VkQueueFlags requirements,
VkPhysicalDevice * p_physical_device,
VkPhysicalDeviceProperties * p_physical_device_properties,
VkPhysicalDeviceFeatures * p_physical_device_features,
VkPhysicalDeviceMemoryProperties * p_physical_device_memory_properties )
extern

Selects a physical device that meets specified requirements.

This function selects a Vulkan physical device based on specified requirements such as queue support, surface capabilities, and required device features. Then it retrieves vital information about the GPU.

Parameters
instanceValid Vulkan instance.
surfaceValid surface if presentation support is required, otherwise it can be set as VK_NULL_HANDLE.
requirementsQueue family requirements (VkQueueFlags).
p_physical_deviceValid destination pointer to the selected Vulkan physical device.
p_physical_device_propertiesValid destination pointer to the properties of the selected physical device.
p_physical_device_featuresValid destination pointer to the features of the selected physical device.
p_physical_device_memory_propertiesValid destination pointer to the memory properties of the selected physical device.
Returns
1 if a suitable device is found, 0 otherwise.

◆ shSetBufferMemoryBarrier()

uint8_t shSetBufferMemoryBarrier ( VkDevice device,
VkCommandBuffer cmd_buffer,
VkBuffer buffer,
VkAccessFlags access_before_barrier,
VkAccessFlags access_after_barrier,
uint32_t performing_queue_family_index_before_barrier,
uint32_t performing_queue_family_index_after_barrier,
VkPipelineStageFlags pipeline_stage_before_barrier,
VkPipelineStageFlags pipeline_stage_after_barrier )
extern

Creates a buffer memory barrier.

This function creates a buffer memory barrier to synchronize buffer memory access (e.g. read, write, transfer).

Parameters
deviceValid Vulkan device.
cmd_bufferValid Vulkan command buffer.
bufferValid Vulkan buffer (target of the barrier).
access_before_barrierMemory access flag before the barrier.
access_after_barrierMemory access flag sfter the barrier.
performing_queue_family_index_before_barrierPerforming queue family index before the barrier.
performing_queue_family_index_after_barrierPerforming queue family index before the barrier.
pipeline_stage_before_barrierPipeline stage flag before the barrier.
pipeline_stage_after_barrierPipeline stage flag after the barrier.
Returns
1 if successful, 0 otherwise.

◆ shSetDescriptorBufferInfo()

uint8_t shSetDescriptorBufferInfo ( VkBuffer buffer,
uint32_t buffer_offset,
uint32_t buffer_size,
VkDescriptorBufferInfo * p_buffer_info )
extern

Sets buffer information for a descriptor buffer.

This function sets buffer information for a descriptor buffer.

Parameters
bufferValid Vulkan buffer.
buffer_offsetOffset in the buffer.
buffer_sizeSize of the buffer.
p_buffer_infoValid destination pointer to the Vulkan descriptor buffer info.
Returns
1 if successful, 0 otherwise.

◆ shSetImageMemoryBarrier()

uint8_t shSetImageMemoryBarrier ( VkDevice device,
VkCommandBuffer cmd_buffer,
VkImage image,
VkImageAspectFlags image_aspect_mask,
VkAccessFlags access_before_barrier,
VkAccessFlags access_after_barrier,
VkImageLayout image_layout_before_barrier,
VkImageLayout image_layout_after_barrier,
uint32_t performing_queue_family_index_before_barrier,
uint32_t performing_queue_family_index_after_barrier,
VkPipelineStageFlags pipeline_stage_before_barrier,
VkPipelineStageFlags pipeline_stage_after_barrier )
extern

Creates an image memory barrier.

This function creates an image memory barrier to synchronize image memory access (e.g. read, write, transfer).

Parameters
deviceValid Vulkan device.
cmd_bufferValid Vulkan command buffer.
imageValid Vulkan image (target of the barrier).
image_aspect_maskTarget image aspect mask.
access_before_barrierMemory access flag before the barrier.
access_after_barrierMemory access flag sfter the barrier.
image_layout_before_barrierImage layout before the barrier.
image_layout_after_barrierImage layout before the barrier.
performing_queue_family_index_before_barrierPerforming queue family index before the barrier.
performing_queue_family_index_after_barrierPerforming queue family index before the barrier.
pipeline_stage_before_barrierPipeline stage flag before the barrier.
pipeline_stage_after_barrierPipeline stage flag after the barrier.
Returns
1 if successful, 0 otherwise.

◆ shSetLogicalDevice()

uint8_t shSetLogicalDevice ( VkPhysicalDevice physical_device,
VkDevice * p_device,
uint32_t extension_count,
char ** pp_extension_names,
uint32_t device_queue_count,
VkDeviceQueueCreateInfo * p_device_queue_infos )
extern

Sets up a Vulkan logical device.

This function creates a Vulkan logical device with specified extensions, queue creation info, and other configurations.

Parameters
physical_deviceValid Vulkan physical device.
p_deviceValid destination pointer to the newly created VkDevice.
extension_countNumber of Vulkan extensions to enable.
pp_extension_namesValid pointer to extension names to enable.
device_queue_countNumber of device queues to create.
p_device_queue_infosValid pointer to an array of VkDeviceQueueCreateInfo structures.
Returns
1 if the logical device is created successfully, 0 otherwise.

◆ shSetMultisampleState()

uint8_t shSetMultisampleState ( VkSampleCountFlagBits sample_count,
float min_sample_shading_size,
VkPipelineMultisampleStateCreateInfo * p_multisample_state )
extern

Sets the multisample state for a pipeline.

This function sets the multisample state, including sample count and minimum sample shading, for a Vulkan pipeline.

Parameters
sample_countVulkan sample count flag bits.
min_sample_shading_sizeMinimum sample shading size.
p_multisample_stateValid destination pointer to the Vulkan pipeline multisample state create info.
Returns
1 if successful, 0 otherwise.

◆ shSetPushConstants()

uint8_t shSetPushConstants ( VkShaderStageFlags shader_stage,
uint32_t offset,
uint32_t size,
VkPushConstantRange * p_push_constant_range )
extern

Sets push constants for a shader stage.

This function sets push constants for a specified shader stage.

Parameters
shader_stageVulkan shader stage flags (e.g., vertex, fragment).
offsetOffset in bytes from the start of the push constant range.
sizeSize of the push constants in bytes.
p_push_constant_rangeValid destination pointer to the Vulkan push constant range.
Returns
1 if successful, 0 otherwise.

◆ shSetupComputePipeline()

uint8_t shSetupComputePipeline ( VkDevice device,
ShVkPipeline * p_pipeline )
extern

Sets up a compute pipeline.

This function sets up a Vulkan compute pipeline using the ShVkPipeline structure.

Parameters
deviceValid Vulkan device.
p_pipelineValid destination pointer to the ShVkPipeline structure to setup.
Returns
1 if successful, 0 otherwise.

◆ shSetupGraphicsPipeline()

uint8_t shSetupGraphicsPipeline ( VkDevice device,
VkRenderPass render_pass,
ShVkPipeline * p_pipeline )
extern

Sets up a graphics pipeline.

This function sets up a Vulkan graphics pipeline using the ShVkPipeline structure and the specified render pass.

Parameters
deviceValid Vulkan device.
render_passValid Vulkan render pass.
p_pipelineValid destination pointer to the ShVkPipeline structure to setup.
Returns
1 if successful, 0 otherwise.

◆ shSetVertexAttribute()

uint8_t shSetVertexAttribute ( uint32_t location,
uint32_t binding,
VkFormat format,
uint32_t offset,
VkVertexInputAttributeDescription * p_vertex_input_attribute )
extern

Sets the vertex attribute description.

This function sets the vertex attribute description with the specified parameters.

Parameters
locationLocation of the vertex attribute.
bindingBinding index of the vertex attribute.
formatVulkan format of the vertex attribute.
offsetOffset in the vertex buffer where the attribute starts.
p_vertex_input_attributeValid destination pointer to the Vulkan vertex input attribute description.
Returns
1 if successful, 0 otherwise.

◆ shSetVertexBinding()

uint8_t shSetVertexBinding ( uint32_t binding,
uint32_t size,
VkVertexInputRate input_rate,
VkVertexInputBindingDescription * p_vertex_input_binding )
extern

Sets the vertex input binding description.

This function sets the vertex input binding description with the specified parameters.

Parameters
bindingBinding index for the vertex input binding.
sizeSize of the vertex buffer in bytes.
input_rateVertex input rate (e.g., per vertex or per instance).
p_vertex_input_bindingValid destination pointer to the Vulkan vertex input binding description.
Returns
1 if successful, 0 otherwise.

◆ shSetVertexInputState()

uint8_t shSetVertexInputState ( uint32_t vertex_binding_count,
VkVertexInputBindingDescription * p_vertex_bindings,
uint32_t vertex_attribute_count,
VkVertexInputAttributeDescription * p_vertex_attributes,
VkPipelineVertexInputStateCreateInfo * p_vertex_input_state )
extern

Sets the vertex input state for a pipeline.

This function sets the vertex input state, including bindings and attributes, for a Vulkan pipeline.

Parameters
vertex_binding_countNumber of vertex input bindings.
p_vertex_bindingsValid pointer to an array of Vulkan vertex input binding descriptions.
vertex_attribute_countNumber of vertex input attributes.
p_vertex_attributesValid pointer to an array of Vulkan vertex input attribute descriptions.
p_vertex_input_stateValid destination pointer to the Vulkan pipeline vertex input state create info.
Returns
1 if successful, 0 otherwise.

◆ shSetViewport()

uint8_t shSetViewport ( uint32_t viewport_pos_x,
uint32_t viewport_pos_y,
uint32_t viewport_width,
uint32_t viewport_height,
VkViewport * p_viewport,
uint32_t scissors_pos_x,
uint32_t scissors_pos_y,
uint32_t scissors_width,
uint32_t scissors_height,
VkRect2D * p_scissors,
VkPipelineViewportStateCreateInfo * p_viewport_state )
extern

Sets the viewport and scissor state for a pipeline.

This function sets the viewport and scissor parameters for a Vulkan pipeline.

Parameters
viewport_pos_xX position of the viewport.
viewport_pos_yY position of the viewport.
viewport_widthWidth of the viewport.
viewport_heightHeight of the viewport.
p_viewportValid destination pointer to the Vulkan viewport.
scissors_pos_xX position of the scissor.
scissors_pos_yY position of the scissor.
scissors_widthWidth of the scissor.
scissors_heightHeight of the scissor.
p_scissorsValid destination pointer to the Vulkan scissor rectangle.
p_viewport_stateValid destination pointer to the Vulkan pipeline viewport state create info.
Returns
1 if successful, 0 otherwise.

◆ shTranslateVkResult()

const char * shTranslateVkResult ( VkResult vk_result)
extern

Translates a VkResult enum into a literal string.

This function converts a Vulkan VkResult code into a literal string that describes the result, which is helpful for error messages and debugging.

Parameters
vk_resultThe Vulkan result code (VkResult).
Returns
A string representing the Vulkan result literal.
Note
This function is often used in error reporting to provide more descriptive information about Vulkan errors, such as converting VK_ERROR_OUT_OF_HOST_MEMORY to its string form.

◆ shUnmapMemory()

uint8_t shUnmapMemory ( VkDevice device,
VkDeviceMemory memory )
extern

◆ shWaitDeviceIdle()

uint8_t shWaitDeviceIdle ( VkDevice device)
extern

Waits for a Vulkan device to become idle.

This function waits until the Vulkan device has finished all its operations.

Parameters
deviceValid Vulkan device.
Returns
1 if successful, 0 otherwise.

◆ shWaitForFences()

uint8_t shWaitForFences ( VkDevice device,
uint32_t fence_count,
VkFence * p_fences,
uint8_t wait_for_all,
uint64_t timeout_ns )
extern

Waits for Vulkan fences to become signaled.

This function waits for a specified number of Vulkan fences to become signaled.

Parameters
deviceValid Vulkan device.
fence_countNumber of fences to wait for.
p_fencesValid pointer to an array of Vulkan fences to wait for.
wait_for_allWhether to wait for all fences to be signaled.
timeout_nsTimeout in nanoseconds to wait for the fences.
Returns
1 if successful, 0 otherwise.

◆ shWaitForQueue()

uint8_t shWaitForQueue ( VkQueue queue)
extern

Waits for a Vulkan queue to become idle.

This function waits until the Vulkan queue has finished all its operations.

Parameters
queueValid Vulkan queue to wait for.
Returns
1 if successful, 0 otherwise.

◆ shWaitForSemaphores()

uint8_t shWaitForSemaphores ( VkDevice device,
uint32_t semaphore_count,
VkSemaphore * p_semaphores,
uint8_t wait_for_all,
uint64_t timeout_ns,
uint64_t * p_semaphores_values )
extern

Waits for Vulkan semaphores to become signaled.

This function waits for a specified number of Vulkan semaphores to become signaled.

Parameters
deviceValid Vulkan device.
semaphore_countNumber of semaphores to wait for.
p_semaphoresValid pointer to an array of Vulkan semaphores to wait for.
wait_for_allWhether to wait for all semaphores to be signaled.
timeout_nsTimeout in nanoseconds to wait for the semaphores.
p_semaphores_valuesValid destination pointer to an array of values for each semaphore.
Returns
1 if successful, 0 otherwise.

◆ shWriteMemory()

uint8_t shWriteMemory ( VkDevice device,
VkDeviceMemory memory,
uint32_t offset,
uint32_t data_size,
void * p_data )
extern

Writes data to a Vulkan memory object.

This function writes data from a user-provided buffer to a specified offset in a Vulkan memory object.

Parameters
deviceValid Vulkan device.
memoryValid Vulkan device memory to write to.
offsetOffset in the memory to start writing to.
data_sizeNumber of bytes to write.
p_dataValid pointer to a buffer containing the data to write.
Returns
1 if successful, 0 otherwise.