summaryrefslogtreecommitdiff
path: root/engine/xe_render_system.cpp
diff options
context:
space:
mode:
authortylermurphy534 <tylermurphy534@gmail.com>2022-09-25 12:07:49 -0400
committertylermurphy534 <tylermurphy534@gmail.com>2022-09-25 12:07:49 -0400
commit7c1dfec94391ec283e41b6b942d08dbc6bb69a3a (patch)
treec97c50778aabe4ec40a0e543bf464278e434a939 /engine/xe_render_system.cpp
parentremove Xe From engine class names (diff)
downloadminecraftvulkan-7c1dfec94391ec283e41b6b942d08dbc6bb69a3a.tar.gz
minecraftvulkan-7c1dfec94391ec283e41b6b942d08dbc6bb69a3a.tar.bz2
minecraftvulkan-7c1dfec94391ec283e41b6b942d08dbc6bb69a3a.zip
vertex data no longer hard coded
Diffstat (limited to 'engine/xe_render_system.cpp')
-rw-r--r--engine/xe_render_system.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/engine/xe_render_system.cpp b/engine/xe_render_system.cpp
index 4f2aadd..cf30f24 100644
--- a/engine/xe_render_system.cpp
+++ b/engine/xe_render_system.cpp
@@ -23,7 +23,9 @@ RenderSystem::RenderSystem(
std::map<uint32_t, uint32_t> uniformBindings,
std::map<uint32_t, Image*> imageBindings,
uint32_t pushCunstantDataSize,
- bool cullingEnabled
+ bool cullingEnabled,
+ std::vector<VkVertexInputAttributeDescription> attributeDescptions,
+ uint32_t vertexSize
) : xeDevice{xeEngine.xeDevice},
xeRenderer{xeEngine.xeRenderer},
xeDescriptorPool{xeEngine.xeDescriptorPool},
@@ -35,10 +37,9 @@ RenderSystem::RenderSystem(
createUniformBuffers();
createDescriptorSets();
createPipelineLayout();
- createPipeline(xeRenderer.getSwapChainRenderPass(), vert, frag, cullingEnabled);
+ createPipeline(xeRenderer.getSwapChainRenderPass(), vert, frag, cullingEnabled, attributeDescptions, vertexSize);
}
-
RenderSystem::~RenderSystem() {
vkDestroyPipelineLayout(xeDevice.device(), pipelineLayout, nullptr);
vkDestroySampler(xeDevice.device(), textureSampler, nullptr);
@@ -164,7 +165,7 @@ void RenderSystem::createPipelineLayout() {
}
-void RenderSystem::createPipeline(VkRenderPass renderPass, std::string vert, std::string frag, bool cullingEnabled) {
+void RenderSystem::createPipeline(VkRenderPass renderPass, std::string vert, std::string frag, bool cullingEnabled, std::vector<VkVertexInputAttributeDescription> attributeDescptions, uint32_t vertexSize) {
assert(pipelineLayout != nullptr && "Cannot create pipeline before pipeline layout");
PipelineConfigInfo pipelineConfig{};
@@ -178,7 +179,9 @@ void RenderSystem::createPipeline(VkRenderPass renderPass, std::string vert, std
xeDevice,
vert,
frag,
- pipelineConfig
+ pipelineConfig,
+ attributeDescptions,
+ vertexSize
);
}