whillothewhisp

framebuffer resources

Jan 4th, 2022 (edited)
1,810
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.26 KB | None | 0 0
  1. //helper functions will be provided in the bottom of the page
  2.  
  3.  
  4. //Create VKImage with the VK_FORMAT_R32_SFLOAT format for the color attachment 
  5. create_image(swapChainExtent.width, swapChainExtent.height, 1, VK_SAMPLE_COUNT_1_BIT,VK_FORMAT_R32_SFLOAT, VK_IMAGE_TILING_OPTIMAL,
  6.              VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT,    
  7.              object_picking_colorImage, object_picking_colorImageMemory);
  8.  
  9. //Create VKImageView with the VK_FORMAT_R32_SFLOAT format for the color attachment 
  10. object_picking_colorImageView = create_image_view(object_picking_colorImage, VK_FORMAT_R32_SFLOAT, VK_IMAGE_ASPECT_COLOR_BIT, 1);
  11.  
  12. //Create VKImage with the VK_FORMAT_R32_SFLOAT format for the depth attachment 
  13. create_image(swapChainExtent.width, swapChainExtent.height, 1, VK_SAMPLE_COUNT_1_BIT, depthFormat, VK_IMAGE_TILING_OPTIMAL,
  14.                  VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, object_picking_depthImage,
  15.                  object_picking_depthImageMemory);
  16.  
  17. //Create VKImageView with the VK_FORMAT_R32_SFLOAT format for the depth attachment 
  18. object_picking_depthImageView = create_image_view(object_picking_depthImage, depthFormat, VK_IMAGE_ASPECT_DEPTH_BIT, 1);
  19.  
Add Comment
Please, Sign In to add comment