Set up uniform buffer and texture sampler descriptor set layouts
| 1044 | |
| 1045 | // Set up uniform buffer and texture sampler descriptor set layouts |
| 1046 | void setupDescriptorSetLayout() |
| 1047 | { |
| 1048 | std::array<VkDescriptorSetLayoutBinding, 2> descriptorSetLayoutBindings{}; |
| 1049 | |
| 1050 | // Layout binding for uniform buffer |
| 1051 | descriptorSetLayoutBindings[0] = VkDescriptorSetLayoutBinding(); |
| 1052 | descriptorSetLayoutBindings[0].binding = 0; |
| 1053 | descriptorSetLayoutBindings[0].descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER; |
| 1054 | descriptorSetLayoutBindings[0].descriptorCount = 1; |
| 1055 | descriptorSetLayoutBindings[0].stageFlags = VK_SHADER_STAGE_VERTEX_BIT; |
| 1056 | |
| 1057 | // Layout binding for texture sampler |
| 1058 | descriptorSetLayoutBindings[1] = VkDescriptorSetLayoutBinding(); |
| 1059 | descriptorSetLayoutBindings[1].binding = 1; |
| 1060 | descriptorSetLayoutBindings[1].descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER; |
| 1061 | descriptorSetLayoutBindings[1].descriptorCount = 1; |
| 1062 | descriptorSetLayoutBindings[1].stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT; |
| 1063 | |
| 1064 | VkDescriptorSetLayoutCreateInfo descriptorSetLayoutCreateInfo = VkDescriptorSetLayoutCreateInfo(); |
| 1065 | descriptorSetLayoutCreateInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO; |
| 1066 | descriptorSetLayoutCreateInfo.bindingCount = static_cast<std::uint32_t>(descriptorSetLayoutBindings.size()); |
| 1067 | descriptorSetLayoutCreateInfo.pBindings = descriptorSetLayoutBindings.data(); |
| 1068 | |
| 1069 | // Create descriptor set layout |
| 1070 | if (vkCreateDescriptorSetLayout(device, &descriptorSetLayoutCreateInfo, nullptr, &descriptorSetLayout) != VK_SUCCESS) |
| 1071 | { |
| 1072 | vulkanAvailable = false; |
| 1073 | return; |
| 1074 | } |
| 1075 | } |
| 1076 | |
| 1077 | // Set up pipeline layout |
| 1078 | void setupPipelineLayout() |
nothing calls this directly
no test coverage detected