| 347 | } |
| 348 | |
| 349 | ResourceHandler::CreatedViewT< VkImageView > ResourceHandler::createImageView( GraphContext & context |
| 350 | , ImageViewId view ) |
| 351 | { |
| 352 | ResourceHandler::CreatedViewT< VkImageView > result{}; |
| 353 | |
| 354 | if ( context.vkCreateImageView ) |
| 355 | { |
| 356 | lock_type lock( m_bufferViewsMutex ); |
| 357 | auto [it, ins] = m_imageViews.try_emplace( view, VkImageView{} ); |
| 358 | |
| 359 | if ( ins ) |
| 360 | { |
| 361 | auto image = createImage( context, view.data->image ).resource; |
| 362 | auto createInfo = reshdl::convert( *view.data, image ); |
| 363 | auto res = context.vkCreateImageView( context.device |
| 364 | , &createInfo |
| 365 | , context.allocator |
| 366 | , &it->second ); |
| 367 | checkVkResult( res, "ImageView creation" ); |
| 368 | crgRegisterObjectName( context, view.data->name, it->second ); |
| 369 | result.view = it->second; |
| 370 | result.created = true; |
| 371 | } |
| 372 | else |
| 373 | { |
| 374 | result.view = it->second; |
| 375 | } |
| 376 | } |
| 377 | |
| 378 | return result; |
| 379 | } |
| 380 | |
| 381 | VkSampler ResourceHandler::createSampler( GraphContext & context |
| 382 | , std::string const & suffix |
nothing calls this directly
no test coverage detected