File tree 4 files changed +8
-4
lines changed
4 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -167,7 +167,7 @@ namespace nrd
167
167
uint32_t rectOrigin[2 ] = {};
168
168
169
169
// A consecutively growing number. Valid usage:
170
- // - must be incremented by 1 each frame
170
+ // - must be incremented by 1 on each frame (not by 1 on each "SetCommonSettings" call)
171
171
// - sequence can be restarted after passing "AccumulationMode != CONTINUE"
172
172
// - must be in sync with "CheckerboardMode" (if not OFF)
173
173
uint32_t frameIndex = 0 ;
Original file line number Diff line number Diff line change @@ -148,6 +148,7 @@ class Integration
148
148
uint32_t m_ConstantBufferOffset = 0 ;
149
149
uint32_t m_DescriptorPoolIndex = 0 ;
150
150
uint32_t m_FrameIndex = uint32_t (-1 ); // 0 needed after 1st "NewFrame"
151
+ uint32_t m_PrevFrameIndexFromSettings = 0 ;
151
152
uint8_t m_BufferedFramesNum = 0 ;
152
153
char m_Name[32 ] = {};
153
154
bool m_ReloadShaders = false ;
Original file line number Diff line number Diff line change @@ -478,6 +478,7 @@ void Integration::NewFrame()
478
478
}
479
479
480
480
m_FrameIndex++;
481
+ m_PrevFrameIndexFromSettings++;
481
482
}
482
483
483
484
bool Integration::SetCommonSettings (const CommonSettings& commonSettings)
@@ -487,6 +488,11 @@ bool Integration::SetCommonSettings(const CommonSettings& commonSettings)
487
488
Result result = nrd::SetCommonSettings (*m_Instance, commonSettings);
488
489
NRD_INTEGRATION_ASSERT (result == Result::SUCCESS, " SetCommonSettings(): failed!" );
489
490
491
+ if (m_FrameIndex == 0 || commonSettings.accumulationMode != AccumulationMode::CONTINUE)
492
+ m_PrevFrameIndexFromSettings = commonSettings.frameIndex ;
493
+ else
494
+ NRD_INTEGRATION_ASSERT (m_PrevFrameIndexFromSettings == commonSettings.frameIndex , " 'frameIndex' must be incremented by 1 on each frame" );
495
+
490
496
return result == Result::SUCCESS;
491
497
}
492
498
Original file line number Diff line number Diff line change @@ -302,9 +302,6 @@ nrd::Result nrd::InstanceImpl::SetCommonSettings(const CommonSettings& commonSet
302
302
isValid &= commonSettings.disocclusionThresholdAlternate > 0 .0f ;
303
303
assert (" 'disocclusionThresholdAlternate' must be > 0" && isValid);
304
304
305
- isValid &= commonSettings.accumulationMode != AccumulationMode::CONTINUE || commonSettings.frameIndex == m_CommonSettings.frameIndex + 1 || m_IsFirstUse;
306
- assert (" 'frameIndex' must be a consecutively growing number" && isValid);
307
-
308
305
isValid &= commonSettings.strandMaterialID != 0 .0f || GetLibraryDesc ().normalEncoding == NormalEncoding::R10_G10_B10_A2_UNORM;
309
306
assert (" 'strandMaterialID' can't be 0 if material ID is not supported by encoding" && isValid);
310
307
You can’t perform that action at this time.
0 commit comments