More pipelining

This commit is contained in:
2026-02-20 10:33:11 +00:00
parent e5085cb791
commit 958bf93546
4 changed files with 20 additions and 4 deletions

View File

@@ -36,10 +36,24 @@ namespace cve {
std::cout << "Fragment shader code size: " << fragCode.size() << '\n';
}
void createShaderModule(const std::vector<char>& code, VkShaderModule *shaderModule) {
void CvePipeline::createShaderModule(const std::vector<char>& code, VkShaderModule *shaderModule) {
VkShaderModuleCreateInfo createInfo{};
createInfo.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO;
createInfo.codeSize = code.size();
createInfo.pCode = reinterpret_cast<const uint32_t*>(code.data());
if (vkCreateShaderModule(cveDevice.device(), &createInfo, nullptr, shaderModule) != VK_SUCCESS) {
throw std::runtime_error("Failed to create shader module.");
}
}
PipelineConfigInfo CvePipeline::defaultPipelineConfigInfo(uint32_t width, uint32_t height) {
PipelineConfigInfo configInfo{};
configInfo.inputAssemblyInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO;
configInfo.inputAssemblyInfo.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
configInfo.inputAssemblyInfo.primitiveRestartEnable = VK_FALSE;
return configInfo;
}
}