shvulkan pre-release
by mrsinho.
|
#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. | |
#define SH_FALSE 0 |
#define SH_FORMAT_SFLOAT 2 |
#define SH_FORMAT_SINT 1 |
#define SH_FORMAT_UINT 0 |
#define SH_FORMAT_UNDEFINED 3 |
#define SH_MAX_PIPELINE_POOL_DESCRIPTOR_COUNT 64 |
#define SH_MAX_PIPELINE_SHADER_STAGE_COUNT 6 |
#define SH_MAX_PIPELINE_SUBPASS_COLOR_ATTACHMENT_COUNT 9 |
#define SH_MAX_PIPELINE_VERTEX_ATTRIBUTE_COUNT 32 |
#define SH_MAX_PIPELINE_VERTEX_BINDING_COUNT 32 |
#define SH_MAX_STACK_BUFFER_REGION_COUNT 256 |
#define SH_MAX_STACK_DEVICE_COLOR_FORMATS_QUERIES 44 |
#define SH_MAX_STACK_DEVICE_SURFACE_FORMAT_COUNT 256 |
#define SH_MAX_STACK_PHYSICAL_DEVICE_COUNT 8 |
#define SH_MAX_STACK_QUEUE_COUNT 64 |
#define SH_MAX_STACK_QUEUE_FAMILY_COUNT 32 |
#define SH_MAX_STACK_SURFACE_PRESENT_MODE_COUNT 16 |
#define SH_MAX_STACK_VALIDATION_LAYER_COUNT 32 |
#define SH_PIPELINE_POOL_MAX_PIPELINE_COUNT 64 |
#define SH_TRUE 1 |
#define SH_VEC1_SIGNED_DOUBLE VK_FORMAT_R64_SFLOAT |
#define SH_VEC1_SIGNED_FLOAT VK_FORMAT_R32_SFLOAT |
#define SH_VEC1_SIGNED_INT VK_FORMAT_R32_SINT |
#define SH_VEC1_UNSIGNED_INT VK_FORMAT_R32_UINT |
#define SH_VEC1_UNSIGNED_LONG VK_FORMAT_R64_UINT |
#define SH_VEC2_SIGNED_DOUBLE VK_FORMAT_R64G64_SFLOAT |
#define SH_VEC2_SIGNED_FLOAT VK_FORMAT_R32G32_SFLOAT |
#define SH_VEC2_SIGNED_INT VK_FORMAT_R32G32_SINT |
#define SH_VEC2_UNSIGNED_INT VK_FORMAT_R32G32_UINT |
#define SH_VEC2_UNSIGNED_LONG VK_FORMAT_R64G64_UINT |
#define SH_VEC3_SIGNED_DOUBLE VK_FORMAT_R64G64B64_SFLOAT |
#define SH_VEC3_SIGNED_FLOAT VK_FORMAT_R32G32B32_SFLOAT |
#define SH_VEC3_SIGNED_INT VK_FORMAT_R32G32B32_SINT |
#define SH_VEC3_UNSIGNED_INT VK_FORMAT_R32G32B32_UINT |
#define SH_VEC3_UNSIGNED_LONG VK_FORMAT_R64G64B64_UINT |
#define SH_VEC4_SIGNED_DOUBLE VK_FORMAT_R64G64B64A64_SFLOAT |
#define SH_VEC4_SIGNED_FLOAT VK_FORMAT_R32G32B32A32_SFLOAT |
#define SH_VEC4_SIGNED_INT VK_FORMAT_R32G32B32A32_SINT |
#define SH_VEC4_UNSIGNED_INT VK_FORMAT_R32G32B32A32_UINT |
#define SH_VEC4_UNSIGNED_LONG VK_FORMAT_R64G64B64A64_UINT |
#define shAllocatePipelinePool | ( | ) |
Allocates a new ShVkPipelinePool structure.
This macro allocates heap memory for a new ShVkPipelinePool structure and initializes it to zero.
#define shFreePipelinePool free |
Frees the memory of an ShVkPipelinePool structure.
This macro frees the memory allocated on the heap for an ShVkPipelinePool structure.
ptr | Pointer to the ShVkPipelinePool structure to be freed. |
#define shVkError | ( | condition, | |
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).
condition | The condition to check (non-zero for an error). |
error_msg | A message to be printed if the condition is true. |
failure_expression | The expression to execute when the condition is true (e.g., return or exit). |
#define shVkResultError | ( | result, | |
error_msg, | |||
failure_expression ) |
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).
result | The VkResult from a Vulkan function (VK_SUCCESS or an error code). |
error_msg | A message to be printed if the result is not VK_SUCCESS. |
failure_expression | The expression to execute when the result is an error (e.g., return or exit). |
shTranslateVkResult()
to convert the VkResult enum into a string representation. #define VK_MAKE_API_VERSION | ( | variant, | |
major, | |||
minor, | |||
patch ) |
typedef enum ShImageChannelTypeFlags ShImageChannelTypeFlags |
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.
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.
|
extern |
Acquires an image from the Vulkan swapchain.
This function acquires an image from the specified swapchain and optionally signals a semaphore or fence.
device | Valid Vulkan device. |
swapchain | Valid Vulkan swapchain from which to acquire an image. |
timeout_ns | Timeout in nanoseconds to wait for the image. |
acquired_signal_semaphore | Valid Vulkan semaphore to signal upon acquisition. |
acquired_signal_fence | Valid Vulkan fence to signal upon acquisition. |
p_swapchain_image_index | Valid destination pointer to the index of the acquired swapchain image. |
p_swapchain_suboptimal | Valid destination pointer to a flag indicating if the swapchain is suboptimal. |
|
extern |
Allocates memory for a Vulkan buffer.
This function allocates memory for a specified Vulkan buffer with the desired memory properties.
device | Valid Vulkan device. |
physical_device | Valid Vulkan physical device. |
buffer | Valid Vulkan buffer for which memory is to be allocated. |
property_flags | Vulkan memory property flags for the allocated memory. |
p_memory | Valid destination pointer to the newly allocated Vulkan device memory. |
|
extern |
Allocates command buffers from a command pool.
This function allocates a specified number of command buffers from a command pool.
device | Valid Vulkan device. |
cmd_pool | Valid pointer to the command pool from which to allocate. |
cmd_buffer_count | Number of command buffers to allocate. |
p_cmd_buffer | Valid destination pointer to an array of newly created VkCommandBuffer handles. |
|
extern |
Allocates descriptor sets from a descriptor pool.
This function allocates descriptor sets of the specified type from the given descriptor pool.
device | Valid Vulkan device. |
descriptor_pool | Valid Vulkan descriptor pool from which to allocate descriptor sets. |
descriptor_type | Vulkan descriptor type (e.g., uniform buffer, sampled image). |
binding | Binding index for the descriptor sets. |
descriptor_set_unit_count | Number of descriptor sets to allocate. |
p_descriptor_set_layouts | Valid pointer to an array of Vulkan descriptor set layouts. |
p_descriptor_sets | Valid destination pointer to an array of Vulkan descriptor sets. |
p_buffer_infos | Valid pointer to an array of Vulkan descriptor buffer info structures. |
p_write_descriptor_sets | Valid pointer to an array of Vulkan write descriptor set structures. |
|
extern |
Allocates memory for a Vulkan image.
This function allocates memory for a specified Vulkan image with the desired memory properties.
device | Valid Vulkan device. |
physical_device | Valid Vulkan physical device. |
image | Valid Vulkan image for which memory is to be allocated. |
memory_property_flags | Vulkan memory property flags for the allocated memory. |
p_image_memory | Valid destination pointer to the newly allocated Vulkan device memory. |
|
extern |
Begins recording commands into a Vulkan command buffer.
This function begins recording commands into the specified command buffer.
cmd_buffer | Valid Vulkan command buffer to begin recording. |
|
extern |
Begins a Vulkan render pass.
This function begins recording commands for a render pass in the specified command buffer.
graphics_cmd_buffer | Valid Vulkan command buffer to begin the render pass. |
renderpass | Valid Vulkan render pass to begin. |
render_offset_x | X offset for the render area. |
render_offset_y | Y offset for the render area. |
render_size_x | Width of the render area. |
render_size_y | Height of the render area. |
clear_value_count | Number of clear values. |
p_clear_values | Valid pointer to an array of Vulkan clear values. |
framebuffer | Valid Vulkan framebuffer to use for the render pass. |
|
extern |
Binds a Vulkan buffer to a specified memory offset.
This function binds a Vulkan buffer to a specific memory offset.
device | Valid Vulkan device. |
buffer | Valid Vulkan buffer to bind. |
offset | Offset in the memory where the buffer will be bound. |
buffer_memory | Valid Vulkan device memory to bind to the buffer. |
|
extern |
Binds a Vulkan image to a specified memory offset.
This function binds a Vulkan image to a specific memory offset.
device | Valid Vulkan device. |
image | Valid Vulkan image to bind. |
offset | Offset in the memory where the image will be bound. |
image_memory | Valid Vulkan device memory to bind to the image. |
|
extern |
Binds an index buffer to a Vulkan command buffer.
This function binds an index buffer to a Vulkan command buffer.
graphics_cmd_buffer | Valid Vulkan command buffer to bind the index buffer to. |
index_offset | Offset in the index buffer. |
index_buffer | Valid Vulkan index buffer to bind. |
|
extern |
Binds a pipeline to a command buffer.
This function binds a pipeline (graphics or compute) to the command buffer for subsequent commands.
cmd_buffer | Valid Vulkan command buffer. |
bind_point | Pipeline bind point (e.g., VK_PIPELINE_BIND_POINT_GRAPHICS). |
p_pipeline | Valid destination pointer to the ShVkPipeline structure to be bound. |
|
extern |
Binds vertex buffers to a Vulkan command buffer.
This function binds one or more vertex buffers to a Vulkan command buffer.
graphics_cmd_buffer | Valid Vulkan command buffer to bind vertex buffers to. |
first_binding | Binding index to start from. |
binding_count | Number of vertex buffers to bind. |
p_vertex_buffers | Valid pointer to an array of Vulkan vertex buffers. |
p_vertex_offsets | Valid pointer to an array of offsets for each vertex buffer. |
|
extern |
|
extern |
Clears memory associated with a Vulkan buffer.
This function clears the memory bound to a Vulkan buffer.
device | Valid Vulkan device. |
buffer | Valid Vulkan buffer. |
memory | Valid Vulkan device memory bound to the buffer. |
|
extern |
Clears memory associated with a Vulkan image.
This function clears the memory bound to a Vulkan image.
device | Valid Vulkan device. |
image | Valid Vulkan image. |
image_memory | Valid Vulkan device memory bound to the image. |
|
extern |
Clears the pipeline structure.
This function resets all fields of the ShVkPipeline structure to their default values.
p_pipeline | Valid destination pointer to the ShVkPipeline structure to be cleared. |
|
extern |
Dispatches compute work from a Vulkan command buffer.
This function dispatches a compute workload with specified group counts.
cmd_buffer | Valid Vulkan command buffer from which to dispatch. |
group_count_x | Number of groups in the x dimension. |
group_count_y | Number of groups in the y dimension. |
group_count_z | Number of groups in the z dimension. |
|
extern |
Configures color blending and alpha blending states.
This function configures the color blending and alpha blending states for a Vulkan pipeline.
enable_color_blending | Boolean flag to enable or disable color blending. |
enable_alpha_blending | Boolean flag to enable or disable alpha blending. |
subpass_color_attachment_count | Number of color attachments in the subpass. |
p_color_blend_attachment_states | Valid pointer to an array of Vulkan color blend attachment states. |
p_color_blend_state | Valid destination pointer to the Vulkan pipeline color blend state create info. |
|
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.
physical_device_properties | Properties of the physical device. |
sample_count | Sample count to combine. |
combine_color_sample | Flag indicating whether to combine color samples. |
combine_depth_sample | Flag indicating whether to combine depth samples. |
p_sample_count | Destination pointer to the resulting maximum supported sample count for the current hardware. |
|
extern |
Copies data from one Vulkan buffer to another.
This function copies data from a source buffer to a destination buffer.
transfer_cmd_buffer | Valid Vulkan command buffer for the copy operation. |
src_buffer | Valid Vulkan source buffer. |
src_offset | Offset in the source buffer to start copying from. |
dst_offset | Offset in the destination buffer to start copying to. |
size | Number of bytes to copy. |
dst_buffer | Valid Vulkan destination buffer. |
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.
transfer_cmd_buffer | Valid Vulkan command buffer for the copy operation. |
src_buffer | Valid Vulkan source buffer. |
region_count | Number of regions to copy. |
p_src_offsets | Valid pointer to an array of offsets in the source buffer. |
p_dst_offsets | Valid pointer to an array of offsets in the destination buffer. |
p_sizes | Valid pointer to an array of sizes for each region to copy. |
dst_buffer | Valid Vulkan destination buffer. |
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 ) |
|
extern |
Creates a Vulkan buffer.
This function creates a Vulkan buffer with the specified size and usage.
device | Valid Vulkan device. |
size | Size of the buffer in bytes. |
usage | Vulkan buffer usage flags indicating how the buffer will be used. |
sharing_mode | Vulkan sharing mode specifying how the buffer is shared between queues. |
p_buffer | Valid destination pointer to the newly created Vulkan buffer. |
|
extern |
Creates a Vulkan command pool.
This function creates a command pool for a specified queue family.
device | Valid Vulkan device. |
queue_family_index | Queue family index for the command pool. |
p_cmd_pool | Valid destination pointer to the newly created VkCommandPool. |
|
extern |
Creates a descriptor pool.
This function creates a descriptor pool with the specified pool sizes.
device | Valid Vulkan device. |
pool_size_count | Number of pool sizes. |
p_pool_sizes | Valid pointer to an array of Vulkan descriptor pool sizes. |
p_descriptor_pool | Valid destination pointer to the newly created Vulkan descriptor pool. |
|
extern |
Creates a descriptor set layout.
This function creates a descriptor set layout with the specified bindings.
device | Valid Vulkan device. |
binding_count | Number of descriptor set layout bindings. |
p_bindings | Valid pointer to an array of Vulkan descriptor set layout bindings. |
p_descriptor_set_layout | Valid destination pointer to the newly created Vulkan descriptor set layout. |
|
extern |
Creates a descriptor set layout binding.
This function creates a descriptor set layout binding with the specified parameters.
binding | Binding index for the descriptor set layout. |
descriptor_type | Vulkan descriptor type (e.g., uniform buffer, sampled image). |
descriptor_set_count | Number of descriptors in the set. |
shader_stage | Vulkan shader stage flags that use this descriptor. |
p_binding | Valid destination pointer to the Vulkan descriptor set layout binding. |
|
extern |
Creates Vulkan fences.
This function creates a specified number of Vulkan fences.
device | Valid Vulkan device. |
fence_count | Number of fences to create. |
signaled | Whether to initialize fences as signaled. |
p_fences | Valid destination pointer to an array of newly created Vulkan fences. |
|
extern |
Creates a Vulkan framebuffer.
This function creates a framebuffer with specified image views and dimensions for use with a render pass.
device | Valid Vulkan device. |
renderpass | Valid Vulkan render pass. |
image_view_count | Number of image views in the framebuffer. |
p_image_views | Valid pointer to an array of VkImageView handles. |
x | Width of the framebuffer. |
y | Height of the framebuffer. |
z | Depth of the framebuffer. |
p_framebuffer | Valid destination pointer to the newly created VkFramebuffer. |
|
extern |
Creates a Vulkan image.
This function creates a Vulkan image with the specified parameters.
device | Valid Vulkan device. |
type | Vulkan image type. |
x | Width of the image. |
y | Height of the image. |
z | Depth of the image. |
format | Vulkan image format. |
mip_levels | Number of mipmap levels. |
sample_count | Vulkan sample count flag bits. |
image_tiling | Vulkan image tiling mode. |
usage | Vulkan image usage flags. |
sharing_mode | Vulkan sharing mode. |
p_image | Valid destination pointer to the newly created Vulkan image. |
|
extern |
Creates a Vulkan image view.
This function creates a Vulkan image view for a specified image, view type, format, and aspect.
device | Valid Vulkan device. |
image | Valid Vulkan image. |
view_type | Type of the image view. |
image_aspect | Aspect flags of the image (e.g., color, depth). |
mip_levels | Number of mipmap levels. |
format | Format of the image. |
p_image_view | Valid destination pointer to the newly created VkImageView. |
|
extern |
Creates the input assembly state for a pipeline.
This function creates the input assembly state with the specified topology and restart enable flag.
primitive_topology | Vulkan primitive topology type. |
primitive_restart_enable | Boolean flag to enable or disable primitive restart. |
p_input_assembly | Valid destination pointer to the Vulkan pipeline input assembly state create info. |
|
extern |
Creates a Vulkan instance.
This function initializes a Vulkan instance with the specified application name, engine name, validation layers, and extensions.
application_name | The name of the application. |
engine_name | The name of the engine. |
enable_validation_layers | Flag to enable (1) or disable (0) validation layers. |
extension_count | Number of Vulkan extensions to enable. |
pp_extension_names | Valid array of extension names to enable, if required. |
api_version | The Vulkan API version to use. |
p_instance | Valid destination pointer to the newly created VkInstance. |
|
extern |
Creates a pipeline layout.
This function creates a Vulkan pipeline layout with the specified push constant ranges and descriptor set layouts.
device | Valid Vulkan device. |
push_constant_range_count | Number of push constant ranges. |
p_push_constants_range | Valid pointer to an array of Vulkan push constant ranges. |
src_descriptor_set_layout_count | Number of descriptor set layouts. |
p_src_descriptor_set_layouts | Valid pointer to an array of Vulkan descriptor set layouts. |
p_pipeline_layout | Valid destination pointer to the newly created Vulkan pipeline layout. |
|
extern |
Creates the rasterization state for a pipeline.
This function creates the rasterization state with the specified polygon mode and cull mode.
polygon_mode | Vulkan polygon mode for rasterization. |
cull_mode | Vulkan cull mode flag bits. |
p_rasterizer | Valid destination pointer to the Vulkan pipeline rasterization state create info. |
|
extern |
Creates a Vulkan render pass.
This function creates a render pass with specified attachments and subpasses.
device | Valid pointer to Vulkan device. |
attachment_count | Number of attachments in the render pass. |
p_attachments_descriptions | Valid pointer to an array of VkAttachmentDescription structures. |
subpass_count | Number of subpasses in the render pass. |
p_subpasses | Valid pointer to an array of VkSubpassDescription structures. |
p_renderpass | Valid destination pointer to the newly created VkRenderPass. |
|
extern |
Creates a Vulkan render pass attachment description.
This function creates an attachment description to use in a render pass.
format | Format of the attachment. |
sample_count | Sample count for the attachment. |
load_treatment | Load operation for the attachment. |
store_treatment | Store operation for the attachment. |
stencil_load_treatment | Load operation for stencil attachment. |
stencil_store_treatment | Store operation for stencil attachment. |
initial_layout | Initial layout of the attachment. |
final_layout | Final layout of the attachment. |
p_attachment_description | Valid destination pointer to the newly created VkAttachmentDescription. |
|
extern |
Creates a Vulkan render pass attachment reference.
This function creates an attachment reference for use in a subpass of a render pass.
attachment_idx | Index of the attachment in the render pass. |
layout | Layout of the attachment within the subpass. |
p_attachment_reference | Valid destination pointer to the newly created VkAttachmentReference. |
|
extern |
Creates Vulkan semaphores.
This function creates a specified number of Vulkan semaphores.
device | Valid Vulkan device. |
semaphore_count | Number of semaphores to create. |
p_semaphores | Valid destination pointer to an array of newly created Vulkan semaphores. |
|
extern |
Creates a Vulkan shader module.
This function creates a shader module from the provided shader code.
device | Valid Vulkan device. |
size | Size of the shader code in bytes. |
code | Pointer to the shader code. |
p_shader_module | Valid destination pointer to the newly created Vulkan shader module. |
|
extern |
Creates a Vulkan shader stage.
This function creates a shader stage using the provided shader module and stage flag.
shader_module | Valid Vulkan shader module. |
shader_stage_flag | Vulkan shader stage flag (e.g., vertex, fragment). |
p_shader_stage | Valid destination pointer to the Vulkan pipeline shader stage create info. |
|
extern |
Creates a Vulkan subpass description.
This function creates a subpass description including input, color, depth/stencil, and resolve attachments.
bind_point | Pipeline bind point for the subpass. |
input_attachment_count | Number of input attachments. |
p_input_attachments_reference | Valid pointer to an array of input attachment references. |
color_attachment_count | Number of color attachments. |
p_color_attachments_reference | Valid pointer to an array of color attachment references. |
p_depth_stencil_attachment_reference | Valid pointer to the depth/stencil attachment reference. |
p_resolve_attachment_reference | Valid pointer to the resolve attachment reference. |
preserve_attachment_count | Number of attachments to preserve. |
p_preserve_attachments | Valid pointer to an array of indices of attachments to preserve. |
p_subpass | Valid destination pointer to the newly created VkSubpassDescription. |
|
extern |
Creates a Vulkan swapchain.
This function sets up a Vulkan swapchain with the specified surface, image format, and other parameters.
device | Valid Vulkan device. |
physical_device | Valid Vulkan physical device. |
surface | Valid Vulkan surface. |
image_format | Format of the images in the swapchain. |
p_image_format | Valid destination pointer to the format of the swapchain images. |
swapchain_image_count | Number of images in the swapchain. |
image_sharing_mode | Sharing mode for the swapchain images. |
vsync | Flag to enable (1) or disable (0) V-Sync. |
p_swapchain_image_count | Valid destination pointer to the number of swapchain images. |
p_swapchain | Valid destination pointer to the newly created VkSwapchainKHR. |
|
extern |
Creates image views for swapchain images.
This function creates Vulkan image views for all images in a swapchain.
device | Valid Vulkan device. |
format | Format of the image views. |
swapchain_image_count | Number of swapchain images. |
p_swapchain_images | Pointer to an array of VkImage handles. |
p_swapchain_image_views | Valid destination pointer to an array of VkImageView handles. |
|
extern |
Destroys Vulkan command buffers.
This function destroys an array of Vulkan command buffers from a command pool.
device | Valid Vulkan device. |
cmd_pool | Valid Vulkan command pool. |
cmd_buffer_count | Number of command buffers to destroy. |
p_cmd_buffers | Valid pointer to an array of VkCommandBuffer handles. |
|
extern |
Destroys a Vulkan command pool.
This function destroys a Vulkan command pool.
device | Valid Vulkan device. |
cmd_pool | Valid Vulkan command pool to destroy. |
|
extern |
Destroys a Vulkan descriptor pool.
This function destroys the specified Vulkan descriptor pool.
device | Valid Vulkan device. |
descriptor_pool | Vulkan descriptor pool to destroy. |
|
extern |
Destroys a Vulkan descriptor set layout.
This function destroys the specified Vulkan descriptor set layout.
device | Valid Vulkan device. |
descriptor_set_layout | Vulkan descriptor set layout to destroy. |
|
extern |
Destroys a Vulkan device.
This function destroys a Vulkan device.
device | Valid Vulkan device to destroy. |
|
extern |
Destroys Vulkan fences.
This function destroys a specified number of Vulkan fences.
device | Valid Vulkan device. |
fence_count | Number of fences to destroy. |
p_fences | Valid pointer to an array of Vulkan fences to destroy. |
|
extern |
Destroys Vulkan framebuffers.
This function destroys an array of Vulkan framebuffers.
device | Valid Vulkan device. |
framebuffer_count | Number of framebuffers to destroy. |
p_framebuffers | Valid pointer to an array of VkFramebuffer handles. |
|
extern |
Destroys Vulkan image views.
This function destroys an array of Vulkan image views.
device | Valid Vulkan device. |
image_view_count | Number of image views to destroy. |
p_image_views | Valid pointer to an array of VkImageView handles. |
|
extern |
Destroys a Vulkan instance.
This function destroys a Vulkan instance.
instance | Valid Vulkan instance to destroy. |
|
extern |
Destroys a Vulkan pipeline.
This function destroys the specified Vulkan pipeline.
device | Valid Vulkan device. |
pipeline | Vulkan pipeline to destroy. |
|
extern |
Destroys a Vulkan pipeline layout.
This function destroys the specified Vulkan pipeline layout.
device | Valid Vulkan device. |
pipeline_layout | Vulkan pipeline layout to destroy. |
|
extern |
Destroys a Vulkan render pass.
This function destroys a Vulkan render pass.
device | Valid Vulkan device. |
render_pass | Valid Vulkan render pass to destroy. |
|
extern |
Destroys Vulkan semaphores.
This function destroys a specified number of Vulkan semaphores.
device | Valid Vulkan device. |
semaphore_count | Number of semaphores to destroy. |
p_semaphores | Valid pointer to an array of Vulkan semaphores to destroy. |
|
extern |
Destroys a Vulkan shader module.
This function destroys the specified Vulkan shader module.
device | Valid Vulkan device. |
shader_module | Vulkan shader module to destroy. |
|
extern |
Destroys a Vulkan surface.
This function destroys a Vulkan surface associated with an instance.
instance | Valid Vulkan instance. |
surface | Valid VkSurfaceKHR to destroy. |
|
extern |
Destroys a Vulkan swapchain.
This function destroys the specified Vulkan swapchain.
device | Valid Vulkan device. |
swapchain | Valid VkSwapchainKHR to destroy. |
|
extern |
Records a draw command into a Vulkan command buffer.
This function records a draw command into the specified command buffer.
graphics_cmd_buffer | Valid Vulkan command buffer to record the draw command. |
vertex_count | Number of vertices to draw. |
first_vertex | Index of the first vertex to draw. |
instance_count | Number of instances to draw. |
first_instance | Index of the first instance to draw. |
|
extern |
Records an indexed draw command into a Vulkan command buffer.
This function records an indexed draw command into the specified command buffer.
graphics_cmd_buffer | Valid Vulkan command buffer to record the draw command. |
index_count | Number of indices to draw. |
instance_count | Number of instances to draw. |
first_index | Index of the first index to draw. |
vertex_offset | Offset added to each index to obtain the vertex index. |
first_instance | Index of the first instance to draw. |
|
extern |
Ends recording commands into a Vulkan command buffer.
This function ends the recording of commands into the specified command buffer.
cmd_buffer | Valid Vulkan command buffer to end recording. |
|
extern |
Ends a Vulkan render pass.
This function ends the recording of commands for a render pass in the specified command buffer.
graphics_cmd_buffer | Valid Vulkan command buffer to end the render pass. |
|
extern |
|
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.
validation_layer_name | The name of the validation layer to find. |
|
extern |
Retrieves the Vulkan queues from a device.
This function retrieves the Vulkan queues from a logical device based on specified queue family indices.
device | Valid Vulkan device. |
queue_count | Number of queues to retrieve. |
p_queue_family_indices | Valid pointer to an array of queue family indices. |
p_queues | Valid destination pointer to an array of VkQueue handles. |
|
extern |
|
extern |
Retrieves memory budget properties for a Vulkan physical device.
This function retrieves memory budget properties for a Vulkan physical device.
physical_device | Valid Vulkan physical device. |
p_memory_budget_properties | Valid destination pointer to Vulkan memory budget properties. |
|
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.
device | Valid Vulkan device. |
physical_device | Valid Vulkan physical device. |
property_flags | Vulkan memory property flags to match. |
p_memory_type_index | Valid destination pointer to the index of the memory type. |
|
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).
physical_device | The current physical device to query for queue families. |
surface | The Vulkan surface (for surface support queries). |
p_queue_family_count | Valid destination pointer to the total number of queue families available. |
p_graphics_queue_family_count | Valid destination pointer to Number of graphics-capable queue families. |
p_surface_queue_family_count | Valid destination pointer to Number of surface-capable queue families. |
p_compute_queue_family_count | Valid destination pointer to Number of compute-capable queue families. |
p_transfer_queue_family_count | Valid destination pointer to Number of transfer-capable queue families. |
p_graphics_queue_family_indices | Valid destination pointer to the indices of the graphics-capable queue families. |
p_surface_queue_family_indices | Valid destination pointer to the indices of the surface-capable queue families. |
p_compute_queue_family_indices | Valid destination pointer to the indices of the compute-capable queue families. |
p_transfer_queue_family_indices | Valid destination pointer to the indices of the transfer-capable queue families. |
p_queue_families_properties | Valid destination pointer to a VkQueueFamilyProperties structure. |
|
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.
physical_device | Valid physical device. |
surface | Valid Vulkan surface to query capabilities for. |
p_surface_capabilities | Valid destination pointer to a structure where the surface capabilities will be stored. |
|
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.
physical_device | Valid physical device. |
queue_family_index | Index of the queue family to check. |
surface | Valid surface to check for support. |
p_supported | Valid destination pointer to Flag indicating support (1 if supported, 0 otherwise). |
|
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.
physical_device | Valid physical device to query. |
queue_family_index | Index of the queue family to check. |
surface | Valid surface to check for support. |
p_support | Valid destination pointer to Flag indicating support (1 if supported, 0 otherwise). |
|
extern |
Retrieves the images in a swapchain.
This function retrieves the Vulkan images present in a swapchain.
device | Valid Vulkan device. |
swapchain | Valid Vulkan swapchain. |
p_swapchain_image_count | Valid destination pointer to the number of swapchain images. |
p_swapchain_images | Valid destination pointer to an array of VkImage handles. |
|
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.
cmd_buffer | Valid Vulkan command buffer. |
first_descriptor_set | Index of the first descriptor set. |
first_descriptor_set_unit_idx | Index of the first descriptor set unit. |
descriptor_set_unit_count | Number of descriptor set units to bind. |
bind_point | Pipeline bind point (e.g., VK_PIPELINE_BIND_POINT_GRAPHICS). |
dynamic_descriptors_count | Number of dynamic descriptors. |
p_dynamic_offsets | Array of dynamic offsets for the descriptors. |
p_pipeline_pool | Valid pointer to the ShVkPipelinePool structure. |
p_pipeline | Valid destination pointer to the ShVkPipeline structure. |
|
extern |
Configures color blending settings in the pipeline.
This function sets color blending and alpha blending settings in the ShVkPipeline structure.
enable_color_blending | Flag indicating if color blending is enabled. |
enable_alpha_blending | Flag indicating if alpha blending is enabled. |
subpass_color_attachment_count | Number of color attachments for the subpass. |
p_pipeline | Valid destination pointer to the ShVkPipeline structure to update. |
|
extern |
Creates input assembly state information for the pipeline.
This function sets the input assembly state information in the ShVkPipeline structure.
primitive_topology | Primitive topology used in the input assembly. |
primitive_restart_enable | Flag indicating if primitive restart is enabled. |
p_pipeline | Valid destination pointer to the ShVkPipeline structure to update. |
|
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.
device | Valid Vulkan device. |
first_descriptor_set_layout | Index of the first descriptor set layout. |
descriptor_set_layout_count | Number of descriptor set layouts. |
p_pipeline_pool | Valid pointer to the ShVkPipelinePool structure. |
p_pipeline | Valid destination pointer to the ShVkPipeline structure to update. |
|
extern |
Creates rasterizer state information for the pipeline.
This function sets the rasterizer state information in the ShVkPipeline structure.
polygon_mode | Polygon mode used in rasterization. |
cull_mode | Culling mode used in rasterization. |
p_pipeline | Valid destination pointer to the ShVkPipeline structure to update. |
|
extern |
Creates a shader module and adds it to the pipeline.
This function creates a Vulkan shader module and updates the ShVkPipeline structure.
device | Valid Vulkan device. |
size | Size of the shader code. |
code | Pointer to the shader code. |
p_pipeline | Valid destination pointer to the ShVkPipeline structure to update. |
|
extern |
Creates a shader stage and adds it to the pipeline.
This function creates a Vulkan shader stage and updates the ShVkPipeline structure.
shader_stage | Vulkan shader stage flags (e.g., vertex, fragment). |
p_pipeline | Valid destination pointer to the ShVkPipeline structure to update. |
|
extern |
Destroys the pipeline layout associated with the pipeline.
This function destroys the pipeline layout used by the ShVkPipeline structure.
device | Valid Vulkan device. |
p_pipeline | Valid destination pointer to the ShVkPipeline structure. |
|
extern |
Destroys shader modules associated with the pipeline.
This function destroys a range of shader modules that are part of the ShVkPipeline structure.
device | Valid Vulkan device. |
first_module | Index of the first shader module to destroy. |
module_count | Number of shader modules to destroy. |
p_pipeline | Valid destination pointer to the ShVkPipeline structure. |
|
extern |
Allocates descriptor set units in the pipeline pool.
This function allocates descriptor set units for the pipeline pool.
device | Valid Vulkan device. | |
binding | Binding index in the descriptor set layout. | |
pool_idx | Index of the descriptor pool. | |
descriptor_type | Type of the descriptor (e.g., VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER). | |
first_descriptor_set_unit | Index of the first descriptor set unit to allocate. | |
descriptor_set_unit_count | Number of descriptor set units to allocate. | |
[in,out] | p_pipeline_pool | Valid pointer to the ShVkPipelinePool structure. |
|
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.
src_set_layout_idx | Index of the source descriptor set layout. | |
first_dst_set_layout_idx | Index of the first destination descriptor set layout. | |
dst_set_layout_count | Number of destination descriptor set layouts. | |
[in,out] | p_pipeline_pool | Valid pointer to the ShVkPipelinePool structure. |
|
extern |
Creates a descriptor pool in the pipeline pool.
This function initializes a descriptor pool in the pipeline pool.
device | Valid Vulkan device. | |
pool_idx | Index of the pool to initialize. | |
descriptor_type | Type of the descriptor (e.g., VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER). | |
descriptor_count | Number of descriptors in the pool. | |
[in,out] | p_pipeline_pool | Valid pointer to the ShVkPipelinePool structure. |
|
extern |
Creates descriptor set layouts in the pipeline pool.
This function initializes descriptor set layouts in the pipeline pool.
device | Valid Vulkan device. | |
first_binding_idx | Index of the first binding in the layout. | |
binding_count | Number of bindings. | |
set_layout_idx | Index of the set layout to initialize. | |
[in,out] | p_pipeline_pool | Valid pointer to the ShVkPipelinePool structure. |
|
extern |
Creates a descriptor set layout binding for the pipeline pool.
This function initializes a descriptor set layout binding in the pipeline pool.
binding | Binding index in the descriptor set layout. | |
descriptor_type | Type of the descriptor (e.g., VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER). | |
descriptor_set_count | Number of descriptor sets. | |
shader_stage | Shader stages that use this descriptor. | |
[in,out] | p_pipeline_pool | Valid pointer to the ShVkPipelinePool structure. |
|
extern |
Destroys descriptor pools in the pipeline pool.
This function destroys a range of descriptor pools in the pipeline pool.
device | Valid Vulkan device. | |
first_pool | Index of the first descriptor pool to destroy. | |
pool_count | Number of descriptor pools to destroy. | |
[in,out] | p_pipeline_pool | Valid pointer to the ShVkPipelinePool structure. |
|
extern |
Destroys descriptor set layouts in the pipeline pool.
This function destroys a range of descriptor set layouts in the pipeline pool.
device | Valid Vulkan device. | |
first_set_layout | Index of the first descriptor set layout to destroy. | |
set_layout_count | Number of descriptor set layouts to destroy. | |
[in,out] | p_pipeline_pool | Valid pointer to the ShVkPipelinePool structure. |
|
extern |
Sets descriptor buffer infos in the pipeline pool.
This function sets the buffer information for descriptors in the pipeline pool.
first_descriptor | Index of the first descriptor to set. | |
descriptor_count | Number of descriptors to update. | |
buffer | Vulkan buffer to associate with the descriptors. | |
buffer_offset | Offset into the buffer. | |
buffer_size | Size of the buffer. | |
[in,out] | p_pipeline_pool | Valid pointer to the ShVkPipelinePool structure. |
|
extern |
Updates descriptor set units in the pipeline pool.
This function updates the descriptor set units within the pipeline pool.
device | Valid Vulkan device. | |
first_descriptor_set_unit | Index of the first descriptor set unit to update. | |
descriptor_set_unit_count | Number of descriptor set units to update. | |
[in,out] | p_pipeline_pool | Valid pointer to the ShVkPipelinePool structure. |
|
extern |
Pushes constants to a pipeline using the command buffer.
This function updates the push constants for a pipeline within a command buffer.
cmd_buffer | Valid Vulkan command buffer. |
p_data | Pointer to the data to be pushed to the constants. |
p_pipeline | Valid destination pointer to the ShVkPipeline structure containing push constants information. |
|
extern |
Sets multisample state information in the pipeline.
This function sets the multisample state information in the ShVkPipeline structure.
sample_count | Number of samples used in multisampling. |
min_sample_shading_size | Minimum sample shading size. |
p_pipeline | Valid destination pointer to the ShVkPipeline structure to update. |
|
extern |
Sets push constants in the pipeline.
This function sets the push constant range for a specific shader stage in the ShVkPipeline structure.
shader_stage | Vulkan shader stage flags (e.g., vertex, fragment). |
offset | Offset of the push constants. |
size | Size of the push constants. |
p_pipeline | Valid destination pointer to the ShVkPipeline structure to update. |
|
extern |
Sets vertex attribute information in the pipeline.
This function sets the vertex attribute description for a specific location in the ShVkPipeline structure.
location | Location index. |
binding | Binding index. |
format | Vertex attribute format. |
offset | Offset of the vertex attribute. |
p_pipeline | Valid destination pointer to the ShVkPipeline structure to update. |
|
extern |
Sets vertex binding information in the pipeline.
This function sets the vertex binding description for a specific binding index in the ShVkPipeline structure.
binding | Binding index. |
size | Size of the vertex binding. |
input_rate | Vertex input rate. |
p_pipeline | Valid destination pointer to the ShVkPipeline structure to update. |
|
extern |
Sets vertex input state information in the pipeline.
This function sets the vertex input state information in the ShVkPipeline structure.
p_pipeline | Valid destination pointer to the ShVkPipeline structure to update. |
|
extern |
Sets viewport and scissor information in the pipeline.
This function sets the viewport and scissor information in the ShVkPipeline structure.
viewport_pos_x | X position of the viewport. |
viewport_pos_y | Y position of the viewport. |
viewport_width | Width of the viewport. |
viewport_height | Height of the viewport. |
scissors_pos_x | X position of the scissors rectangle. |
scissors_pos_y | Y position of the scissors rectangle. |
scissors_width | Width of the scissors rectangle. |
scissors_height | Height of the scissors rectangle. |
p_pipeline | Valid destination pointer to the ShVkPipeline structure to update. |
|
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.
queue_family_index | Index of the queue family. |
queue_count | Number of queues to create in the specified family. |
p_queue_priorities | Valid pointer to an array of queue priorities. |
protected | Flag indicating whether the queue should be protected (1 for protected, 0 for unprotected). |
p_device_queue_info | Valid destination pointer to a VkDeviceQueueCreateInfo structure where the queue info will be stored. |
|
extern |
Presents an image from a Vulkan swapchain to the screen.
This function presents an image from the specified swapchain using the provided queue.
present_queue | Valid Vulkan queue to present the image. |
semaphores_to_wait_for_count | Number of semaphores to wait for before presenting. |
p_semaphores_to_wait_for | Valid pointer to an array of Vulkan semaphores to wait for. |
swapchain | Valid Vulkan swapchain containing the image to present. |
swapchain_image_idx | Index of the swapchain image to present. |
|
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.
cmd_buffer_count | Number of command buffers to submit. |
p_cmd_buffers | Valid pointer to an array of Vulkan command buffers. |
queue | Valid Vulkan queue to which to submit. |
fence | Valid Vulkan fence to signal upon completion. |
semaphores_to_wait_for_count | Number of semaphores to wait for. |
p_semaphores_to_wait_for | Valid pointer to an array of Vulkan semaphores to wait for. |
wait_stage | Pipeline stage flags to wait for. |
signal_semaphore_count | Number of semaphores to signal. |
p_signal_semaphores | Valid pointer to an array of Vulkan semaphores to signal. |
|
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.
device | Valid Vulkan device. |
memory | Valid Vulkan device memory to read from. |
offset | Offset in the memory to start reading from. |
data_size | Number of bytes to read. |
p_data | Valid destination pointer to a buffer to store the read data. |
|
extern |
Resets a Vulkan command buffer.
This function resets a command buffer to the initial state.
cmd_buffer | Valid Vulkan command buffer to reset. |
|
extern |
Resets Vulkan fences.
This function resets a specified number of Vulkan fences to their initial state.
device | Valid Vulkan device. |
fence_count | Number of fences to reset. |
p_fences | Valid pointer to an array of Vulkan fences to reset. |
|
extern |
Resets Vulkan semaphores.
This function resets a specified number of Vulkan semaphores to their initial state.
device | Valid Vulkan device. |
semaphore_count | Number of semaphores to reset. |
p_semaphores | Valid pointer to an array of Vulkan semaphores to reset. |
|
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.
instance | Valid Vulkan instance. |
surface | Valid surface if presentation support is required, otherwise it can be set as VK_NULL_HANDLE . |
requirements | Queue family requirements (VkQueueFlags). |
p_physical_device | Valid destination pointer to the selected Vulkan physical device. |
p_physical_device_properties | Valid destination pointer to the properties of the selected physical device. |
p_physical_device_features | Valid destination pointer to the features of the selected physical device. |
p_physical_device_memory_properties | Valid destination pointer to the memory properties of the selected physical device. |
|
extern |
Creates a buffer memory barrier.
This function creates a buffer memory barrier to synchronize buffer memory access (e.g. read, write, transfer).
device | Valid Vulkan device. |
cmd_buffer | Valid Vulkan command buffer. |
buffer | Valid Vulkan buffer (target of the barrier). |
access_before_barrier | Memory access flag before the barrier. |
access_after_barrier | Memory access flag sfter the barrier. |
performing_queue_family_index_before_barrier | Performing queue family index before the barrier. |
performing_queue_family_index_after_barrier | Performing queue family index before the barrier. |
pipeline_stage_before_barrier | Pipeline stage flag before the barrier. |
pipeline_stage_after_barrier | Pipeline stage flag after the barrier. |
|
extern |
Sets buffer information for a descriptor buffer.
This function sets buffer information for a descriptor buffer.
buffer | Valid Vulkan buffer. |
buffer_offset | Offset in the buffer. |
buffer_size | Size of the buffer. |
p_buffer_info | Valid destination pointer to the Vulkan descriptor buffer info. |
|
extern |
Creates an image memory barrier.
This function creates an image memory barrier to synchronize image memory access (e.g. read, write, transfer).
device | Valid Vulkan device. |
cmd_buffer | Valid Vulkan command buffer. |
image | Valid Vulkan image (target of the barrier). |
image_aspect_mask | Target image aspect mask. |
access_before_barrier | Memory access flag before the barrier. |
access_after_barrier | Memory access flag sfter the barrier. |
image_layout_before_barrier | Image layout before the barrier. |
image_layout_after_barrier | Image layout before the barrier. |
performing_queue_family_index_before_barrier | Performing queue family index before the barrier. |
performing_queue_family_index_after_barrier | Performing queue family index before the barrier. |
pipeline_stage_before_barrier | Pipeline stage flag before the barrier. |
pipeline_stage_after_barrier | Pipeline stage flag after the barrier. |
|
extern |
Sets up a Vulkan logical device.
This function creates a Vulkan logical device with specified extensions, queue creation info, and other configurations.
physical_device | Valid Vulkan physical device. |
p_device | Valid destination pointer to the newly created VkDevice. |
extension_count | Number of Vulkan extensions to enable. |
pp_extension_names | Valid pointer to extension names to enable. |
device_queue_count | Number of device queues to create. |
p_device_queue_infos | Valid pointer to an array of VkDeviceQueueCreateInfo structures. |
|
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.
sample_count | Vulkan sample count flag bits. |
min_sample_shading_size | Minimum sample shading size. |
p_multisample_state | Valid destination pointer to the Vulkan pipeline multisample state create info. |
|
extern |
Sets push constants for a shader stage.
This function sets push constants for a specified shader stage.
shader_stage | Vulkan shader stage flags (e.g., vertex, fragment). |
offset | Offset in bytes from the start of the push constant range. |
size | Size of the push constants in bytes. |
p_push_constant_range | Valid destination pointer to the Vulkan push constant range. |
|
extern |
Sets up a compute pipeline.
This function sets up a Vulkan compute pipeline using the ShVkPipeline structure.
device | Valid Vulkan device. |
p_pipeline | Valid destination pointer to the ShVkPipeline structure to setup. |
|
extern |
Sets up a graphics pipeline.
This function sets up a Vulkan graphics pipeline using the ShVkPipeline structure and the specified render pass.
device | Valid Vulkan device. |
render_pass | Valid Vulkan render pass. |
p_pipeline | Valid destination pointer to the ShVkPipeline structure to setup. |
|
extern |
Sets the vertex attribute description.
This function sets the vertex attribute description with the specified parameters.
location | Location of the vertex attribute. |
binding | Binding index of the vertex attribute. |
format | Vulkan format of the vertex attribute. |
offset | Offset in the vertex buffer where the attribute starts. |
p_vertex_input_attribute | Valid destination pointer to the Vulkan vertex input attribute description. |
|
extern |
Sets the vertex input binding description.
This function sets the vertex input binding description with the specified parameters.
binding | Binding index for the vertex input binding. |
size | Size of the vertex buffer in bytes. |
input_rate | Vertex input rate (e.g., per vertex or per instance). |
p_vertex_input_binding | Valid destination pointer to the Vulkan vertex input binding description. |
|
extern |
Sets the vertex input state for a pipeline.
This function sets the vertex input state, including bindings and attributes, for a Vulkan pipeline.
vertex_binding_count | Number of vertex input bindings. |
p_vertex_bindings | Valid pointer to an array of Vulkan vertex input binding descriptions. |
vertex_attribute_count | Number of vertex input attributes. |
p_vertex_attributes | Valid pointer to an array of Vulkan vertex input attribute descriptions. |
p_vertex_input_state | Valid destination pointer to the Vulkan pipeline vertex input state create info. |
|
extern |
Sets the viewport and scissor state for a pipeline.
This function sets the viewport and scissor parameters for a Vulkan pipeline.
viewport_pos_x | X position of the viewport. |
viewport_pos_y | Y position of the viewport. |
viewport_width | Width of the viewport. |
viewport_height | Height of the viewport. |
p_viewport | Valid destination pointer to the Vulkan viewport. |
scissors_pos_x | X position of the scissor. |
scissors_pos_y | Y position of the scissor. |
scissors_width | Width of the scissor. |
scissors_height | Height of the scissor. |
p_scissors | Valid destination pointer to the Vulkan scissor rectangle. |
p_viewport_state | Valid destination pointer to the Vulkan pipeline viewport state create info. |
|
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.
vk_result | The Vulkan result code (VkResult). |
VK_ERROR_OUT_OF_HOST_MEMORY
to its string form.
|
extern |
|
extern |
Waits for a Vulkan device to become idle.
This function waits until the Vulkan device has finished all its operations.
device | Valid Vulkan device. |
|
extern |
Waits for Vulkan fences to become signaled.
This function waits for a specified number of Vulkan fences to become signaled.
device | Valid Vulkan device. |
fence_count | Number of fences to wait for. |
p_fences | Valid pointer to an array of Vulkan fences to wait for. |
wait_for_all | Whether to wait for all fences to be signaled. |
timeout_ns | Timeout in nanoseconds to wait for the fences. |
|
extern |
Waits for a Vulkan queue to become idle.
This function waits until the Vulkan queue has finished all its operations.
queue | Valid Vulkan queue to wait for. |
|
extern |
Waits for Vulkan semaphores to become signaled.
This function waits for a specified number of Vulkan semaphores to become signaled.
device | Valid Vulkan device. |
semaphore_count | Number of semaphores to wait for. |
p_semaphores | Valid pointer to an array of Vulkan semaphores to wait for. |
wait_for_all | Whether to wait for all semaphores to be signaled. |
timeout_ns | Timeout in nanoseconds to wait for the semaphores. |
p_semaphores_values | Valid destination pointer to an array of values for each semaphore. |
|
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.
device | Valid Vulkan device. |
memory | Valid Vulkan device memory to write to. |
offset | Offset in the memory to start writing to. |
data_size | Number of bytes to write. |
p_data | Valid pointer to a buffer containing the data to write. |