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,
273 VkPhysicalDevice physical_device,
274 VkSurfaceKHR surface,
275 VkSurfaceCapabilitiesKHR* p_surface_capabilities
293 uint32_t queue_family_index,
294 uint32_t queue_count,
295 float* p_queue_priorities,
297 VkDeviceQueueCreateInfo* p_device_queue_info
316 VkPhysicalDevice physical_device,
318 uint32_t extension_count,
319 char** pp_extension_names,
320 uint32_t device_queue_count,
321 VkDeviceQueueCreateInfo* p_device_queue_infos
338 uint32_t queue_count,
339 uint32_t* p_queue_family_indices,
345 VkPhysicalDevice physical_device,
347 uint8_t* p_color_attachment_supported
350#define SH_MAX_STACK_DEVICE_COLOR_FORMATS_QUERIES 44
351#define SH_FORMAT_UINT 0
352#define SH_FORMAT_SINT 1
353#define SH_FORMAT_SFLOAT 2
354#define SH_FORMAT_UNDEFINED 3
366 VkPhysicalDevice physical_device,
367 uint32_t min_channel_count,
368 uint32_t max_channel_count,
369 uint32_t min_channel_size,
370 uint32_t max_channel_size,
372 uint32_t* p_supported_format_count,
373 VkFormat* p_supported_formats,
374 uint32_t* p_channels_count,
375 uint32_t* p_single_channels_sizes,
376 uint32_t* p_channels_types
401 VkPhysicalDevice physical_device,
402 VkSurfaceKHR surface,
403 VkFormat image_format,
404 VkFormat* p_image_format,
405 uint32_t swapchain_image_count,
406 VkSharingMode image_sharing_mode,
408 uint32_t* p_swapchain_image_count,
409 VkSwapchainKHR* p_swapchain
427 VkPhysicalDeviceProperties physical_device_properties,
428 uint32_t sample_count,
429 uint8_t combine_color_sample,
430 uint8_t combine_depth_sample,
431 uint32_t* p_sample_count
448 VkSwapchainKHR swapchain,
449 uint32_t* p_swapchain_image_count,
450 VkImage* p_swapchain_images
471 VkImageViewType view_type,
472 VkImageAspectFlagBits image_aspect,
475 VkImageView* p_image_view
494 uint32_t swapchain_image_count,
495 VkImage* p_swapchain_images,
496 VkImageView* p_swapchain_image_views
512 uint32_t queue_family_index,
513 VkCommandPool* p_cmd_pool
530 VkCommandPool cmd_pool,
531 uint32_t cmd_buffer_count,
532 VkCommandBuffer* p_cmd_buffer
554 uint32_t sample_count,
555 VkAttachmentLoadOp load_treatment,
556 VkAttachmentStoreOp store_treatment,
557 VkAttachmentLoadOp stencil_load_treatment,
558 VkAttachmentStoreOp stencil_store_treatment,
559 VkImageLayout initial_layout,
560 VkImageLayout final_layout,
561 VkAttachmentDescription* p_attachment_description
576 uint32_t attachment_idx,
577 VkImageLayout layout,
578 VkAttachmentReference* p_attachment_reference
600 VkPipelineBindPoint bind_point,
601 uint32_t input_attachment_count,
602 VkAttachmentReference* p_input_attachments_reference,
603 uint32_t color_attachment_count,
604 VkAttachmentReference* p_color_attachments_reference,
605 VkAttachmentReference* p_depth_stencil_attachment_reference,
606 VkAttachmentReference* p_resolve_attachment_reference,
607 uint32_t preserve_attachment_count,
608 uint32_t* p_preserve_attachments,
609 VkSubpassDescription* p_subpass
628 uint32_t attachment_count,
629 VkAttachmentDescription* p_attachments_descriptions,
630 uint32_t subpass_count,
631 VkSubpassDescription* p_subpasses,
632 VkRenderPass* p_renderpass
653 VkRenderPass renderpass,
654 uint32_t image_view_count,
655 VkImageView* p_image_views,
659 VkFramebuffer* p_framebuffer
687 VkSwapchainKHR swapchain
703 uint32_t framebuffer_count,
704 VkFramebuffer* p_framebuffers
720 uint32_t image_view_count,
721 VkImageView* p_image_views
753 VkCommandPool cmd_pool,
754 uint32_t cmd_buffer_count,
755 VkCommandBuffer* p_cmd_buffers
770 VkCommandPool cmd_pool
785 VkRenderPass render_pass
824 VkCommandBuffer cmd_buffer
837 VkCommandBuffer cmd_buffer
850 VkCommandBuffer cmd_buffer
866 VkCommandBuffer cmd_buffer,
867 uint32_t group_count_x,
868 uint32_t group_count_y,
869 uint32_t group_count_z
890 uint32_t cmd_buffer_count,
891 VkCommandBuffer* p_cmd_buffers,
894 uint32_t semaphores_to_wait_for_count,
895 VkSemaphore* p_semaphores_to_wait_for,
896 VkPipelineStageFlags wait_stage,
897 uint32_t signal_semaphore_count,
898 VkSemaphore* p_signal_semaphores
928 uint32_t fence_count,
946 uint32_t semaphore_count,
947 VkSemaphore* p_semaphores
963 uint32_t fence_count,
980 uint32_t semaphore_count,
981 VkSemaphore* p_semaphores
997 uint32_t fence_count,
1014 uint32_t semaphore_count,
1015 VkSemaphore* p_semaphores
1033 uint32_t fence_count,
1035 uint8_t wait_for_all,
1055 uint32_t semaphore_count,
1056 VkSemaphore* p_semaphores,
1057 uint8_t wait_for_all,
1058 uint64_t timeout_ns,
1059 uint64_t* p_semaphores_values
1079 VkSwapchainKHR swapchain,
1080 uint64_t timeout_ns,
1081 VkSemaphore acquired_signal_semaphore,
1082 VkFence acquired_signal_fence,
1083 uint32_t* p_swapchain_image_index,
1084 uint8_t* p_swapchain_suboptimal
1105 VkCommandBuffer graphics_cmd_buffer,
1106 VkRenderPass renderpass,
1107 int32_t render_offset_x,
1108 int32_t render_offset_y,
1109 uint32_t render_size_x,
1110 uint32_t render_size_y,
1111 uint32_t clear_value_count,
1112 VkClearValue* p_clear_values,
1113 VkFramebuffer framebuffer
1126 VkCommandBuffer graphics_cmd_buffer
1143 VkCommandBuffer graphics_cmd_buffer,
1144 uint32_t vertex_count,
1145 uint32_t first_vertex,
1146 uint32_t instance_count,
1147 uint32_t first_instance
1165 VkCommandBuffer graphics_cmd_buffer,
1166 uint32_t index_count,
1167 uint32_t instance_count,
1168 uint32_t first_index,
1169 int32_t vertex_offset,
1170 uint32_t first_instance
1187 VkQueue present_queue,
1188 uint32_t semaphores_to_wait_for_count,
1189 VkSemaphore* p_semaphores_to_wait_for,
1190 VkSwapchainKHR swapchain,
1191 uint32_t swapchain_image_idx
1196#define SH_VEC1_SIGNED_FLOAT VK_FORMAT_R32_SFLOAT
1197#define SH_VEC2_SIGNED_FLOAT VK_FORMAT_R32G32_SFLOAT
1198#define SH_VEC3_SIGNED_FLOAT VK_FORMAT_R32G32B32_SFLOAT
1199#define SH_VEC4_SIGNED_FLOAT VK_FORMAT_R32G32B32A32_SFLOAT
1201#define SH_VEC1_SIGNED_DOUBLE VK_FORMAT_R64_SFLOAT
1202#define SH_VEC2_SIGNED_DOUBLE VK_FORMAT_R64G64_SFLOAT
1203#define SH_VEC3_SIGNED_DOUBLE VK_FORMAT_R64G64B64_SFLOAT
1204#define SH_VEC4_SIGNED_DOUBLE VK_FORMAT_R64G64B64A64_SFLOAT
1206#define SH_VEC1_SIGNED_INT VK_FORMAT_R32_SINT
1207#define SH_VEC2_SIGNED_INT VK_FORMAT_R32G32_SINT
1208#define SH_VEC3_SIGNED_INT VK_FORMAT_R32G32B32_SINT
1209#define SH_VEC4_SIGNED_INT VK_FORMAT_R32G32B32A32_SINT
1211#define SH_VEC1_UNSIGNED_INT VK_FORMAT_R32_UINT
1212#define SH_VEC2_UNSIGNED_INT VK_FORMAT_R32G32_UINT
1213#define SH_VEC3_UNSIGNED_INT VK_FORMAT_R32G32B32_UINT
1214#define SH_VEC4_UNSIGNED_INT VK_FORMAT_R32G32B32A32_UINT
1216#define SH_VEC1_UNSIGNED_LONG VK_FORMAT_R64_UINT
1217#define SH_VEC2_UNSIGNED_LONG VK_FORMAT_R64G64_UINT
1218#define SH_VEC3_UNSIGNED_LONG VK_FORMAT_R64G64B64_UINT
1219#define SH_VEC4_UNSIGNED_LONG VK_FORMAT_R64G64B64A64_UINT
1238 VkBufferUsageFlags usage,
1239 VkSharingMode sharing_mode,
1257 VkPhysicalDevice physical_device,
1258 VkMemoryPropertyFlags property_flags,
1259 uint32_t* p_memory_type_index
1277 VkPhysicalDevice physical_device,
1279 VkMemoryPropertyFlags property_flags,
1280 VkDeviceMemory* p_memory
1298 VkCommandBuffer transfer_cmd_buffer,
1299 VkBuffer src_buffer,
1300 uint32_t src_offset,
1301 uint32_t dst_offset,
1306#define SH_MAX_STACK_BUFFER_REGION_COUNT 256
1324 VkCommandBuffer transfer_cmd_buffer,
1325 VkBuffer src_buffer,
1326 uint32_t region_count,
1327 uint32_t* p_src_offsets,
1328 uint32_t* p_dst_offsets,
1335 VkCommandBuffer transfer_cmd_buffer,
1338 VkImageAspectFlags src_image_aspect,
1339 VkImageAspectFlags dst_image_aspect,
1360 VkDeviceMemory buffer_memory
1380 VkDeviceMemory memory,
1390 VkDeviceMemory memory
1408 VkDeviceMemory memory,
1428 VkDeviceMemory memory
1458 uint32_t mip_levels,
1459 VkSampleCountFlagBits sample_count,
1460 VkImageTiling image_tiling,
1461 VkImageUsageFlags usage,
1462 VkSharingMode sharing_mode,
1481 VkPhysicalDevice physical_device,
1483 VkMemoryPropertyFlags memory_property_flags,
1484 VkDeviceMemory* p_image_memory
1503 VkDeviceMemory image_memory
1520 VkDeviceMemory image_memory
1527 VkImageAspectFlags image_aspect_mask,
1528 VkSubresourceLayout* p_subresource_layout
1550 VkCommandBuffer cmd_buffer,
1552 VkAccessFlags access_before_barrier,
1553 VkAccessFlags access_after_barrier,
1554 uint32_t performing_queue_family_index_before_barrier,
1555 uint32_t performing_queue_family_index_after_barrier,
1556 VkPipelineStageFlags pipeline_stage_before_barrier,
1557 VkPipelineStageFlags pipeline_stage_after_barrier
1582 VkCommandBuffer cmd_buffer,
1584 VkImageAspectFlags image_aspect_mask,
1585 VkAccessFlags access_before_barrier,
1586 VkAccessFlags access_after_barrier,
1587 VkImageLayout image_layout_before_barrier,
1588 VkImageLayout image_layout_after_barrier,
1589 uint32_t performing_queue_family_index_before_barrier,
1590 uint32_t performing_queue_family_index_after_barrier,
1591 VkPipelineStageFlags pipeline_stage_before_barrier,
1592 VkPipelineStageFlags pipeline_stage_after_barrier
1606 VkPhysicalDevice physical_device,
1607 VkPhysicalDeviceMemoryBudgetPropertiesEXT* p_memory_budget_properties
1624 VkCommandBuffer graphics_cmd_buffer,
1625 uint32_t first_binding,
1626 uint32_t binding_count,
1627 VkBuffer* p_vertex_buffers,
1628 VkDeviceSize* p_vertex_offsets
1643 VkCommandBuffer graphics_cmd_buffer,
1644 uint32_t index_offset,
1645 VkBuffer index_buffer
1663 VkVertexInputRate input_rate,
1664 VkVertexInputBindingDescription* p_vertex_input_binding
1685 VkVertexInputAttributeDescription* p_vertex_input_attribute
1702 uint32_t vertex_binding_count,
1703 VkVertexInputBindingDescription* p_vertex_bindings,
1704 uint32_t vertex_attribute_count,
1705 VkVertexInputAttributeDescription* p_vertex_attributes,
1706 VkPipelineVertexInputStateCreateInfo* p_vertex_input_state
1721 VkPrimitiveTopology primitive_topology,
1722 VkBool32 primitive_restart_enable,
1723 VkPipelineInputAssemblyStateCreateInfo* p_input_assembly
1738 VkPolygonMode polygon_mode,
1739 VkCullModeFlagBits cull_mode,
1740 VkPipelineRasterizationStateCreateInfo* p_rasterizer
1755 VkSampleCountFlagBits sample_count,
1756 float min_sample_shading_size,
1757 VkPipelineMultisampleStateCreateInfo* p_multisample_state
1780 uint32_t viewport_pos_x,
1781 uint32_t viewport_pos_y,
1782 uint32_t viewport_width,
1783 uint32_t viewport_height,
1784 VkViewport* p_viewport,
1785 uint32_t scissors_pos_x,
1786 uint32_t scissors_pos_y,
1787 uint32_t scissors_width,
1788 uint32_t scissors_height,
1789 VkRect2D* p_scissors,
1790 VkPipelineViewportStateCreateInfo* p_viewport_state
1807 uint8_t enable_color_blending,
1808 uint8_t enable_alpha_blending,
1809 uint32_t subpass_color_attachment_count,
1810 VkPipelineColorBlendAttachmentState* p_color_blend_attachment_states,
1811 VkPipelineColorBlendStateCreateInfo* p_color_blend_state
1830 VkShaderModule* p_shader_module
1845 VkShaderModule shader_module,
1846 VkShaderStageFlags shader_stage_flag,
1847 VkPipelineShaderStageCreateInfo* p_shader_stage
1863 VkShaderStageFlags shader_stage,
1866 VkPushConstantRange* p_push_constant_range
1884 VkDescriptorType descriptor_type,
1885 uint32_t descriptor_set_count,
1886 VkShaderStageFlags shader_stage,
1887 VkDescriptorSetLayoutBinding* p_binding
1904 uint32_t binding_count,
1905 VkDescriptorSetLayoutBinding* p_bindings,
1906 VkDescriptorSetLayout* p_descriptor_set_layout
1923 uint32_t pool_size_count,
1924 VkDescriptorPoolSize* p_pool_sizes,
1925 VkDescriptorPool* p_descriptor_pool
1942 uint32_t buffer_offset,
1943 uint32_t buffer_size,
1944 VkDescriptorBufferInfo* p_buffer_info
1966 VkDescriptorPool descriptor_pool,
1967 VkDescriptorType descriptor_type,
1969 uint32_t descriptor_set_unit_count,
1970 VkDescriptorSetLayout* p_descriptor_set_layouts,
1971 VkDescriptorSet* p_descriptor_sets,
1972 VkDescriptorBufferInfo* p_buffer_infos,
1973 VkWriteDescriptorSet* p_write_descriptor_sets
1992 uint32_t push_constant_range_count,
1993 VkPushConstantRange* p_push_constants_range,
1994 uint32_t src_descriptor_set_layout_count,
1995 VkDescriptorSetLayout* p_src_descriptor_set_layouts,
1996 VkPipelineLayout* p_pipeline_layout
2011 VkDescriptorPool descriptor_pool
2026 VkDescriptorSetLayout descriptor_set_layout
2041 VkShaderModule shader_module
2056 VkPipelineLayout pipeline_layout
2076#define SH_MAX_PIPELINE_VERTEX_BINDING_COUNT 32
2077#define SH_MAX_PIPELINE_VERTEX_ATTRIBUTE_COUNT 32
2079#define SH_MAX_PIPELINE_SHADER_STAGE_COUNT 6
2081#define SH_MAX_PIPELINE_SUBPASS_COLOR_ATTACHMENT_COUNT 9
2154 VkVertexInputRate input_rate,
2204 VkPrimitiveTopology primitive_topology,
2205 VkBool32 primitive_restart_enable,
2221 VkPolygonMode polygon_mode,
2222 VkCullModeFlagBits cull_mode,
2238 VkSampleCountFlagBits sample_count,
2239 float min_sample_shading_size,
2261 uint32_t viewport_pos_x,
2262 uint32_t viewport_pos_y,
2263 uint32_t viewport_width,
2264 uint32_t viewport_height,
2265 uint32_t scissors_pos_x,
2266 uint32_t scissors_pos_y,
2267 uint32_t scissors_width,
2268 uint32_t scissors_height,
2285 uint8_t enable_color_blending,
2286 uint8_t enable_alpha_blending,
2287 uint32_t subpass_color_attachment_count,
2321 VkShaderStageFlags shader_stage,
2338 VkShaderStageFlags shader_stage,
2359 uint32_t first_descriptor_set_layout,
2360 uint32_t descriptor_set_layout_count,
2393 VkRenderPass render_pass,
2409 VkCommandBuffer cmd_buffer,
2426 VkCommandBuffer cmd_buffer,
2427 VkPipelineBindPoint bind_point,
2449 VkCommandBuffer cmd_buffer,
2450 uint32_t first_descriptor_set,
2451 uint32_t first_descriptor_set_unit_idx,
2453 VkPipelineBindPoint bind_point,
2454 uint32_t dynamic_descriptors_count,
2455 uint32_t* p_dynamic_offsets,
2474 uint32_t first_module,
2475 uint32_t module_count,
2496#define SH_PIPELINE_POOL_MAX_PIPELINE_COUNT 64
2497#define SH_MAX_PIPELINE_POOL_DESCRIPTOR_COUNT 64
2540#define shAllocatePipelinePool() ((ShVkPipelinePool*)calloc(1, sizeof(ShVkPipelinePool)))
2549#define shFreePipelinePool free
2567 VkDescriptorType descriptor_type,
2568 uint32_t descriptor_set_count,
2569 VkShaderStageFlags shader_stage,
2588 uint32_t first_binding_idx,
2589 uint32_t binding_count,
2590 uint32_t set_layout_idx,
2607 uint32_t src_set_layout_idx,
2608 uint32_t first_dst_set_layout_idx,
2609 uint32_t dst_set_layout_count,
2629 VkDescriptorType descriptor_type,
2630 uint32_t descriptor_count,
2653 VkDescriptorType descriptor_type,
2654 uint32_t first_descriptor_set_unit,
2655 uint32_t descriptor_set_unit_count,
2674 uint32_t first_descriptor,
2675 uint32_t descriptor_count,
2677 uint32_t buffer_offset,
2678 uint32_t buffer_size,
2696 uint32_t first_set_layout,
2697 uint32_t set_layout_count,
2715 uint32_t first_pool,
2716 uint32_t pool_count,
2734 uint32_t first_descriptor_set_unit,
2735 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:2077
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 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:2081
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:2497
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.
struct ShVkPipelinePool ShVkPipelinePool
Represents a collection of Vulkan pipeline objects and their related resources.
Definition shVulkan.h:2122
uint8_t shGetPhysicalDeviceSurfaceCapabilities(VkPhysicalDevice physical_device, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR *p_surface_capabilities)
Retrieves the surface capabilities of a physical device.
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:356
@ SH_IMAGE_CHANNEL_TYPE_SFLOAT
Definition shVulkan.h:361
@ SH_IMAGE_CHANNEL_TYPE_SNORM
Definition shVulkan.h:358
@ SH_IMAGE_CHANNEL_TYPE_UNORM
Definition shVulkan.h:357
@ SH_IMAGE_CHANNEL_TYPE_UINT
Definition shVulkan.h:359
@ SH_IMAGE_CHANNEL_TYPE_UNDEFINED
Definition shVulkan.h:362
@ SH_IMAGE_CHANNEL_TYPE_SINT
Definition shVulkan.h:360
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 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 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 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.
struct ShVkPipeline ShVkPipeline
Structure representing a Vulkan 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 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:2496
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:2079
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:2076
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.
Structure representing a Vulkan pipeline.
Definition shVulkan.h:2089
VkPushConstantRange push_constant_range
Push constant range information.
Definition shVulkan.h:2103
VkPipelineInputAssemblyStateCreateInfo input_assembly
Input assembly state information.
Definition shVulkan.h:2096
VkPipeline pipeline
Vulkan pipeline.
Definition shVulkan.h:2117
uint32_t vertex_attribute_count
Number of vertex attributes.
Definition shVulkan.h:2093
VkPipelineColorBlendStateCreateInfo color_blend_state
Color blend state information.
Definition shVulkan.h:2112
VkRect2D scissors
Scissor rectangle information.
Definition shVulkan.h:2108
VkShaderModule shader_modules[SH_MAX_PIPELINE_SHADER_STAGE_COUNT]
Array of shader modules.
Definition shVulkan.h:2099
VkPipelineVertexInputStateCreateInfo vertex_input_state_info
Vertex input state information.
Definition shVulkan.h:2095
VkVertexInputAttributeDescription vertex_attributes[SH_MAX_PIPELINE_VERTEX_ATTRIBUTE_COUNT]
Array of vertex input attributes.
Definition shVulkan.h:2094
VkPipelineViewportStateCreateInfo viewport_state
Viewport state information.
Definition shVulkan.h:2109
VkPipelineShaderStageCreateInfo shader_stages[SH_MAX_PIPELINE_SHADER_STAGE_COUNT]
Array of shader stage create info.
Definition shVulkan.h:2101
VkVertexInputBindingDescription vertex_bindings[SH_MAX_PIPELINE_VERTEX_BINDING_COUNT]
Array of vertex input bindings.
Definition shVulkan.h:2092
VkViewport viewport
Viewport information.
Definition shVulkan.h:2107
uint32_t vertex_binding_count
Number of vertex bindings.
Definition shVulkan.h:2091
uint32_t shader_module_count
Number of shader modules.
Definition shVulkan.h:2098
VkPipelineMultisampleStateCreateInfo multisample_state_info
Multisample state information.
Definition shVulkan.h:2114
VkPipelineRasterizationStateCreateInfo rasterizer
Rasterizer state information.
Definition shVulkan.h:2105
uint32_t shader_stage_count
Number of shader stages.
Definition shVulkan.h:2100
VkPipelineColorBlendAttachmentState color_blend_attachment_states[SH_MAX_PIPELINE_SUBPASS_COLOR_ATTACHMENT_COUNT]
Array of color blend attachment states.
Definition shVulkan.h:2111
VkPipelineLayout pipeline_layout
Vulkan pipeline layout.
Definition shVulkan.h:2116
Represents a collection of Vulkan pipeline objects and their related resources.
Definition shVulkan.h:2506
VkDescriptorSetLayout descriptor_set_layouts[SH_MAX_PIPELINE_POOL_DESCRIPTOR_COUNT]
Descriptor set layouts.
Definition shVulkan.h:2518
uint32_t descriptor_count
Combined total of all descriptors in the descriptor pools.
Definition shVulkan.h:2512
ShVkPipeline pipelines[SH_PIPELINE_POOL_MAX_PIPELINE_COUNT]
Array of Vulkan pipelines managed by the pool.
Definition shVulkan.h:2507
VkDescriptorPool descriptor_pools[SH_MAX_PIPELINE_POOL_DESCRIPTOR_COUNT]
Descriptor pools.
Definition shVulkan.h:2520
uint32_t descriptor_pool_count
Total number of descriptor pools created and managed by the pool.
Definition shVulkan.h:2511
uint32_t descriptor_set_layout_binding_count
Total number of descriptor set layout bindings in the pool.
Definition shVulkan.h:2509
uint32_t write_descriptor_set_count
Total number of write descriptor sets used for updates.
Definition shVulkan.h:2513
uint32_t descriptor_set_unit_count
Number of descriptor set units, equal to write_descriptor_set_count.
Definition shVulkan.h:2514
uint32_t src_descriptor_set_layout_count
Number of source descriptor set layouts for copying or setup.
Definition shVulkan.h:2510
VkDescriptorSet descriptor_sets[SH_MAX_PIPELINE_POOL_DESCRIPTOR_COUNT]
Descriptor sets.
Definition shVulkan.h:2522
VkDescriptorSetLayoutBinding descriptor_set_layout_bindings[SH_MAX_PIPELINE_POOL_DESCRIPTOR_COUNT]
Descriptor set layout bindings.
Definition shVulkan.h:2516
VkWriteDescriptorSet write_descriptor_sets[SH_MAX_PIPELINE_POOL_DESCRIPTOR_COUNT]
Write descriptor sets.
Definition shVulkan.h:2526
VkDescriptorBufferInfo descriptor_buffer_infos[SH_MAX_PIPELINE_POOL_DESCRIPTOR_COUNT]
Descriptor buffer info.
Definition shVulkan.h:2524