You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
o3de/Gems/Atom/RPI/Code/Source/RPI.Public
santorac c5cb90ddb7 Merge pull request #4426 from aws-lumberyard-dev/Atom/santorac/FixSceneSrgTime
Fixed potential render scene time precision issues.

The timestamp was simply converted from GetTimeAtCurrentTick to a float. Since this value is backed by QueryPerformanceCounter which is 0 at boot, you could see broken animations on the GPU when your system has been on for a long time. So I simplified the RPI's time API (removed unused code), and subtracted the application start time each frame before converting the time value to a float.

Also moved FindShaderInputConstantIndex("m_time") to be called only once, instead of every frame.

Testing:
Originally: I had a local material shader that did vertex animation and it wasn't working at all before, and now it works.
More recently, I made local changes to StandardPBR to add a simple sin wave animation. I also modified GetTimeNowMicroSecond() to artificially add 30 days to the clock. This showed choppy animation before my changes, and smooth animation after.
AtomSampleViewer passed dx12 and vulkan (other than pre-existing issues)

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
..
Buffer Fixes asserts related to buffer allocation using null rhi (#3367) 4 years ago
ColorManagement Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
DynamicDraw ATOM-16249 Adding draw srg caching to DynamicDrawContext since creating SRG can be expensive for some backend (#4491) 4 years ago
GpuQuery [development] Atom CPU profiler include cleanup (#4272) 4 years ago
Image [development] Atom CPU profiler include cleanup (#4272) 4 years ago
Material Shaders changes require two or more change cycles before updating (#5142) 4 years ago
Model Model Hot-Reloading (#4304) 4 years ago
Pass Shaders changes require two or more change cycles before updating (#5142) 4 years ago
Shader Shaders changes require two or more change cycles before updating (#5142) 4 years ago
AuxGeomFeatureProcessorInterface.cpp Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
Culling.cpp ATOM-16747 RPISystemInterface::GetDefaultScene returns the scene crea… (#5153) (#5389) 4 years ago
FeatureProcessor.cpp Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
FeatureProcessorFactory.cpp Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
MeshDrawPacket.cpp Remove extra/bad profile markers (#4031) 4 years ago
PipelineState.cpp Reenable support for UI Elements that use Render Targets (#2352) 4 years ago
RPISystem.cpp Merge pull request #4426 from aws-lumberyard-dev/Atom/santorac/FixSceneSrgTime 4 years ago
RPIUtils.cpp Create helper function for getting threads per (#4480) 4 years ago
RenderPipeline.cpp Merge pull request #4426 from aws-lumberyard-dev/Atom/santorac/FixSceneSrgTime 4 years ago
Scene.cpp Merge pull request #4426 from aws-lumberyard-dev/Atom/santorac/FixSceneSrgTime 4 years ago
View.cpp Revert "Refresh rate driven rendering tick logic (#3375)" 4 years ago
ViewportContext.cpp Revert "Refresh rate driven rendering tick logic (#3375)" 4 years ago
ViewportContextManager.cpp Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
WindowContext.cpp Support for refresh rate and sync interval (#2989) 4 years ago