nuclear@12: #ifndef VKPIPE_H_ nuclear@12: #define VKPIPE_H_ nuclear@8: nuclear@8: #include nuclear@8: nuclear@12: #define VKU_MAX_SDR_STAGES 8 nuclear@12: nuclear@13: struct vku_pipeline { nuclear@12: VkPipelineShaderStageCreateInfo sdrstage[VKU_MAX_SDR_STAGES]; nuclear@12: int num_sdr_stages; nuclear@12: VkPipelineVertexInputStateCreateInfo vertinp; nuclear@12: VkPipelineInputAssemblyStateCreateInfo inpasm; nuclear@12: VkPipelineViewportStateCreateInfo vport; nuclear@12: VkPipelineRasterizationStateCreateInfo rast; nuclear@12: VkPipelineMultisampleStateCreateInfo msaa; nuclear@12: VkPipelineDepthStencilStateCreateInfo zstencil; nuclear@12: VkPipelineColorBlendStateCreateInfo blend; nuclear@12: /*VkPipelineDynamicStateCreateInfo dyn;*/ nuclear@13: VkPipelineLayoutCreateInfo lay; nuclear@13: nuclear@13: VkRenderPass rpass; nuclear@13: VkPipeline pipeline; nuclear@13: VkPipelineLayout layout; nuclear@12: nuclear@12: /* data needed by the structs above */ nuclear@12: VkViewport vport_data; nuclear@12: VkRect2D scissor_data; nuclear@12: VkPipelineColorBlendAttachmentState atblend; nuclear@12: }; nuclear@12: nuclear@13: int vku_init_pipeline(struct vku_pipeline *st); nuclear@13: void vku_pipeline_shader(struct vku_pipeline *st, VkShaderModule sdr, VkShaderStageFlagBits type); nuclear@13: void vku_pipeline_primitive(struct vku_pipeline *st, VkPrimitiveTopology prim); nuclear@13: void vku_pipeline_viewport(struct vku_pipeline *st, int x, int y, int w, int h); nuclear@13: void vku_pipeline_scissor(struct vku_pipeline *st, int x, int y, int w, int h); nuclear@13: void vku_pipeline_polygon_mode(struct vku_pipeline *st, VkPolygonMode pmode); nuclear@13: void vku_pipeline_line_width(struct vku_pipeline *st, float w); nuclear@13: void vku_pipeline_cull_mode(struct vku_pipeline *st, VkCullModeFlagBits cull); nuclear@13: void vku_pipeline_front_face(struct vku_pipeline *st, VkFrontFace front); nuclear@13: void vku_pipeline_depth_bias(struct vku_pipeline *st, float fslope, float fconst, float clamp); nuclear@13: void vku_pipeline_depth_test(struct vku_pipeline *st, int enable); nuclear@13: void vku_pipeline_depth_func(struct vku_pipeline *st, VkCompareOp op); nuclear@13: void vku_pipeline_depth_mask(struct vku_pipeline *st, int zmask); nuclear@13: void vku_pipeline_stencil_test(struct vku_pipeline *st, int enable); nuclear@13: void vku_pipeline_stencil_func(struct vku_pipeline *st, VkCompareOp op, int ref, unsigned int mask); nuclear@13: void vku_pipeline_stencil_op(struct vku_pipeline *st, VkStencilOp sfail, VkStencilOp dfail, VkStencilOp pass); nuclear@13: void vku_pipeline_stencil_mask(struct vku_pipeline *st, unsigned int smask); nuclear@13: void vku_pipeline_color_mask(struct vku_pipeline *st, int rmask, int gmask, int bmask, int amask); nuclear@13: void vku_pipeline_blend_enable(struct vku_pipeline *st, int enable); nuclear@13: void vku_pipeline_blend_func(struct vku_pipeline *st, VkBlendFactor src, VkBlendFactor dst); nuclear@13: void vku_pipeline_renderpass(struct vku_pipeline *st, VkRenderPass rpass); nuclear@12: nuclear@13: VkPipeline vku_create_pipeline(struct vku_pipeline *st); nuclear@13: void vku_destroy_pipeline(struct vku_pipeline *p); nuclear@12: nuclear@8: VkShaderModule vku_load_shader(const char *fname); nuclear@8: void vku_destroy_shader(VkShaderModule sdr); nuclear@8: nuclear@12: #endif /* VKPIPE_H_ */