VulkanRaytracingCycles 0.0.0
Cycles Render Engine With VulkanRaytracingShaderModules. ( Experiment , in progress)
brunch Namespace Reference

Functions

void createComputePipeline (VkPipeline &pipe, const char *shader, VkPipelineLayout draft, VkPipelineCache cache, VkSpecializationInfo *specializationInfo)
 

Function Documentation

◆ createComputePipeline()

void brunch::createComputePipeline ( VkPipeline &  pipe,
const char *  shader,
VkPipelineLayout  draft,
VkPipelineCache  cache,
VkSpecializationInfo *  specializationInfo 
)

Definition at line 58 of file incomplete.cpp.

58 {
59
60 VkComputePipelineCreateInfo computePipelineCreateInfo = {
61 .sType = VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO,
62 .flags = 0,
63 .layout = draft,
64 };
65
66
67 VkPipelineShaderStageCreateInfo shaderStage = {};
68 shaderStage.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO;
69 shaderStage.stage = VK_SHADER_STAGE_COMPUTE_BIT;
70 shaderStage.module = vka::shelve::loadShader((std::string(COMSHADER_PATH) + std::string(shader) + std::string(".comp.spv")).c_str(), $device);
71 shaderStage.pName = "main";
72 if (specializationInfo != nullptr)shaderStage.pSpecializationInfo = specializationInfo;
73 assert(shaderStage.module != VK_NULL_HANDLE);
74 computePipelineCreateInfo.stage = shaderStage;
75
76 VK_CHECK_RESULT(vkCreateComputePipelines($device, cache, 1, &computePipelineCreateInfo, nullptr, &pipe));
77 vkDestroyShaderModule($device, shaderStage.module, nullptr);
78
79 };