2019-04-18 16:38:58 +08:00
|
|
|
|
#ifndef HGL_GRAPH_VULKAN_PIPELINE_INCLUDE
|
|
|
|
|
#define HGL_GRAPH_VULKAN_PIPELINE_INCLUDE
|
|
|
|
|
|
|
|
|
|
#include"VK.h"
|
|
|
|
|
|
|
|
|
|
VK_NAMESPACE_BEGIN
|
|
|
|
|
class Pipeline
|
|
|
|
|
{
|
2019-04-18 16:53:14 +08:00
|
|
|
|
VkDevice device;
|
2019-04-18 16:38:58 +08:00
|
|
|
|
VkPipeline pipeline;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
2019-04-18 16:53:14 +08:00
|
|
|
|
Pipeline(VkDevice dev,VkPipeline p){device=dev;pipeline=p;}
|
2019-04-18 16:38:58 +08:00
|
|
|
|
virtual ~Pipeline();
|
|
|
|
|
};//class GraphicsPipeline
|
|
|
|
|
|
|
|
|
|
class Shader;
|
|
|
|
|
class VertexInput;
|
|
|
|
|
|
|
|
|
|
class PipelineCreater
|
|
|
|
|
{
|
2019-04-18 16:53:14 +08:00
|
|
|
|
VkDevice device;
|
|
|
|
|
uint width,height;
|
2019-04-18 16:38:58 +08:00
|
|
|
|
VkGraphicsPipelineCreateInfo pipelineInfo;
|
|
|
|
|
|
|
|
|
|
VkPipelineVertexInputStateCreateInfo vis_create_info;
|
2019-04-18 16:53:14 +08:00
|
|
|
|
VkPipelineInputAssemblyStateCreateInfo inputAssembly;
|
|
|
|
|
|
|
|
|
|
VkViewport viewport;
|
|
|
|
|
VkRect2D scissor;
|
|
|
|
|
VkPipelineViewportStateCreateInfo viewportState;
|
2019-04-18 16:38:58 +08:00
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
const Shader * shader =nullptr;
|
|
|
|
|
const VertexInput * vertex_input=nullptr;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
2019-04-18 16:53:14 +08:00
|
|
|
|
PipelineCreater(VkDevice dev,uint w,uint h);
|
2019-04-18 16:38:58 +08:00
|
|
|
|
~PipelineCreater();
|
|
|
|
|
|
|
|
|
|
bool Set(const Shader *);
|
|
|
|
|
bool Set(const VertexInput *);
|
2019-04-18 16:53:14 +08:00
|
|
|
|
bool Set(const VkPrimitiveTopology,bool=false);
|
2019-04-18 16:38:58 +08:00
|
|
|
|
|
|
|
|
|
Pipeline *Create();
|
|
|
|
|
};//class PipelineCreater
|
|
|
|
|
VK_NAMESPACE_END
|
|
|
|
|
#endif//HGL_GRAPH_VULKAN_PIPELINE_INCLUDE
|