Got the triangle working! It only took 10 hours.
This commit is contained in:
parent
3d36517b4f
commit
10fc100e2b
11 changed files with 352 additions and 4 deletions
|
|
@ -2,6 +2,37 @@
|
|||
|
||||
#include "vk_types.h"
|
||||
|
||||
class PipelineBuilder {
|
||||
public:
|
||||
std::vector<VkPipelineShaderStageCreateInfo> _shaderStages;
|
||||
|
||||
VkPipelineInputAssemblyStateCreateInfo _inputAssembly;
|
||||
VkPipelineRasterizationStateCreateInfo _rasterizer;
|
||||
VkPipelineColorBlendAttachmentState _colorBlendAttachment;
|
||||
VkPipelineMultisampleStateCreateInfo _multisampling;
|
||||
VkPipelineLayout _pipelineLayout;
|
||||
VkPipelineDepthStencilStateCreateInfo _depthStencil;
|
||||
VkPipelineRenderingCreateInfo _renderInfo;
|
||||
VkFormat _colorAttachmentFormat;
|
||||
|
||||
PipelineBuilder() {
|
||||
clear();
|
||||
}
|
||||
|
||||
void clear();
|
||||
|
||||
VkPipeline build_pipeline(VkDevice device);
|
||||
void set_shaders(VkShaderModule vertexShader, VkShaderModule fragmentShader);
|
||||
void set_input_topology(VkPrimitiveTopology topology);
|
||||
void set_polygon_mode(VkPolygonMode mode);
|
||||
void set_cull_mode(VkCullModeFlags cullMode, VkFrontFace frontFace);
|
||||
void set_multisampling_none();
|
||||
void disable_blending();
|
||||
void set_color_attachment_format(VkFormat format);
|
||||
void set_depth_format(VkFormat format);
|
||||
void disable_depthtest();
|
||||
};
|
||||
|
||||
namespace vkutil {
|
||||
bool load_shader_module(const char* filePath,
|
||||
VkDevice device,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue