13 VkPushConstantRange pushConstantRange{};
14 pushConstantRange.stageFlags = VK_SHADER_STAGE_VERTEX_BIT | VK_SHADER_STAGE_FRAGMENT_BIT;
15 pushConstantRange.offset = 0;
18 const std::vector<VkDescriptorSetLayout> descriptorSetLayouts{globalSetLayout};
20 VkPipelineLayoutCreateInfo pipelineLayoutInfo{};
21 pipelineLayoutInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO;
22 pipelineLayoutInfo.setLayoutCount =
static_cast<uint32_t
>(descriptorSetLayouts.size());
23 pipelineLayoutInfo.pSetLayouts = descriptorSetLayouts.data();
24 pipelineLayoutInfo.pushConstantRangeCount = 1;
25 pipelineLayoutInfo.pPushConstantRanges = &pushConstantRange;
26 if (vkCreatePipelineLayout(m_device.device(), &pipelineLayoutInfo,
nullptr, &m_pipelineLayout) != VK_SUCCESS)
28 throw std::runtime_error(
"Failed to create pipeline layout");
47 for (
auto &kv : frameInfo.
objects)
49 Object &
object = kv.second;
50 if (
object.model ==
nullptr)
continue;
53 push.normalMatrix =
object.transform3D.normalMatrix();