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