Added error handling, and fixed some typos
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
namespace cve {
|
namespace cve {
|
||||||
CvePipeline::CvePipeline(CveDevice &device, const std::string& vertFilepath,
|
CvePipeline::CvePipeline(CveDevice &device, const std::string& vertFilepath,
|
||||||
@@ -38,6 +39,10 @@ namespace cve {
|
|||||||
auto vertCode = readFile(vertFilepath);
|
auto vertCode = readFile(vertFilepath);
|
||||||
auto fragCode = readFile(fragFilepath);
|
auto fragCode = readFile(fragFilepath);
|
||||||
|
|
||||||
|
assert(configInfo.pipelineLayout != VK_NULL_HANDLE &&
|
||||||
|
"Unable to create graphics pipeline");
|
||||||
|
assert(configInfo.renderPass != VK_NULL_HANDLE &&
|
||||||
|
"Unable to create graphics pipeline");
|
||||||
createShaderModule(vertCode, &vertShaderModule);
|
createShaderModule(vertCode, &vertShaderModule);
|
||||||
createShaderModule(fragCode, &fragShaderModule);
|
createShaderModule(fragCode, &fragShaderModule);
|
||||||
|
|
||||||
@@ -47,16 +52,16 @@ namespace cve {
|
|||||||
shaderStages[0].module = vertShaderModule;
|
shaderStages[0].module = vertShaderModule;
|
||||||
shaderStages[0].pName = "main";
|
shaderStages[0].pName = "main";
|
||||||
shaderStages[0].flags = 0;
|
shaderStages[0].flags = 0;
|
||||||
shaderStages[0].pName = nullptr;
|
shaderStages[0].pNext = nullptr;
|
||||||
shaderStages[0].pSpecializationInfo = nullptr;
|
shaderStages[0].pSpecializationInfo = nullptr;
|
||||||
|
|
||||||
shaderStages[0].sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO;
|
shaderStages[1].sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO;
|
||||||
shaderStages[0].stage = VK_SHADER_STAGE_FRAGMENT_BIT;
|
shaderStages[1].stage = VK_SHADER_STAGE_FRAGMENT_BIT;
|
||||||
shaderStages[0].module = fragShaderModule;
|
shaderStages[1].module = fragShaderModule;
|
||||||
shaderStages[0].pName = "main";
|
shaderStages[1].pName = "main";
|
||||||
shaderStages[0].flags = 0;
|
shaderStages[1].flags = 0;
|
||||||
shaderStages[0].pName = nullptr;
|
shaderStages[1].pNext = nullptr;
|
||||||
shaderStages[0].pSpecializationInfo = nullptr;
|
shaderStages[1].pSpecializationInfo = nullptr;
|
||||||
|
|
||||||
VkPipelineVertexInputStateCreateInfo vertexInputInfo{};
|
VkPipelineVertexInputStateCreateInfo vertexInputInfo{};
|
||||||
vertexInputInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO;
|
vertexInputInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO;
|
||||||
|
|||||||
Reference in New Issue
Block a user