VEX Engine
Retro looking game engine made in vulkan mostly because i wanted to understand it better.
Loading...
Searching...
No Matches
Pipeline.hpp
Go to the documentation of this file.
1
6
7#pragma once
8#include "context.hpp"
9#include <vector>
10#include <glm/glm.hpp>
11#include <array>
12#include "components/ErrorUtils.hpp"
13
14#include "components/PathUtils.hpp"
16#include <filesystem>
17
18namespace vex {
21 public:
24 VulkanPipeline(VulkanContext& r_context);
26
34 const std::string& vertShaderPath,
35 const std::string& fragShaderPath,
36 const VkVertexInputBindingDescription& bindingDescription,
37 const std::vector<VkVertexInputAttributeDescription>& attributeDescriptions
38 );
39
47 const std::string& vertShaderPath,
48 const std::string& fragShaderPath,
49 const VkVertexInputBindingDescription& bindingDescription,
50 const std::vector<VkVertexInputAttributeDescription>& attributeDescriptions
51 );
52
60 const std::string& vertShaderPath,
61 const std::string& fragShaderPath,
62 const VkVertexInputBindingDescription& bindingDescription,
63 const std::vector<VkVertexInputAttributeDescription>& attributeDescriptions
64 );
65
74 const std::string& vertPath,
75 const std::string& fragPath,
76 bool isTransparent,
77 bool isInstanced
78 );
79
87 const std::string& vertShaderPath,
88 const std::string& fragShaderPath,
89 const VkVertexInputBindingDescription& bindingDesc,
90 const std::vector<VkVertexInputAttributeDescription>& attrDesc);
91
97 const std::string& vertPath,
98 const std::string& fragPath);
99
102 VkPipeline get() const { return m_pipeline; }
103
106 VkPipelineLayout layout() const { return m_layout; }
107
111 void updateViewport(glm::uvec2 resolution);
112
117 #if DEBUG
118 void createDebugPipeline(const std::string& vertPath, const std::string& fragPath);
119 #endif
120 private:
122 VkPipeline m_pipeline = VK_NULL_HANDLE;
123 VkPipelineLayout m_layout = VK_NULL_HANDLE;
124
125 glm::uvec2 m_currentRenderResolution;
126
130 std::vector<char> readFile(const std::string& filename);
131 };
132}
This file defines structs needed for UI rendering.
VkPipelineLayout layout() const
Returns the VkPipelineLayout handle.
Definition Pipeline.hpp:106
void createMaskedPipeline(const std::string &vertShaderPath, const std::string &fragShaderPath, const VkVertexInputBindingDescription &bindingDescription, const std::vector< VkVertexInputAttributeDescription > &attributeDescriptions)
Creates a Masked Graphics Pipeline (Alpha Cutout).
Definition Pipeline.cpp:428
void createUIPipeline(const std::string &vertShaderPath, const std::string &fragShaderPath, const VkVertexInputBindingDescription &bindingDesc, const std::vector< VkVertexInputAttributeDescription > &attrDesc)
Creates a UI Pipeline.
Definition Pipeline.cpp:775
std::vector< char > readFile(const std::string &filename)
Reads a file and returns its contents as a vector of characters.
Definition Pipeline.cpp:19
VulkanPipeline(VulkanContext &r_context)
Constructor for VulkanPipeline.
Definition Pipeline.cpp:8
VulkanContext & m_r_context
Creates a debug VkPipeline.
Definition Pipeline.hpp:121
VkPipeline get() const
Returns the VkPipeline handle.
Definition Pipeline.hpp:102
void updateViewport(glm::uvec2 resolution)
Updates viewport to new resolution.
Definition Pipeline.cpp:35
void createSpritePipeline(const std::string &vertPath, const std::string &fragPath, bool isTransparent, bool isInstanced)
Creates a Sprite Graphics Pipeline (used for Billboards and Particles).
Definition Pipeline.cpp:618
void createGraphicsPipeline(const std::string &vertShaderPath, const std::string &fragShaderPath, const VkVertexInputBindingDescription &bindingDescription, const std::vector< VkVertexInputAttributeDescription > &attributeDescriptions)
Creates a standard Opaque Graphics Pipeline.
Definition Pipeline.cpp:39
void createFullscreenPipeline(const std::string &vertPath, const std::string &fragPath)
Creates a Fullscreen Quad Pipeline.
Definition Pipeline.cpp:935
void createTransparentPipeline(const std::string &vertShaderPath, const std::string &fragShaderPath, const VkVertexInputBindingDescription &bindingDescription, const std::vector< VkVertexInputAttributeDescription > &attributeDescriptions)
Creates a Transparent Graphics Pipeline.
Definition Pipeline.cpp:229
This file defines struct holding all vulkan data, like device, surface, swapchain,...
Struct holding all vulkan data, like device, surface, swapchain, images, views, and more.
Definition context.hpp:26