| 631 | } |
| 632 | |
| 633 | void HPPApiVulkanSample::setup_depth_stencil() |
| 634 | { |
| 635 | std::tie(depth_stencil.image, depth_stencil.mem) = |
| 636 | get_device().create_image(depth_format, |
| 637 | get_render_context().get_surface_extent(), |
| 638 | 1, |
| 639 | vk::ImageUsageFlagBits::eDepthStencilAttachment | vk::ImageUsageFlagBits::eTransferSrc, |
| 640 | vk::MemoryPropertyFlagBits::eDeviceLocal); |
| 641 | |
| 642 | vk::ImageAspectFlags aspect_mask = vk::ImageAspectFlagBits::eDepth; |
| 643 | // Stencil aspect should only be set on depth + stencil formats |
| 644 | if ((vk::componentCount(depth_format) == 2) && (strcmp(vk::componentName(depth_format, 0), "D") == 0) && |
| 645 | (strcmp(vk::componentName(depth_format, 1), "S") == 0)) |
| 646 | { |
| 647 | aspect_mask |= vk::ImageAspectFlagBits::eStencil; |
| 648 | } |
| 649 | |
| 650 | depth_stencil.view = vkb::common::create_image_view(get_device().get_handle(), depth_stencil.image, vk::ImageViewType::e2D, depth_format, aspect_mask); |
| 651 | } |
| 652 | |
| 653 | void HPPApiVulkanSample::setup_framebuffer() |
| 654 | { |
nothing calls this directly
no test coverage detected