5 #include <vulkan/vulkan.h>
13 /* queue capability flags for vk_find_qfamily and vk_init_queue */
22 * arranged so that: (1 << VKSDR_FOO) == VK_SHADER_STAGE_FOO_BIT
37 VKSDR_CLOSESTHIT = 10,
46 VKPRIM_POINTS = VK_PRIMITIVE_TOPOLOGY_POINT_LIST,
47 VKPRIM_LINES = VK_PRIMITIVE_TOPOLOGY_LINE_LIST,
48 VKPRIM_TRIANGLES = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST
51 void vk_init_xwin(Display *dpy, Window win);
52 void vk_init_queue(unsigned int qflags, int count);
54 int vk_init(unsigned int flags, unsigned int *usedflags);
55 void vk_cleanup(void);
57 int vk_reshape(int xsz, int ysz);
59 int vk_find_qfamily(unsigned int flags);
60 VkQueue vk_getq_fam(int fam, int n);
61 VkQueue vk_getq(unsigned int flags, int n);
63 VkCommandBuffer vk_create_cmdbuf_fam(int qfam, int level);
64 VkCommandBuffer vk_create_cmdbuf(unsigned int qflags, int level);
66 int vk_create_rpass(void);
67 void vk_free_rpass(int rp);
68 void vk_rpass_colorbuf(int rp, int fmt, int n);
69 void vk_rpass_msaa(int rp, int nsamp);
70 void vk_rpass_clear(int rp, int clear);
71 VkRenderPass vk_rpass(int rp);
73 int vk_create_fb(void);
74 void vk_free_fb(int fb);
75 void vk_fb_size(int fb, int x, int y);
76 void vk_fb_rpass(int fb, int rpass);
77 void vk_fb_images(int fb, int n, ...);
78 VkFramebuffer vk_fb(int fb);
80 int vk_create_pipeln(void);
81 void vk_free_pipeln(int pp);
82 void vk_viewport(int pp, int x, int y, int width, int height);
83 void vk_scissor(int pp, int x, int y, int width, int height);
84 void vk_pipeln_shader(int pp, int type, VkShaderModule sdr);
85 /* TODO: vertex input */
86 void vk_pipeln_prim(int pp, int prim);
87 void vk_pipeln_polymode(int pp, int mode);
88 void vk_pipeln_cull(int pp, int cull);
89 void vk_pipeln_frontface(int pp, int ff);
90 void vk_pipeln_multisample(int pp, int nsamples);
91 void vk_pipeln_colormask(int pp, int r, int g, int b, int a);
92 void vk_pipeln_depthmask(int pp, int z);
93 void vk_pipeln_stencilmask(int pp, int s);
94 void vk_pipeln_zbuffer(int pp, int enable);
95 void vk_pipeln_stencil(int pp, int enable);
96 void vk_pipeln_stencil_op(int pp, int sfail, int zfail, int zpass);
97 void vk_pipeln_stencil_func(int pp, int op, unsigned int ref, unsigned int mask);
98 void vk_pipeln_blend(int pp, int enable);
99 void vk_pipeln_blendfunc(int pp, int src, int dst);
100 VkPipeline vk_pipeln(int pp);