rev |
line source |
nuclear@12
|
1 #ifndef VKPIPE_H_
|
nuclear@12
|
2 #define VKPIPE_H_
|
nuclear@8
|
3
|
nuclear@8
|
4 #include <vulkan/vulkan.h>
|
nuclear@8
|
5
|
nuclear@12
|
6 #define VKU_MAX_SDR_STAGES 8
|
nuclear@12
|
7
|
nuclear@13
|
8 struct vku_pipeline {
|
nuclear@12
|
9 VkPipelineShaderStageCreateInfo sdrstage[VKU_MAX_SDR_STAGES];
|
nuclear@12
|
10 int num_sdr_stages;
|
nuclear@12
|
11 VkPipelineVertexInputStateCreateInfo vertinp;
|
nuclear@12
|
12 VkPipelineInputAssemblyStateCreateInfo inpasm;
|
nuclear@12
|
13 VkPipelineViewportStateCreateInfo vport;
|
nuclear@12
|
14 VkPipelineRasterizationStateCreateInfo rast;
|
nuclear@12
|
15 VkPipelineMultisampleStateCreateInfo msaa;
|
nuclear@12
|
16 VkPipelineDepthStencilStateCreateInfo zstencil;
|
nuclear@12
|
17 VkPipelineColorBlendStateCreateInfo blend;
|
nuclear@12
|
18 /*VkPipelineDynamicStateCreateInfo dyn;*/
|
nuclear@13
|
19 VkPipelineLayoutCreateInfo lay;
|
nuclear@13
|
20
|
nuclear@13
|
21 VkRenderPass rpass;
|
nuclear@13
|
22 VkPipeline pipeline;
|
nuclear@13
|
23 VkPipelineLayout layout;
|
nuclear@12
|
24
|
nuclear@12
|
25 /* data needed by the structs above */
|
nuclear@12
|
26 VkViewport vport_data;
|
nuclear@12
|
27 VkRect2D scissor_data;
|
nuclear@12
|
28 VkPipelineColorBlendAttachmentState atblend;
|
nuclear@12
|
29 };
|
nuclear@12
|
30
|
nuclear@13
|
31 int vku_init_pipeline(struct vku_pipeline *st);
|
nuclear@13
|
32 void vku_pipeline_shader(struct vku_pipeline *st, VkShaderModule sdr, VkShaderStageFlagBits type);
|
nuclear@13
|
33 void vku_pipeline_primitive(struct vku_pipeline *st, VkPrimitiveTopology prim);
|
nuclear@13
|
34 void vku_pipeline_viewport(struct vku_pipeline *st, int x, int y, int w, int h);
|
nuclear@13
|
35 void vku_pipeline_scissor(struct vku_pipeline *st, int x, int y, int w, int h);
|
nuclear@13
|
36 void vku_pipeline_polygon_mode(struct vku_pipeline *st, VkPolygonMode pmode);
|
nuclear@13
|
37 void vku_pipeline_line_width(struct vku_pipeline *st, float w);
|
nuclear@13
|
38 void vku_pipeline_cull_mode(struct vku_pipeline *st, VkCullModeFlagBits cull);
|
nuclear@13
|
39 void vku_pipeline_front_face(struct vku_pipeline *st, VkFrontFace front);
|
nuclear@13
|
40 void vku_pipeline_depth_bias(struct vku_pipeline *st, float fslope, float fconst, float clamp);
|
nuclear@13
|
41 void vku_pipeline_depth_test(struct vku_pipeline *st, int enable);
|
nuclear@13
|
42 void vku_pipeline_depth_func(struct vku_pipeline *st, VkCompareOp op);
|
nuclear@13
|
43 void vku_pipeline_depth_mask(struct vku_pipeline *st, int zmask);
|
nuclear@13
|
44 void vku_pipeline_stencil_test(struct vku_pipeline *st, int enable);
|
nuclear@13
|
45 void vku_pipeline_stencil_func(struct vku_pipeline *st, VkCompareOp op, int ref, unsigned int mask);
|
nuclear@13
|
46 void vku_pipeline_stencil_op(struct vku_pipeline *st, VkStencilOp sfail, VkStencilOp dfail, VkStencilOp pass);
|
nuclear@13
|
47 void vku_pipeline_stencil_mask(struct vku_pipeline *st, unsigned int smask);
|
nuclear@13
|
48 void vku_pipeline_color_mask(struct vku_pipeline *st, int rmask, int gmask, int bmask, int amask);
|
nuclear@13
|
49 void vku_pipeline_blend_enable(struct vku_pipeline *st, int enable);
|
nuclear@13
|
50 void vku_pipeline_blend_func(struct vku_pipeline *st, VkBlendFactor src, VkBlendFactor dst);
|
nuclear@13
|
51 void vku_pipeline_renderpass(struct vku_pipeline *st, VkRenderPass rpass);
|
nuclear@12
|
52
|
nuclear@13
|
53 VkPipeline vku_create_pipeline(struct vku_pipeline *st);
|
nuclear@13
|
54 void vku_destroy_pipeline(struct vku_pipeline *p);
|
nuclear@12
|
55
|
nuclear@8
|
56 VkShaderModule vku_load_shader(const char *fname);
|
nuclear@8
|
57 void vku_destroy_shader(VkShaderModule sdr);
|
nuclear@8
|
58
|
nuclear@12
|
59 #endif /* VKPIPE_H_ */
|