| 1251 | } |
| 1252 | |
| 1253 | VkResult IBLLib::vkHelper::createFramebuffer(VkFramebuffer& _outFramebuffer, VkRenderPass _renderPass, uint32_t _width, uint32_t _height, const std::vector<VkImageView>& _attachments, uint32_t _layers) |
| 1254 | { |
| 1255 | if (m_logicalDevice == VK_NULL_HANDLE) |
| 1256 | { |
| 1257 | return VK_RESULT_MAX_ENUM; |
| 1258 | } |
| 1259 | |
| 1260 | VkResult res = VK_RESULT_MAX_ENUM; |
| 1261 | |
| 1262 | VkFramebufferCreateInfo info{}; |
| 1263 | info.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO; |
| 1264 | info.pNext = nullptr; |
| 1265 | info.renderPass = _renderPass; |
| 1266 | info.attachmentCount = static_cast<uint32_t>(_attachments.size()); |
| 1267 | info.pAttachments = _attachments.data(); |
| 1268 | info.width = _width; |
| 1269 | info.height = _height; |
| 1270 | info.layers = _layers; |
| 1271 | info.flags = 0u; |
| 1272 | |
| 1273 | if ((res = vkCreateFramebuffer(m_logicalDevice, &info, nullptr, &_outFramebuffer)) != VK_SUCCESS) |
| 1274 | { |
| 1275 | _outFramebuffer = VK_NULL_HANDLE; |
| 1276 | printf("Failed to create framebuffer [%u]\n", res); |
| 1277 | return res; |
| 1278 | } |
| 1279 | |
| 1280 | m_frameBuffers.emplace_back(_outFramebuffer); |
| 1281 | |
| 1282 | return res; |
| 1283 | } |
| 1284 | |
| 1285 | VkResult IBLLib::vkHelper::createFramebuffer(VkFramebuffer& _outFramebuffer, VkRenderPass _renderPass, VkImage _image) |
| 1286 | { |
no outgoing calls
no test coverage detected