X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fvk.h;h=b9a8fb008230982eb891b72249639e08934cea72;hb=refs%2Fheads%2Fmaster;hp=f4187d3203e7dae040a0fe5f6ee6a80a9b25074d;hpb=3319bddd8188f6dc7e575169f3a0a53a93b3a8c7;p=vktest3 diff --git a/src/vk.h b/src/vk.h index f4187d3..b9a8fb0 100644 --- a/src/vk.h +++ b/src/vk.h @@ -57,12 +57,23 @@ void vk_cleanup(void); int vk_reshape(int xsz, int ysz); +/* returns the number of swapchain images */ +int vk_num_swap_images(void); +VkImageView vk_swap_image(int idx); +/* returns the image index, or -1 on failure. Pass optional semaphore to signal */ +int vk_next_swap_image(VkSemaphore sem); + +int vk_submit(VkQueue q, VkCommandBuffer cmdbuf, VkSemaphore semwait, VkSemaphore semsig); +int vk_present(VkQueue q, int imgid, VkSemaphore semwait); + int vk_find_qfamily(unsigned int flags); VkQueue vk_getq_fam(int fam, int n); VkQueue vk_getq(unsigned int flags, int n); VkCommandBuffer vk_create_cmdbuf_fam(int qfam, int level); VkCommandBuffer vk_create_cmdbuf(unsigned int qflags, int level); +/* return one of the swap-chain command buffers */ +VkCommandBuffer vk_get_cmdbuf(int imgid); int vk_create_rpass(void); void vk_free_rpass(int rp); @@ -103,4 +114,13 @@ void vk_pipeln_blend(int pp, int enable); void vk_pipeln_blendfunc(int pp, int src, int dst); VkPipeline vk_pipeln(int pp); +VkShaderModule vk_load_shader(const char *fname); +void vk_free_shader(VkShaderModule sdr); + +VkSemaphore vk_create_sem(void); +void vk_free_sem(VkSemaphore sem); + +/* random helpers */ +void vk_rect(VkRect2D *r, int x, int y, int w, int h); + #endif /* VK_H_ */