diff --git a/src/vkrender.cc b/src/vkrender.cc index ad85efc85..cfe09a1b2 100644 --- a/src/vkrender.cc +++ b/src/vkrender.cc @@ -2633,76 +2633,6 @@ void AsyVkRender::createMaterialAndLightBuffers() { VARIABLE_NAME(lightBf)); } -void AsyVkRender::createImmediateRenderTargets() -{ - immRenderTargetViews.clear(); - immediateRenderTargetImgs.clear(); - prePresentationImages.clear(); - prePresentationImgViews.clear(); - immRenderTargetSampler.clear(); - - auto const framebufferSize= backbufferImages.size(); - - immRenderTargetViews.reserve(framebufferSize); - immediateRenderTargetImgs.reserve(framebufferSize); - prePresentationImages.reserve(framebufferSize); - prePresentationImgViews.reserve(framebufferSize); - immRenderTargetSampler.reserve(framebufferSize); - - for (size_t i= 0; i < framebufferSize; ++i) - { - // for immediate render target (after pixel shader) - auto const& immRenderTarget= immediateRenderTargetImgs.emplace_back(createImage( - backbufferExtent.width, - backbufferExtent.height, - vk::SampleCountFlagBits::e1, - backbufferImageFormat, - vk::ImageUsageFlagBits::eColorAttachment - | vk::ImageUsageFlagBits::eSampled - | vk::ImageUsageFlagBits::eStorage, - VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT - )); - - - auto& immRenderImgView= immRenderTargetViews.emplace_back(); - createImageView( - backbufferImageFormat, - vk::ImageAspectFlagBits::eColor, - immRenderTarget.getImage(), - immRenderImgView - ); - - // for sampling imm render target - immRenderTargetSampler.emplace_back(device->createSamplerUnique(vk::SamplerCreateInfo( - {}, - vk::Filter::eLinear, vk::Filter::eLinear, vk::SamplerMipmapMode::eNearest, - vk::SamplerAddressMode::eClampToEdge, vk::SamplerAddressMode::eClampToEdge, - vk::SamplerAddressMode::eClampToEdge, - 0.f, false, 0.0, false, vk::CompareOp::eNever, 0.0, 0.0, vk::BorderColor::eFloatTransparentBlack, - true - ))); - - // for pre-presentation (after post-processing) - auto const& prePresentationTarget= prePresentationImages.emplace_back(createImage( - backbufferExtent.width, - backbufferExtent.height, - vk::SampleCountFlagBits::e1, - backbufferImageFormat, - vk::ImageUsageFlagBits::eTransferSrc | vk::ImageUsageFlagBits::eStorage, - VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT - )); - - auto& prePresentationImageView= prePresentationImgViews.emplace_back(); - createImageView( - backbufferImageFormat, - vk::ImageAspectFlagBits::eColor, - prePresentationTarget.getImage(), - prePresentationImageView - ); - - } -} - void AsyVkRender::createImmediateRenderTargets() { immRenderTargetViews.clear();