19#include <vulkan/vulkan.h>
43#ifndef VK_MAKE_API_VERSION
44#define VK_MAKE_API_VERSION(variant, major, minor, patch)\
45 ((((uint32_t)(variant)) << 29U) | (((uint32_t)(major)) << 22U) | (((uint32_t)(minor)) << 12U) | ((uint32_t)(patch)))
62#define shVkError(condition, error_msg, failure_expression)\
63 if ((int)(condition)) {\
64 printf("shvulkan error: %s\n", (const char*)(error_msg));\
81#define shVkResultError(result, error_msg, failure_expression)\
82 if ((VkResult)(result) != VK_SUCCESS) {\
83 printf("shvulkan error: %s, %s\n", error_msg, shTranslateVkResult((VkResult)(result)));\
106#define SH_MAX_STACK_VALIDATION_LAYER_COUNT 32
108#define SH_MAX_STACK_QUEUE_FAMILY_COUNT 32
109#define SH_MAX_STACK_PHYSICAL_DEVICE_COUNT 8
110#define SH_MAX_STACK_QUEUE_COUNT 64
111#define SH_MAX_STACK_DEVICE_SURFACE_FORMAT_COUNT 256
112#define SH_MAX_STACK_SURFACE_PRESENT_MODE_COUNT 16
130 const char* validation_layer_name
150 const char* application_name,
151 const char* engine_name,
152 const uint8_t enable_validation_layers,
153 const uint32_t extension_count,
154 const char** pp_extension_names,
155 uint32_t api_version,
156 VkInstance* p_instance
181 VkPhysicalDevice physical_device,
182 VkSurfaceKHR surface,
183 uint32_t* p_queue_family_count,
184 uint32_t* p_graphics_queue_family_count,
185 uint32_t* p_surface_queue_family_count,
186 uint32_t* p_compute_queue_family_count,
187 uint32_t* p_transfer_queue_family_count,
188 uint32_t* p_graphics_queue_family_indices,
189 uint32_t* p_surface_queue_family_indices,
190 uint32_t* p_compute_queue_family_indices,
191 uint32_t* p_transfer_queue_family_indices,
192 VkQueueFamilyProperties* p_queue_families_properties
208 VkPhysicalDevice physical_device,
209 uint32_t queue_family_index,
210 VkSurfaceKHR surface,
232 VkSurfaceKHR surface,
233 VkQueueFlags requirements,
234 VkPhysicalDevice* p_physical_device,
235 VkPhysicalDeviceProperties* p_physical_device_properties,
236 VkPhysicalDeviceFeatures* p_physical_device_features,
237 VkPhysicalDeviceMemoryProperties* p_physical_device_memory_properties
254 VkPhysicalDevice physical_device,
255 uint32_t queue_family_index,
256 VkSurfaceKHR surface,
275 VkPhysicalDevice physical_device,
276 VkSurfaceKHR surface,
277 VkSurfaceCapabilitiesKHR* p_surface_capabilities,
278 uint32_t clamp_current_extent_width_value,
279 uint32_t clamp_current_extent_height_value
297 uint32_t queue_family_index,
298 uint32_t queue_count,
299 float* p_queue_priorities,
301 VkDeviceQueueCreateInfo* p_device_queue_info
320 VkPhysicalDevice physical_device,
322 uint32_t extension_count,
323 char** pp_extension_names,
324 uint32_t device_queue_count,
325 VkDeviceQueueCreateInfo* p_device_queue_infos
342 uint32_t queue_count,
343 uint32_t* p_queue_family_indices,
349 VkPhysicalDevice physical_device,
351 uint8_t* p_color_attachment_supported
354#define SH_MAX_STACK_DEVICE_COLOR_FORMATS_QUERIES 44
355#define SH_FORMAT_UINT 0
356#define SH_FORMAT_SINT 1
357#define SH_FORMAT_SFLOAT 2
358#define SH_FORMAT_UNDEFINED 3
370 VkPhysicalDevice physical_device,
371 uint32_t min_channel_count,
372 uint32_t max_channel_count,
373 uint32_t min_channel_size,
374 uint32_t max_channel_size,
376 uint32_t* p_supported_format_count,
377 VkFormat* p_supported_formats,
378 uint32_t* p_channels_count,
379 uint32_t* p_single_channels_sizes,
380 uint32_t* p_channels_types
406 VkPhysicalDevice physical_device,
407 VkSurfaceCapabilitiesKHR surface_capabilities,
408 VkSurfaceKHR surface,
409 VkFormat image_format,
410 VkFormat* p_image_format,
411 uint32_t swapchain_image_count,
412 VkSharingMode image_sharing_mode,
414 uint32_t* p_swapchain_image_count,
415 VkSwapchainKHR* p_swapchain
433 VkPhysicalDeviceProperties physical_device_properties,
434 uint32_t sample_count,
435 uint8_t combine_color_sample,
436 uint8_t combine_depth_sample,
437 uint32_t* p_sample_count
454 VkSwapchainKHR swapchain,
455 uint32_t* p_swapchain_image_count,
456 VkImage* p_swapchain_images
477 VkImageViewType view_type,
478 VkImageAspectFlagBits image_aspect,
481 VkImageView* p_image_view
500 uint32_t swapchain_image_count,
501 VkImage* p_swapchain_images,
502 VkImageView* p_swapchain_image_views
518 uint32_t queue_family_index,
519 VkCommandPool* p_cmd_pool
536 VkCommandPool cmd_pool,
537 uint32_t cmd_buffer_count,
538 VkCommandBuffer* p_cmd_buffer
560 uint32_t sample_count,
561 VkAttachmentLoadOp load_treatment,
562 VkAttachmentStoreOp store_treatment,
563 VkAttachmentLoadOp stencil_load_treatment,
564 VkAttachmentStoreOp stencil_store_treatment,
565 VkImageLayout initial_layout,
566 VkImageLayout final_layout,
567 VkAttachmentDescription* p_attachment_description
582 uint32_t attachment_idx,
583 VkImageLayout layout,
584 VkAttachmentReference* p_attachment_reference
606 VkPipelineBindPoint bind_point,
607 uint32_t input_attachment_count,
608 VkAttachmentReference* p_input_attachments_reference,
609 uint32_t color_attachment_count,
610 VkAttachmentReference* p_color_attachments_reference,
611 VkAttachmentReference* p_depth_stencil_attachment_reference,
612 VkAttachmentReference* p_resolve_attachment_reference,
613 uint32_t preserve_attachment_count,
614 uint32_t* p_preserve_attachments,
615 VkSubpassDescription* p_subpass
634 uint32_t attachment_count,
635 VkAttachmentDescription* p_attachments_descriptions,
636 uint32_t subpass_count,
637 VkSubpassDescription* p_subpasses,
638 VkRenderPass* p_renderpass
659 VkRenderPass renderpass,
660 uint32_t image_view_count,
661 VkImageView* p_image_views,
665 VkFramebuffer* p_framebuffer
693 VkSwapchainKHR swapchain
709 uint32_t framebuffer_count,
710 VkFramebuffer* p_framebuffers
726 uint32_t image_view_count,
727 VkImageView* p_image_views
759 VkCommandPool cmd_pool,
760 uint32_t cmd_buffer_count,
761 VkCommandBuffer* p_cmd_buffers
776 VkCommandPool cmd_pool
791 VkRenderPass render_pass
830 VkCommandBuffer cmd_buffer
843 VkCommandBuffer cmd_buffer
856 VkCommandBuffer cmd_buffer
872 VkCommandBuffer cmd_buffer,
873 uint32_t group_count_x,
874 uint32_t group_count_y,
875 uint32_t group_count_z
896 uint32_t cmd_buffer_count,
897 VkCommandBuffer* p_cmd_buffers,
900 uint32_t semaphores_to_wait_for_count,
901 VkSemaphore* p_semaphores_to_wait_for,
902 VkPipelineStageFlags wait_stage,
903 uint32_t signal_semaphore_count,
904 VkSemaphore* p_signal_semaphores
934 uint32_t fence_count,
952 uint32_t semaphore_count,
953 VkSemaphore* p_semaphores
969 uint32_t fence_count,
986 uint32_t semaphore_count,
987 VkSemaphore* p_semaphores
1003 uint32_t fence_count,
1020 uint32_t semaphore_count,
1021 VkSemaphore* p_semaphores
1039 uint32_t fence_count,
1041 uint8_t wait_for_all,
1061 uint32_t semaphore_count,
1062 VkSemaphore* p_semaphores,
1063 uint8_t wait_for_all,
1064 uint64_t timeout_ns,
1065 uint64_t* p_semaphores_values
1085 VkSwapchainKHR swapchain,
1086 uint64_t timeout_ns,
1087 VkSemaphore acquired_signal_semaphore,
1088 VkFence acquired_signal_fence,
1089 uint32_t* p_swapchain_image_index,
1090 uint8_t* p_swapchain_suboptimal
1111 VkCommandBuffer graphics_cmd_buffer,
1112 VkRenderPass renderpass,
1113 int32_t render_offset_x,
1114 int32_t render_offset_y,
1115 uint32_t render_size_x,
1116 uint32_t render_size_y,
1117 uint32_t clear_value_count,
1118 VkClearValue* p_clear_values,
1119 VkFramebuffer framebuffer
1132 VkCommandBuffer graphics_cmd_buffer
1149 VkCommandBuffer graphics_cmd_buffer,
1150 uint32_t vertex_count,
1151 uint32_t first_vertex,
1152 uint32_t instance_count,
1153 uint32_t first_instance
1171 VkCommandBuffer graphics_cmd_buffer,
1172 uint32_t index_count,
1173 uint32_t instance_count,
1174 uint32_t first_index,
1175 int32_t vertex_offset,
1176 uint32_t first_instance
1193 VkQueue present_queue,
1194 uint32_t semaphores_to_wait_for_count,
1195 VkSemaphore* p_semaphores_to_wait_for,
1196 VkSwapchainKHR swapchain,
1197 uint32_t swapchain_image_idx
1202#define SH_VEC1_SIGNED_FLOAT VK_FORMAT_R32_SFLOAT
1203#define SH_VEC2_SIGNED_FLOAT VK_FORMAT_R32G32_SFLOAT
1204#define SH_VEC3_SIGNED_FLOAT VK_FORMAT_R32G32B32_SFLOAT
1205#define SH_VEC4_SIGNED_FLOAT VK_FORMAT_R32G32B32A32_SFLOAT
1207#define SH_VEC1_SIGNED_DOUBLE VK_FORMAT_R64_SFLOAT
1208#define SH_VEC2_SIGNED_DOUBLE VK_FORMAT_R64G64_SFLOAT
1209#define SH_VEC3_SIGNED_DOUBLE VK_FORMAT_R64G64B64_SFLOAT
1210#define SH_VEC4_SIGNED_DOUBLE VK_FORMAT_R64G64B64A64_SFLOAT
1212#define SH_VEC1_SIGNED_INT VK_FORMAT_R32_SINT
1213#define SH_VEC2_SIGNED_INT VK_FORMAT_R32G32_SINT
1214#define SH_VEC3_SIGNED_INT VK_FORMAT_R32G32B32_SINT
1215#define SH_VEC4_SIGNED_INT VK_FORMAT_R32G32B32A32_SINT
1217#define SH_VEC1_UNSIGNED_INT VK_FORMAT_R32_UINT
1218#define SH_VEC2_UNSIGNED_INT VK_FORMAT_R32G32_UINT
1219#define SH_VEC3_UNSIGNED_INT VK_FORMAT_R32G32B32_UINT
1220#define SH_VEC4_UNSIGNED_INT VK_FORMAT_R32G32B32A32_UINT
1222#define SH_VEC1_UNSIGNED_LONG VK_FORMAT_R64_UINT
1223#define SH_VEC2_UNSIGNED_LONG VK_FORMAT_R64G64_UINT
1224#define SH_VEC3_UNSIGNED_LONG VK_FORMAT_R64G64B64_UINT
1225#define SH_VEC4_UNSIGNED_LONG VK_FORMAT_R64G64B64A64_UINT
1244 VkBufferUsageFlags usage,
1245 VkSharingMode sharing_mode,
1263 VkPhysicalDevice physical_device,
1264 VkMemoryPropertyFlags property_flags,
1265 uint32_t* p_memory_type_index
1283 VkPhysicalDevice physical_device,
1285 VkMemoryPropertyFlags property_flags,
1286 VkDeviceMemory* p_memory
1304 VkCommandBuffer transfer_cmd_buffer,
1305 VkBuffer src_buffer,
1306 uint32_t src_offset,
1307 uint32_t dst_offset,
1312#define SH_MAX_STACK_BUFFER_REGION_COUNT 256
1330 VkCommandBuffer transfer_cmd_buffer,
1331 VkBuffer src_buffer,
1332 uint32_t region_count,
1333 uint32_t* p_src_offsets,
1334 uint32_t* p_dst_offsets,
1341 VkCommandBuffer transfer_cmd_buffer,
1344 VkImageAspectFlags src_image_aspect,
1345 VkImageAspectFlags dst_image_aspect,
1366 VkDeviceMemory buffer_memory
1386 VkDeviceMemory memory,
1396 VkDeviceMemory memory
1414 VkDeviceMemory memory,
1434 VkDeviceMemory memory
1464 uint32_t mip_levels,
1465 VkSampleCountFlagBits sample_count,
1466 VkImageTiling image_tiling,
1467 VkImageUsageFlags usage,
1468 VkSharingMode sharing_mode,
1487 VkPhysicalDevice physical_device,
1489 VkMemoryPropertyFlags memory_property_flags,
1490 VkDeviceMemory* p_image_memory
1509 VkDeviceMemory image_memory
1526 VkDeviceMemory image_memory
1533 VkImageAspectFlags image_aspect_mask,
1534 VkSubresourceLayout* p_subresource_layout
1556 VkCommandBuffer cmd_buffer,
1558 VkAccessFlags access_before_barrier,
1559 VkAccessFlags access_after_barrier,
1560 uint32_t performing_queue_family_index_before_barrier,
1561 uint32_t performing_queue_family_index_after_barrier,
1562 VkPipelineStageFlags pipeline_stage_before_barrier,
1563 VkPipelineStageFlags pipeline_stage_after_barrier
1588 VkCommandBuffer cmd_buffer,
1590 VkImageAspectFlags image_aspect_mask,
1591 VkAccessFlags access_before_barrier,
1592 VkAccessFlags access_after_barrier,
1593 VkImageLayout image_layout_before_barrier,
1594 VkImageLayout image_layout_after_barrier,
1595 uint32_t performing_queue_family_index_before_barrier,
1596 uint32_t performing_queue_family_index_after_barrier,
1597 VkPipelineStageFlags pipeline_stage_before_barrier,
1598 VkPipelineStageFlags pipeline_stage_after_barrier
1612 VkPhysicalDevice physical_device,
1613 VkPhysicalDeviceMemoryBudgetPropertiesEXT* p_memory_budget_properties
1630 VkCommandBuffer graphics_cmd_buffer,
1631 uint32_t first_binding,
1632 uint32_t binding_count,
1633 VkBuffer* p_vertex_buffers,
1634 VkDeviceSize* p_vertex_offsets
1649 VkCommandBuffer graphics_cmd_buffer,
1650 uint32_t index_offset,
1651 VkBuffer index_buffer
1669 VkVertexInputRate input_rate,
1670 VkVertexInputBindingDescription* p_vertex_input_binding
1691 VkVertexInputAttributeDescription* p_vertex_input_attribute
1708 uint32_t vertex_binding_count,
1709 VkVertexInputBindingDescription* p_vertex_bindings,
1710 uint32_t vertex_attribute_count,
1711 VkVertexInputAttributeDescription* p_vertex_attributes,
1712 VkPipelineVertexInputStateCreateInfo* p_vertex_input_state
1727 VkPrimitiveTopology primitive_topology,
1728 VkBool32 primitive_restart_enable,
1729 VkPipelineInputAssemblyStateCreateInfo* p_input_assembly
1744 VkPolygonMode polygon_mode,
1745 VkCullModeFlagBits cull_mode,
1746 VkPipelineRasterizationStateCreateInfo* p_rasterizer
1761 VkSampleCountFlagBits sample_count,
1762 float min_sample_shading_size,
1763 VkPipelineMultisampleStateCreateInfo* p_multisample_state
1786 uint32_t viewport_pos_x,
1787 uint32_t viewport_pos_y,
1788 uint32_t viewport_width,
1789 uint32_t viewport_height,
1790 VkViewport* p_viewport,
1791 uint32_t scissors_pos_x,
1792 uint32_t scissors_pos_y,
1793 uint32_t scissors_width,
1794 uint32_t scissors_height,
1795 VkRect2D* p_scissors,
1796 VkPipelineViewportStateCreateInfo* p_viewport_state
1813 uint8_t enable_color_blending,
1814 uint8_t enable_alpha_blending,
1815 uint32_t subpass_color_attachment_count,
1816 VkPipelineColorBlendAttachmentState* p_color_blend_attachment_states,
1817 VkPipelineColorBlendStateCreateInfo* p_color_blend_state
1836 VkShaderModule* p_shader_module
1851 VkShaderModule shader_module,
1852 VkShaderStageFlags shader_stage_flag,
1853 VkPipelineShaderStageCreateInfo* p_shader_stage
1869 VkShaderStageFlags shader_stage,
1872 VkPushConstantRange* p_push_constant_range
1890 VkDescriptorType descriptor_type,
1891 uint32_t descriptor_set_count,
1892 VkShaderStageFlags shader_stage,
1893 VkDescriptorSetLayoutBinding* p_binding
1910 uint32_t binding_count,
1911 VkDescriptorSetLayoutBinding* p_bindings,
1912 VkDescriptorSetLayout* p_descriptor_set_layout
1929 uint32_t pool_size_count,
1930 VkDescriptorPoolSize* p_pool_sizes,
1931 VkDescriptorPool* p_descriptor_pool
1948 uint32_t buffer_offset,
1949 uint32_t buffer_size,
1950 VkDescriptorBufferInfo* p_buffer_info
1972 VkDescriptorPool descriptor_pool,
1973 VkDescriptorType descriptor_type,
1975 uint32_t descriptor_set_unit_count,
1976 VkDescriptorSetLayout* p_descriptor_set_layouts,
1977 VkDescriptorSet* p_descriptor_sets,
1978 VkDescriptorBufferInfo* p_buffer_infos,
1979 VkWriteDescriptorSet* p_write_descriptor_sets
1998 uint32_t push_constant_range_count,
1999 VkPushConstantRange* p_push_constants_range,
2000 uint32_t src_descriptor_set_layout_count,
2001 VkDescriptorSetLayout* p_src_descriptor_set_layouts,
2002 VkPipelineLayout* p_pipeline_layout
2017 VkDescriptorPool descriptor_pool
2032 VkDescriptorSetLayout descriptor_set_layout
2047 VkShaderModule shader_module
2062 VkPipelineLayout pipeline_layout
2082#define SH_MAX_PIPELINE_VERTEX_BINDING_COUNT 32
2083#define SH_MAX_PIPELINE_VERTEX_ATTRIBUTE_COUNT 32
2085#define SH_MAX_PIPELINE_SHADER_STAGE_COUNT 6
2087#define SH_MAX_PIPELINE_SUBPASS_COLOR_ATTACHMENT_COUNT 9
2160 VkVertexInputRate input_rate,
2210 VkPrimitiveTopology primitive_topology,
2211 VkBool32 primitive_restart_enable,
2227 VkPolygonMode polygon_mode,
2228 VkCullModeFlagBits cull_mode,
2244 VkSampleCountFlagBits sample_count,
2245 float min_sample_shading_size,
2267 uint32_t viewport_pos_x,
2268 uint32_t viewport_pos_y,
2269 uint32_t viewport_width,
2270 uint32_t viewport_height,
2271 uint32_t scissors_pos_x,
2272 uint32_t scissors_pos_y,
2273 uint32_t scissors_width,
2274 uint32_t scissors_height,
2291 uint8_t enable_color_blending,
2292 uint8_t enable_alpha_blending,
2293 uint32_t subpass_color_attachment_count,
2327 VkShaderStageFlags shader_stage,
2344 VkShaderStageFlags shader_stage,
2365 uint32_t first_descriptor_set_layout,
2366 uint32_t descriptor_set_layout_count,
2399 VkRenderPass render_pass,
2415 VkCommandBuffer cmd_buffer,
2432 VkCommandBuffer cmd_buffer,
2433 VkPipelineBindPoint bind_point,
2455 VkCommandBuffer cmd_buffer,
2456 uint32_t first_descriptor_set,
2457 uint32_t first_descriptor_set_unit_idx,
2459 VkPipelineBindPoint bind_point,
2460 uint32_t dynamic_descriptors_count,
2461 uint32_t* p_dynamic_offsets,
2480 uint32_t first_module,
2481 uint32_t module_count,
2502#define SH_PIPELINE_POOL_MAX_PIPELINE_COUNT 64
2503#define SH_MAX_PIPELINE_POOL_DESCRIPTOR_COUNT 64
2546#define shAllocatePipelinePool() ((ShVkPipelinePool*)calloc(1, sizeof(ShVkPipelinePool)))
2555#define shFreePipelinePool free
2573 VkDescriptorType descriptor_type,
2574 uint32_t descriptor_set_count,
2575 VkShaderStageFlags shader_stage,
2594 uint32_t first_binding_idx,
2595 uint32_t binding_count,
2596 uint32_t set_layout_idx,
2613 uint32_t src_set_layout_idx,
2614 uint32_t first_dst_set_layout_idx,
2615 uint32_t dst_set_layout_count,
2635 VkDescriptorType descriptor_type,
2636 uint32_t descriptor_count,
2659 VkDescriptorType descriptor_type,
2660 uint32_t first_descriptor_set_unit,
2661 uint32_t descriptor_set_unit_count,
2680 uint32_t first_descriptor,
2681 uint32_t descriptor_count,
2683 uint32_t buffer_offset,
2684 uint32_t buffer_size,
2702 uint32_t first_set_layout,
2703 uint32_t set_layout_count,
2721 uint32_t first_pool,
2722 uint32_t pool_count,
2740 uint32_t first_descriptor_set_unit,
2741 uint32_t descriptor_set_unit_count,
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 shDestroyFences(VkDevice device, uint32_t fence_count, VkFence *p_fences)
Destroys Vulkan fences.
uint8_t shPipelineSetVertexBinding(uint32_t binding, uint32_t size, VkVertexInputRate input_rate, ShVkPipeline *p_pipeline)
Sets vertex binding information in the pipeline.
uint8_t shSetupGraphicsPipeline(VkDevice device, VkRenderPass render_pass, ShVkPipeline *p_pipeline)
Sets up a graphics pipeline.
#define SH_MAX_PIPELINE_VERTEX_ATTRIBUTE_COUNT
Definition shVulkan.h:2083
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 shDestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptor_set_layout)
Destroys a Vulkan descriptor set layout.
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 shEndRenderpass(VkCommandBuffer graphics_cmd_buffer)
Ends a Vulkan render pass.
uint8_t shPipelineCreateShaderStage(VkShaderStageFlags shader_stage, ShVkPipeline *p_pipeline)
Creates a shader stage and adds it to the pipeline.
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 shCreateRenderpassAttachmentReference(uint32_t attachment_idx, VkImageLayout layout, VkAttachmentReference *p_attachment_reference)
Creates a Vulkan render pass attachment reference.
uint8_t shUnmapMemory(VkDevice device, VkDeviceMemory memory)
uint8_t shDestroyRenderpass(VkDevice device, VkRenderPass render_pass)
Destroys a Vulkan render pass.
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 shCreateDescriptorPool(VkDevice device, uint32_t pool_size_count, VkDescriptorPoolSize *p_pool_sizes, VkDescriptorPool *p_descriptor_pool)
Creates a descriptor pool.
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 shWaitDeviceIdle(VkDevice device)
Waits for a Vulkan device to become idle.
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 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 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 shPipelinePushConstants(VkCommandBuffer cmd_buffer, void *p_data, ShVkPipeline *p_pipeline)
Pushes constants to a pipeline using the command buffer.
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 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 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 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 shGetPhysicalDeviceSurfaceCapabilities(VkPhysicalDevice physical_device, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR *p_surface_capabilities, uint32_t clamp_current_extent_width_value, uint32_t clamp_current_extent_height_value)
Retrieves the surface capabilities of a physical device.
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 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 shPipelineSetPushConstants(VkShaderStageFlags shader_stage, uint32_t offset, uint32_t size, ShVkPipeline *p_pipeline)
Sets push constants in the pipeline.
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 shPipelineCreateInputAssembly(VkPrimitiveTopology primitive_topology, VkBool32 primitive_restart_enable, ShVkPipeline *p_pipeline)
Creates input assembly state information for the pipeline.
uint8_t shSetupComputePipeline(VkDevice device, ShVkPipeline *p_pipeline)
Sets up a compute pipeline.
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 shSetDescriptorBufferInfo(VkBuffer buffer, uint32_t buffer_offset, uint32_t buffer_size, VkDescriptorBufferInfo *p_buffer_info)
Sets buffer information for a descriptor 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 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 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 shDestroySemaphores(VkDevice device, uint32_t semaphore_count, VkSemaphore *p_semaphores)
Destroys Vulkan semaphores.
#define SH_MAX_PIPELINE_SUBPASS_COLOR_ATTACHMENT_COUNT
Definition shVulkan.h:2087
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 shDestroyInstance(VkInstance instance)
Destroys a Vulkan instance.
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 shDestroyCommandBuffers(VkDevice device, VkCommandPool cmd_pool, uint32_t cmd_buffer_count, VkCommandBuffer *p_cmd_buffers)
Destroys Vulkan command buffers.
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 shEndCommandBuffer(VkCommandBuffer cmd_buffer)
Ends recording commands into a Vulkan command buffer.
uint8_t shPipelineCreateShaderModule(VkDevice device, uint32_t size, char *code, ShVkPipeline *p_pipeline)
Creates a shader module and adds it to the pipeline.
#define SH_MAX_PIPELINE_POOL_DESCRIPTOR_COUNT
Definition shVulkan.h:2503
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 shGetImageSubresourceLayout(VkDevice device, VkImage image, VkImageAspectFlags image_aspect_mask, VkSubresourceLayout *p_subresource_layout)
uint8_t shCreateRasterizer(VkPolygonMode polygon_mode, VkCullModeFlagBits cull_mode, VkPipelineRasterizationStateCreateInfo *p_rasterizer)
Creates the rasterization state for a pipeline.
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 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 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 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 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 shPipelineDestroyShaderModules(VkDevice device, uint32_t first_module, uint32_t module_count, ShVkPipeline *p_pipeline)
Destroys shader modules associated with the pipeline.
uint8_t shCreateFences(VkDevice device, uint32_t fence_count, uint8_t signaled, VkFence *p_fences)
Creates Vulkan fences.
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 shFindValidationLayer(const char *validation_layer_name)
Searches for a specific Vulkan validation layer.
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 shDestroyDevice(VkDevice device)
Destroys a Vulkan device.
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 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 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 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 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 shGetMemoryBudgetProperties(VkPhysicalDevice physical_device, VkPhysicalDeviceMemoryBudgetPropertiesEXT *p_memory_budget_properties)
Retrieves memory budget properties for a Vulkan physical device.
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 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 shCreateSemaphores(VkDevice device, uint32_t semaphore_count, VkSemaphore *p_semaphores)
Creates Vulkan semaphores.
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 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 shSetMultisampleState(VkSampleCountFlagBits sample_count, float min_sample_shading_size, VkPipelineMultisampleStateCreateInfo *p_multisample_state)
Sets the multisample state for a pipeline.
uint8_t shDestroyImageViews(VkDevice device, uint32_t image_view_count, VkImageView *p_image_views)
Destroys Vulkan image views.
uint8_t shCreateShaderStage(VkShaderModule shader_module, VkShaderStageFlags shader_stage_flag, VkPipelineShaderStageCreateInfo *p_shader_stage)
Creates a Vulkan shader stage.
uint8_t shDestroySurface(VkInstance instance, VkSurfaceKHR surface)
Destroys a Vulkan surface.
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 shCreateBuffer(VkDevice device, uint32_t size, VkBufferUsageFlags usage, VkSharingMode sharing_mode, VkBuffer *p_buffer)
Creates a Vulkan buffer.
uint8_t shPipelineDestroyLayout(VkDevice device, ShVkPipeline *p_pipeline)
Destroys the pipeline layout associated with the pipeline.
uint8_t shBindImageMemory(VkDevice device, VkImage image, uint32_t offset, VkDeviceMemory image_memory)
Binds a Vulkan image to a specified memory offset.
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 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 shPipelineSetVertexInputState(ShVkPipeline *p_pipeline)
Sets vertex input state information in the pipeline.
uint8_t shDestroyPipelineLayout(VkDevice device, VkPipelineLayout pipeline_layout)
Destroys a Vulkan pipeline layout.
ShImageChannelTypeFlags
Definition shVulkan.h:360
@ SH_IMAGE_CHANNEL_TYPE_SFLOAT
Definition shVulkan.h:365
@ SH_IMAGE_CHANNEL_TYPE_SNORM
Definition shVulkan.h:362
@ SH_IMAGE_CHANNEL_TYPE_UNORM
Definition shVulkan.h:361
@ SH_IMAGE_CHANNEL_TYPE_UINT
Definition shVulkan.h:363
@ SH_IMAGE_CHANNEL_TYPE_UNDEFINED
Definition shVulkan.h:366
@ SH_IMAGE_CHANNEL_TYPE_SINT
Definition shVulkan.h:364
uint8_t shResetFences(VkDevice device, uint32_t fence_count, VkFence *p_fences)
Resets Vulkan fences.
uint8_t shDestroyShaderModule(VkDevice device, VkShaderModule shader_module)
Destroys a Vulkan shader module.
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 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 shResetSemaphores(VkDevice device, uint32_t semaphore_count, VkSemaphore *p_semaphores)
Resets Vulkan semaphores.
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.
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 shDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptor_pool)
Destroys a Vulkan descriptor pool.
uint8_t shDestroyPipeline(VkDevice device, VkPipeline pipeline)
Destroys a Vulkan pipeline.
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 shAllocateBufferMemory(VkDevice device, VkPhysicalDevice physical_device, VkBuffer buffer, VkMemoryPropertyFlags property_flags, VkDeviceMemory *p_memory)
Allocates memory for a Vulkan buffer.
uint8_t shDestroyCommandPool(VkDevice device, VkCommandPool cmd_pool)
Destroys a Vulkan command pool.
uint8_t shPipelineCreateRasterizer(VkPolygonMode polygon_mode, VkCullModeFlagBits cull_mode, ShVkPipeline *p_pipeline)
Creates rasterizer state information for the pipeline.
const char * shTranslateVkResult(VkResult vk_result)
Translates a VkResult enum into a literal string.
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 shCreateShaderModule(VkDevice device, uint32_t size, char *code, VkShaderModule *p_shader_module)
Creates a Vulkan shader module.
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 shBindPipeline(VkCommandBuffer cmd_buffer, VkPipelineBindPoint bind_point, ShVkPipeline *p_pipeline)
Binds a pipeline to a command buffer.
uint8_t shCreateSwapchain(VkDevice device, VkPhysicalDevice physical_device, VkSurfaceCapabilitiesKHR surface_capabilities, 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 shCheckSupportedDeviceColorFormat(VkPhysicalDevice physical_device, VkFormat format, uint8_t *p_color_attachment_supported)
uint8_t shCreateCommandPool(VkDevice device, uint32_t queue_family_index, VkCommandPool *p_cmd_pool)
Creates a Vulkan command pool.
uint8_t shCreateInputAssembly(VkPrimitiveTopology primitive_topology, VkBool32 primitive_restart_enable, VkPipelineInputAssemblyStateCreateInfo *p_input_assembly)
Creates the input assembly state for a pipeline.
uint8_t shDestroyFramebuffers(VkDevice device, uint32_t framebuffer_count, VkFramebuffer *p_framebuffers)
Destroys Vulkan framebuffers.
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 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 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 shClearPipeline(ShVkPipeline *p_pipeline)
Clears the pipeline structure.
uint8_t shResetCommandBuffer(VkCommandBuffer cmd_buffer)
Resets a Vulkan command buffer.
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 shPipelineSetMultisampleState(VkSampleCountFlagBits sample_count, float min_sample_shading_size, ShVkPipeline *p_pipeline)
Sets multisample state information in the pipeline.
uint8_t shClearImageMemory(VkDevice device, VkImage image, VkDeviceMemory image_memory)
Clears memory associated with a Vulkan image.
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 shAllocateCommandBuffers(VkDevice device, VkCommandPool cmd_pool, uint32_t cmd_buffer_count, VkCommandBuffer *p_cmd_buffer)
Allocates command buffers from a command pool.
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 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.
#define SH_PIPELINE_POOL_MAX_PIPELINE_COUNT
Definition shVulkan.h:2502
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 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 shPipelineSetVertexAttribute(uint32_t location, uint32_t binding, VkFormat format, uint32_t offset, ShVkPipeline *p_pipeline)
Sets vertex attribute information in the pipeline.
uint8_t shDestroySwapchain(VkDevice device, VkSwapchainKHR swapchain)
Destroys a Vulkan swapchain.
uint8_t shClearBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory memory)
Clears memory associated with a Vulkan buffer.
#define SH_MAX_PIPELINE_SHADER_STAGE_COUNT
Definition shVulkan.h:2085
uint8_t shBeginCommandBuffer(VkCommandBuffer cmd_buffer)
Begins recording commands into a Vulkan command buffer.
uint8_t shWaitForQueue(VkQueue queue)
Waits for a Vulkan queue to become idle.
#define SH_MAX_PIPELINE_VERTEX_BINDING_COUNT
Definition shVulkan.h:2082
uint8_t shBindBufferMemory(VkDevice device, VkBuffer buffer, uint32_t offset, VkDeviceMemory buffer_memory)
Binds a Vulkan buffer to a specified memory offset.
uint8_t shCreateDescriptorSetLayout(VkDevice device, uint32_t binding_count, VkDescriptorSetLayoutBinding *p_bindings, VkDescriptorSetLayout *p_descriptor_set_layout)
Creates a descriptor set layout.
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.
Represents a collection of Vulkan pipeline objects and their related resources.
Definition shVulkan.h:2512
VkDescriptorSetLayout descriptor_set_layouts[SH_MAX_PIPELINE_POOL_DESCRIPTOR_COUNT]
Descriptor set layouts.
Definition shVulkan.h:2524
uint32_t descriptor_count
Combined total of all descriptors in the descriptor pools.
Definition shVulkan.h:2518
ShVkPipeline pipelines[SH_PIPELINE_POOL_MAX_PIPELINE_COUNT]
Array of Vulkan pipelines managed by the pool.
Definition shVulkan.h:2513
VkDescriptorPool descriptor_pools[SH_MAX_PIPELINE_POOL_DESCRIPTOR_COUNT]
Descriptor pools.
Definition shVulkan.h:2526
uint32_t descriptor_pool_count
Total number of descriptor pools created and managed by the pool.
Definition shVulkan.h:2517
uint32_t descriptor_set_layout_binding_count
Total number of descriptor set layout bindings in the pool.
Definition shVulkan.h:2515
uint32_t write_descriptor_set_count
Total number of write descriptor sets used for updates.
Definition shVulkan.h:2519
uint32_t descriptor_set_unit_count
Number of descriptor set units, equal to write_descriptor_set_count.
Definition shVulkan.h:2520
uint32_t src_descriptor_set_layout_count
Number of source descriptor set layouts for copying or setup.
Definition shVulkan.h:2516
VkDescriptorSet descriptor_sets[SH_MAX_PIPELINE_POOL_DESCRIPTOR_COUNT]
Descriptor sets.
Definition shVulkan.h:2528
VkDescriptorSetLayoutBinding descriptor_set_layout_bindings[SH_MAX_PIPELINE_POOL_DESCRIPTOR_COUNT]
Descriptor set layout bindings.
Definition shVulkan.h:2522
VkWriteDescriptorSet write_descriptor_sets[SH_MAX_PIPELINE_POOL_DESCRIPTOR_COUNT]
Write descriptor sets.
Definition shVulkan.h:2532
VkDescriptorBufferInfo descriptor_buffer_infos[SH_MAX_PIPELINE_POOL_DESCRIPTOR_COUNT]
Descriptor buffer info.
Definition shVulkan.h:2530
Structure representing a Vulkan pipeline.
Definition shVulkan.h:2095
VkPushConstantRange push_constant_range
Push constant range information.
Definition shVulkan.h:2109
VkPipelineInputAssemblyStateCreateInfo input_assembly
Input assembly state information.
Definition shVulkan.h:2102
VkPipeline pipeline
Vulkan pipeline.
Definition shVulkan.h:2123
uint32_t vertex_attribute_count
Number of vertex attributes.
Definition shVulkan.h:2099
VkPipelineColorBlendStateCreateInfo color_blend_state
Color blend state information.
Definition shVulkan.h:2118
VkRect2D scissors
Scissor rectangle information.
Definition shVulkan.h:2114
VkShaderModule shader_modules[SH_MAX_PIPELINE_SHADER_STAGE_COUNT]
Array of shader modules.
Definition shVulkan.h:2105
VkPipelineVertexInputStateCreateInfo vertex_input_state_info
Vertex input state information.
Definition shVulkan.h:2101
VkVertexInputAttributeDescription vertex_attributes[SH_MAX_PIPELINE_VERTEX_ATTRIBUTE_COUNT]
Array of vertex input attributes.
Definition shVulkan.h:2100
VkPipelineViewportStateCreateInfo viewport_state
Viewport state information.
Definition shVulkan.h:2115
VkPipelineShaderStageCreateInfo shader_stages[SH_MAX_PIPELINE_SHADER_STAGE_COUNT]
Array of shader stage create info.
Definition shVulkan.h:2107
VkVertexInputBindingDescription vertex_bindings[SH_MAX_PIPELINE_VERTEX_BINDING_COUNT]
Array of vertex input bindings.
Definition shVulkan.h:2098
VkViewport viewport
Viewport information.
Definition shVulkan.h:2113
uint32_t vertex_binding_count
Number of vertex bindings.
Definition shVulkan.h:2097
uint32_t shader_module_count
Number of shader modules.
Definition shVulkan.h:2104
VkPipelineMultisampleStateCreateInfo multisample_state_info
Multisample state information.
Definition shVulkan.h:2120
VkPipelineRasterizationStateCreateInfo rasterizer
Rasterizer state information.
Definition shVulkan.h:2111
uint32_t shader_stage_count
Number of shader stages.
Definition shVulkan.h:2106
VkPipelineColorBlendAttachmentState color_blend_attachment_states[SH_MAX_PIPELINE_SUBPASS_COLOR_ATTACHMENT_COUNT]
Array of color blend attachment states.
Definition shVulkan.h:2117
VkPipelineLayout pipeline_layout
Vulkan pipeline layout.
Definition shVulkan.h:2122