summaryrefslogtreecommitdiff
path: root/engine/xe_render_system.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engine/xe_render_system.cpp')
-rw-r--r--engine/xe_render_system.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/engine/xe_render_system.cpp b/engine/xe_render_system.cpp
index ff745e6..99c92b1 100644
--- a/engine/xe_render_system.cpp
+++ b/engine/xe_render_system.cpp
@@ -10,6 +10,7 @@ RenderSystem::RenderSystem(
std::map<uint32_t, std::vector<Image*>> imageArrayBindings,
uint32_t pushCunstantDataSize,
bool cullingEnabled,
+ bool wireframeEnabled,
std::vector<VkVertexInputAttributeDescription> attributeDescptions,
uint32_t vertexSize
) : xeDevice{Engine::getInstance()->xeDevice},
@@ -23,7 +24,7 @@ RenderSystem::RenderSystem(
createUniformBuffers();
createDescriptorSets();
createPipelineLayout();
- createPipeline(xeRenderer.getSwapChainRenderPass(), vert, frag, cullingEnabled, attributeDescptions, vertexSize);
+ createPipeline(xeRenderer.getSwapChainRenderPass(), vert, frag, cullingEnabled, wireframeEnabled, attributeDescptions, vertexSize);
}
RenderSystem::~RenderSystem() {
@@ -155,7 +156,7 @@ void RenderSystem::createPipelineLayout() {
}
-void RenderSystem::createPipeline(VkRenderPass renderPass, std::string vert, std::string frag, bool cullingEnabled, std::vector<VkVertexInputAttributeDescription> attributeDescptions, uint32_t vertexSize) {
+void RenderSystem::createPipeline(VkRenderPass renderPass, std::string vert, std::string frag, bool cullingEnabled, bool wireframeEnabled, std::vector<VkVertexInputAttributeDescription> attributeDescptions, uint32_t vertexSize) {
assert(pipelineLayout != nullptr && "Cannot create pipeline before pipeline layout");
PipelineConfigInfo pipelineConfig{};
@@ -163,6 +164,9 @@ void RenderSystem::createPipeline(VkRenderPass renderPass, std::string vert, std
if (cullingEnabled) {
pipelineConfig.rasterizationInfo.cullMode = VK_CULL_MODE_BACK_BIT;
}
+ if(wireframeEnabled) {
+ pipelineConfig.rasterizationInfo.polygonMode = VK_POLYGON_MODE_LINE;
+ }
pipelineConfig.renderPass = renderPass;
pipelineConfig.pipelineLayout = pipelineLayout;
xePipeline = std::make_unique<Pipeline>(