vk oit: load correct attachment. Only reset pipelines when needed
Fixes partial renders: ECCO initial sequence. Issue #1614 Don't reset pipelines when resizing framebuffer.
This commit is contained in:
parent
0ff9caf656
commit
757732d0f8
|
@ -138,9 +138,10 @@ public:
|
||||||
void Init(SamplerManager *samplerManager, OITShaderManager *shaderManager, OITBuffers *oitBuffers,
|
void Init(SamplerManager *samplerManager, OITShaderManager *shaderManager, OITBuffers *oitBuffers,
|
||||||
const vk::Extent2D& viewport)
|
const vk::Extent2D& viewport)
|
||||||
{
|
{
|
||||||
if (!screenPipelineManager)
|
if (!screenPipelineManager) {
|
||||||
screenPipelineManager = std::make_unique<OITPipelineManager>();
|
screenPipelineManager = std::make_unique<OITPipelineManager>();
|
||||||
screenPipelineManager->Init(shaderManager, oitBuffers);
|
screenPipelineManager->Init(shaderManager, oitBuffers);
|
||||||
|
}
|
||||||
OITDrawer::Init(samplerManager, screenPipelineManager.get(), oitBuffers);
|
OITDrawer::Init(samplerManager, screenPipelineManager.get(), oitBuffers);
|
||||||
|
|
||||||
MakeFramebuffers(viewport);
|
MakeFramebuffers(viewport);
|
||||||
|
|
|
@ -28,10 +28,10 @@ vk::UniqueRenderPass RenderPasses::MakeRenderPass(bool initial, bool last, bool
|
||||||
attach0,
|
attach0,
|
||||||
// OP+PT color attachment
|
// OP+PT color attachment
|
||||||
vk::AttachmentDescription(vk::AttachmentDescriptionFlags(), vk::Format::eR8G8B8A8Unorm, vk::SampleCountFlagBits::e1,
|
vk::AttachmentDescription(vk::AttachmentDescriptionFlags(), vk::Format::eR8G8B8A8Unorm, vk::SampleCountFlagBits::e1,
|
||||||
initial ? vk::AttachmentLoadOp::eClear : vk::AttachmentLoadOp::eLoad,
|
loadClear && initial ? vk::AttachmentLoadOp::eClear : vk::AttachmentLoadOp::eLoad,
|
||||||
last ? vk::AttachmentStoreOp::eDontCare : vk::AttachmentStoreOp::eStore,
|
last ? vk::AttachmentStoreOp::eDontCare : vk::AttachmentStoreOp::eStore,
|
||||||
vk::AttachmentLoadOp::eDontCare, vk::AttachmentStoreOp::eDontCare,
|
vk::AttachmentLoadOp::eDontCare, vk::AttachmentStoreOp::eDontCare,
|
||||||
initial ? vk::ImageLayout::eUndefined : attach0.finalLayout, attach0.finalLayout), // initial layout is eUndefined for rtt, so use final layout instead
|
loadClear && initial ? vk::ImageLayout::eUndefined : attach0.finalLayout, attach0.finalLayout), // initial layout is eUndefined for rtt, so use final layout instead
|
||||||
// OP+PT depth attachment
|
// OP+PT depth attachment
|
||||||
vk::AttachmentDescription(vk::AttachmentDescriptionFlags(), GetContext()->GetDepthFormat(), vk::SampleCountFlagBits::e1,
|
vk::AttachmentDescription(vk::AttachmentDescriptionFlags(), GetContext()->GetDepthFormat(), vk::SampleCountFlagBits::e1,
|
||||||
initial ? vk::AttachmentLoadOp::eClear : vk::AttachmentLoadOp::eLoad,
|
initial ? vk::AttachmentLoadOp::eClear : vk::AttachmentLoadOp::eLoad,
|
||||||
|
|
|
@ -44,7 +44,7 @@ protected:
|
||||||
virtual vk::AttachmentDescription GetAttachment0Description(bool initial, bool last, bool loadClear) const
|
virtual vk::AttachmentDescription GetAttachment0Description(bool initial, bool last, bool loadClear) const
|
||||||
{
|
{
|
||||||
return vk::AttachmentDescription(vk::AttachmentDescriptionFlags(), vk::Format::eR8G8B8A8Unorm, vk::SampleCountFlagBits::e1,
|
return vk::AttachmentDescription(vk::AttachmentDescriptionFlags(), vk::Format::eR8G8B8A8Unorm, vk::SampleCountFlagBits::e1,
|
||||||
loadClear ? vk::AttachmentLoadOp::eClear : vk::AttachmentLoadOp::eLoad, vk::AttachmentStoreOp::eStore,
|
vk::AttachmentLoadOp::eClear, vk::AttachmentStoreOp::eStore,
|
||||||
vk::AttachmentLoadOp::eDontCare, vk::AttachmentStoreOp::eDontCare,
|
vk::AttachmentLoadOp::eDontCare, vk::AttachmentStoreOp::eDontCare,
|
||||||
config::EmulateFramebuffer && initial ? vk::ImageLayout::eTransferSrcOptimal : vk::ImageLayout::eShaderReadOnlyOptimal,
|
config::EmulateFramebuffer && initial ? vk::ImageLayout::eTransferSrcOptimal : vk::ImageLayout::eShaderReadOnlyOptimal,
|
||||||
config::EmulateFramebuffer && last ? vk::ImageLayout::eTransferSrcOptimal : vk::ImageLayout::eShaderReadOnlyOptimal);
|
config::EmulateFramebuffer && last ? vk::ImageLayout::eTransferSrcOptimal : vk::ImageLayout::eShaderReadOnlyOptimal);
|
||||||
|
|
Loading…
Reference in New Issue