diff --git a/Source/Engine/Core/Types/TimeSpan.h b/Source/Engine/Core/Types/TimeSpan.h index 7704007a5..7455b7582 100644 --- a/Source/Engine/Core/Types/TimeSpan.h +++ b/Source/Engine/Core/Types/TimeSpan.h @@ -253,7 +253,7 @@ public: /// FORCE_INLINE float GetTotalSeconds() const { - return static_cast(Ticks) / TicksPerSecond; + return (float)((double)Ticks / TicksPerSecond); } public: diff --git a/Source/Engine/Graphics/Materials/MaterialShader.cpp b/Source/Engine/Graphics/Materials/MaterialShader.cpp index 5d929320d..3e26d954f 100644 --- a/Source/Engine/Graphics/Materials/MaterialShader.cpp +++ b/Source/Engine/Graphics/Materials/MaterialShader.cpp @@ -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;