Vertex positions no longer hard coded
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
#include "cve_pipeline.hpp"
|
||||
|
||||
#include "cve_model.hpp"
|
||||
|
||||
#include <fstream>
|
||||
#include <stdexcept>
|
||||
#include <iostream>
|
||||
@@ -63,12 +65,15 @@ namespace cve {
|
||||
shaderStages[1].pNext = nullptr;
|
||||
shaderStages[1].pSpecializationInfo = nullptr;
|
||||
|
||||
|
||||
auto bindingDescriptions = CveModel::Vertex::getBindingDescriptions();
|
||||
auto attributeDescriptions = CveModel::Vertex::getAttributeDescriptions();
|
||||
VkPipelineVertexInputStateCreateInfo vertexInputInfo{};
|
||||
vertexInputInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO;
|
||||
vertexInputInfo.vertexBindingDescriptionCount = 0;
|
||||
vertexInputInfo.vertexAttributeDescriptionCount = 0;
|
||||
vertexInputInfo.pVertexBindingDescriptions = nullptr;
|
||||
vertexInputInfo.pVertexAttributeDescriptions = nullptr;
|
||||
vertexInputInfo.vertexAttributeDescriptionCount = static_cast<uint32_t>(attributeDescriptions.size());
|
||||
vertexInputInfo.vertexBindingDescriptionCount = static_cast<uint32_t>(bindingDescriptions.size());
|
||||
vertexInputInfo.pVertexBindingDescriptions = bindingDescriptions.data();
|
||||
vertexInputInfo.pVertexAttributeDescriptions = attributeDescriptions.data();
|
||||
|
||||
VkPipelineViewportStateCreateInfo viewportInfo{};
|
||||
viewportInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO;
|
||||
|
||||
Reference in New Issue
Block a user