Attempt to fix time precision issue in long game run

#3865
This commit is contained in:
2026-03-27 23:52:11 +01:00
parent 2b538e4864
commit 258ba233d5
2 changed files with 4 additions and 7 deletions
+1 -1
View File
@@ -253,7 +253,7 @@ public:
/// </summary>
FORCE_INLINE float GetTotalSeconds() const
{
return static_cast<float>(Ticks) / TicksPerSecond;
return (float)((double)Ticks / TicksPerSecond);
}
public:
@@ -50,13 +50,10 @@ IMaterial::BindParameters::BindParameters(::GPUContext* context, const ::RenderC
}
IMaterial::BindParameters::BindParameters(::GPUContext* context, const ::RenderContext& renderContext, const ::DrawCall& drawCall, bool instanced)
: GPUContext(context)
, RenderContext(renderContext)
, DrawCall(&drawCall)
, Time(Time::Draw.UnscaledTime.GetTotalSeconds())
, ScaledTime(Time::Draw.Time.GetTotalSeconds())
, Instanced(instanced)
: BindParameters(context, renderContext)
{
DrawCall = &drawCall;
Instanced = instanced;
}
GPUConstantBuffer* IMaterial::BindParameters::PerViewConstants = nullptr;