Skip to content

Commit 0ff6eef

Browse files
MikhailGorobetsTheMostDiligent
authored andcommitted
PostFXContext: Add flag for temporal upsampling
1 parent 0e7eff0 commit 0ff6eef

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

PostProcess/Bloom/src/Bloom.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2024-2025 Diligent Graphics LLC
2+
* Copyright 2024-2026 Diligent Graphics LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -27,6 +27,7 @@
2727

2828
#include "Bloom.hpp"
2929
#include "CommonlyUsedStates.h"
30+
#include "PostFXContext.hpp"
3031
#include "RenderStateCache.hpp"
3132
#include "GraphicsUtilities.h"
3233
#include "MapHelper.hpp"
@@ -80,14 +81,17 @@ void Bloom::PrepareResources(IRenderDevice* pDevice, IDeviceContext* pDeviceCont
8081

8182
m_CurrentFrameIdx = FrameDesc.Index;
8283

83-
if (m_BackBufferWidth == FrameDesc.Width && m_BackBufferHeight == FrameDesc.Height && m_FeatureFlags == FeatureFlags)
84+
Uint32 Width = (pPostFXContext->GetFeatureFlags() & PostFXContext::FEATURE_FLAG_TEMPORAL_UPSCALING) ? FrameDesc.OutputWidth : FrameDesc.Width;
85+
Uint32 Height = (pPostFXContext->GetFeatureFlags() & PostFXContext::FEATURE_FLAG_TEMPORAL_UPSCALING) ? FrameDesc.OutputHeight : FrameDesc.Height;
86+
87+
if (m_BackBufferWidth == Width && m_BackBufferHeight == Height && m_FeatureFlags == FeatureFlags)
8488
return;
8589

8690
for (auto& Iter : m_RenderTech)
8791
Iter.second.SRB.Release();
8892

89-
m_BackBufferWidth = FrameDesc.Width;
90-
m_BackBufferHeight = FrameDesc.Height;
93+
m_BackBufferWidth = Width;
94+
m_BackBufferHeight = Height;
9195
m_FeatureFlags = FeatureFlags;
9296

9397
Uint32 HalfWidth = m_BackBufferWidth / 2u;

PostProcess/Common/interface/PostFXContext.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2024-2025 Diligent Graphics LLC
2+
* Copyright 2024-2026 Diligent Graphics LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -52,7 +52,8 @@ class PostFXContext
5252
{
5353
FEATURE_FLAG_NONE = 0u,
5454
FEATURE_FLAG_REVERSED_DEPTH = 1u << 0u,
55-
FEATURE_FLAG_HALF_PRECISION_DEPTH = 1u << 1u
55+
FEATURE_FLAG_HALF_PRECISION_DEPTH = 1u << 1u,
56+
FEATURE_FLAG_TEMPORAL_UPSCALING = 1u << 2u,
5657
};
5758

5859
struct FrameDesc

0 commit comments

Comments
 (0)