MCPcopy Create free account
hub / github.com/blurrypiano/littleVulkanEngine / createPipelineLayout

Method createPipelineLayout

src/systems/simple_render_system.cpp:32–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30}
31
32void SimpleRenderSystem::createPipelineLayout(VkDescriptorSetLayout globalSetLayout) {
33 VkPushConstantRange pushConstantRange{};
34 pushConstantRange.stageFlags = VK_SHADER_STAGE_VERTEX_BIT | VK_SHADER_STAGE_FRAGMENT_BIT;
35 pushConstantRange.offset = 0;
36 pushConstantRange.size = sizeof(SimplePushConstantData);
37
38 std::vector<VkDescriptorSetLayout> descriptorSetLayouts{globalSetLayout};
39
40 VkPipelineLayoutCreateInfo pipelineLayoutInfo{};
41 pipelineLayoutInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO;
42 pipelineLayoutInfo.setLayoutCount = static_cast<uint32_t>(descriptorSetLayouts.size());
43 pipelineLayoutInfo.pSetLayouts = descriptorSetLayouts.data();
44 pipelineLayoutInfo.pushConstantRangeCount = 1;
45 pipelineLayoutInfo.pPushConstantRanges = &pushConstantRange;
46 if (vkCreatePipelineLayout(lveDevice.device(), &pipelineLayoutInfo, nullptr, &pipelineLayout) !=
47 VK_SUCCESS) {
48 throw std::runtime_error("failed to create pipeline layout!");
49 }
50}
51
52void SimpleRenderSystem::createPipeline(VkRenderPass renderPass) {
53 assert(pipelineLayout != nullptr && "Cannot create pipeline before pipeline layout");

Callers

nothing calls this directly

Calls 1

deviceMethod · 0.80

Tested by

no test coverage detected