| 2497 | } |
| 2498 | |
| 2499 | void Demo::prepare_descriptor_layout() { |
| 2500 | std::array<vk::DescriptorSetLayoutBinding, 2> const layout_bindings = { |
| 2501 | vk::DescriptorSetLayoutBinding() |
| 2502 | .setBinding(0) |
| 2503 | .setDescriptorType(vk::DescriptorType::eUniformBuffer) |
| 2504 | .setDescriptorCount(1) |
| 2505 | .setStageFlags(vk::ShaderStageFlagBits::eVertex) |
| 2506 | .setPImmutableSamplers(nullptr), |
| 2507 | vk::DescriptorSetLayoutBinding() |
| 2508 | .setBinding(1) |
| 2509 | .setDescriptorType(vk::DescriptorType::eCombinedImageSampler) |
| 2510 | .setDescriptorCount(texture_count) |
| 2511 | .setStageFlags(vk::ShaderStageFlagBits::eFragment) |
| 2512 | .setPImmutableSamplers(nullptr)}; |
| 2513 | |
| 2514 | auto const descriptor_layout = vk::DescriptorSetLayoutCreateInfo().setBindings(layout_bindings); |
| 2515 | |
| 2516 | auto result = device.createDescriptorSetLayout(&descriptor_layout, nullptr, &desc_layout); |
| 2517 | VERIFY(result == vk::Result::eSuccess); |
| 2518 | |
| 2519 | auto const pPipelineLayoutCreateInfo = vk::PipelineLayoutCreateInfo().setSetLayouts(desc_layout); |
| 2520 | |
| 2521 | result = device.createPipelineLayout(&pPipelineLayoutCreateInfo, nullptr, &pipeline_layout); |
| 2522 | VERIFY(result == vk::Result::eSuccess); |
| 2523 | } |
| 2524 | |
| 2525 | void Demo::prepare_descriptor_pool() { |
| 2526 | std::array<vk::DescriptorPoolSize, 2> const poolSizes = { |
nothing calls this directly
no outgoing calls
no test coverage detected