Commit Graph

34 Commits (5a39361f777a4aa8e217bf3a899d2a3bf12e70bb)

Author SHA1 Message Date
Qing Tao 5a39361f77
ATOM-16747 RPISystemInterface::GetDefaultScene returns the scene crea… (#5153) (#5389)
* ATOM-16747 RPISystemInterface::GetDefaultScene returns the scene created by PreviewRenderer but not the Main Scene
Deprecate GetDefaultScene() function.
Update all the places which use GetDefaultScene to use Scene::GetFeatureProcessorFromEntityId or GetMainScene.
Tested with Editor, UI Editor, Material Editor, game launcher.

Signed-off-by: Qing Tao <55564570+VickyAtAZ@users.noreply.github.com>
(cherry picked from commit 8da6bea073)
4 years ago
rgba16f [Amazon] e1c49e436d
convert atom to task graph (#4230)
* Intial attempt to convert the Atom/RHI/FrameScheduler to use the new TaskGraph api

Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com>

* Avoid enqueuing work on the active task thread if the submitted task
graph is waitable

When submitting a task graph, supplying a wait event implies that
dependent jobs must occur on threads that do not wait on the event (in
the absence of work stealing). This change prevents this by adding a
notion of a task thread enable/disable state, and prohibiting dependent
jobs from being enqueued on waiting threads.

Signed-off-by: Jeremy Ong <jcong@amazon.com>

* Convert RPI/Scene to use TaskGraph pass 1, Culling jobs remain on the old system

Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com>

* RemoveTask Graph changes from the FrameScheduler::ExecuteGroups, use old job system instead

Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com>

* Per review, removing commented out code

Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com>

* Cleanup debug code, & build fix

Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com>

* Add a cvar & interface to query whether to use jobs or task graph

Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com>

* Make TaskGraph assert if you try to wait inside a job

Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com>

* Fix TaskTest SpawnSubgraph to account for the new TaskGraphEvent assert on wait in a running task

Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com>

* 3 minor cleanups. 1) Events always store a ptr to their executor 2) Fix clang compile error 3) remove an early out.

Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com>

* Fix double group end that was causing assert/crash plus misc minor diff's with development

Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com>

* Fix deallocation failure on deactivation of the TaskGraphSystemComponent. Also make the system component account for multiple creation in Unit Tests.

Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com>

* Update with PR feedback
1) Rename UseTaskGraph to IsTaskGraphActive & update related code
2) prefer TaskExecutor::SetInstance
3) add comments and remove commented out code

Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com>

* Fix incorrect RTTI name for TaskGraphActiveInterface

Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com>

* Move TaskGraphSystemComponent CRC calculation to a shared variable

Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com>

Co-authored-by: Jeremy Ong <jcong@amazon.com>
4 years ago
SergeyAMZN 08e020f2b1
Merge pull request #4251 from aws-lumberyard-dev/nvsickle/RevertFrameTimer
Revert "Refresh rate driven rendering tick logic (#3375)"
4 years ago
Scott Romero 8cbc5bc447
[development] Atom CPU profiler include cleanup (#4272)
- Removed all unnecessary includes to Atom CpuProfiler.h
 - Added includes to AzCore Profiler.h where necessary

Signed-off-by: AMZN-ScottR 24445312+AMZN-ScottR@users.noreply.github.com
4 years ago
nvsickle bcfe3d3878 Revert "Refresh rate driven rendering tick logic (#3375)"
This reverts commit db63dcbcd9.

Signed-off-by: nvsickle <nvsickle@amazon.com>
4 years ago
Scott Romero 36bcf5849a
[development] Migrated Atom CPU profiler to utilize new AzCore Profiler interface and related macros (#4160)
- Added new interface type AZ::Debug::Profiler to externally register profiler systems
 - Modified the Atom CPU profiler to register as an AzCore profiler
 -- This allows full engine markers to be visualized in the associated ImGui tool
 - Converted all AZ_ATOM_PROFILE_* macros to use AZ_PROFILE_* macros instead

Signed-off-by: AMZN-ScottR 24445312+AMZN-ScottR@users.noreply.github.com
4 years ago
Nicholas Van Sickle db63dcbcd9
Refresh rate driven rendering tick logic (#3375)
* Implement sync interval and refresh rate API for RenderViewportWidget

Signed-off-by: nvsickle <nvsickle@amazon.com>

* Measure actual frame timings in the viewport info overlay.

Takes the median of the sum of (frame end - frame begin) to provide more a more representative view of when frames begin and end.

Note: Until VSync is internally supported by the event loop, this will produce nearly identical frame timings as the frame will spend as much time as needed synchronously waiting on a vblank.

Signed-off-by: nvsickle <nvsickle@amazon.com>

* Make frame timing per-pipeline, wire up refresh rate info to ViewportContext

Signed-off-by: nvsickle <nvsickle@amazon.com>

* POC: Frame limit pipeline rendering

Signed-off-by: nvsickle <nvsickle@amazon.com>

* Switch Editor tick to every 0ms to allow better tick accumulation behavior

Signed-off-by: nvsickle <nvsickle@amazon.com>

* Move RPISystemComponent to the tick bus, remove tick accumulation logic

Signed-off-by: nvsickle <nvsickle@amazon.com>

* Add `AddToRenderTickAtInterval` to RenderPipeline API

This allows a pipeline to update at a set cadence, instead of rendering every frame or being directly told when to tick.

Signed-off-by: nvsickle <nvsickle@amazon.com>

* Make ViewportContext enforce a target framerate

-Adds GetFpsLimit/SetFpsLimit for actively limiting FPS
-Calculates a render tick interval based on vsync and the vps limit and updates the current pipeline

Signed-off-by: nvsickle <nvsickle@amazon.com>

* Add r_fps_limit and ed_inactive_viewport_fps_limit cvars

Signed-off-by: nvsickle <nvsickle@amazon.com>

* Quick null check from a crash I bumped into

Signed-off-by: nvsickle <nvsickle@amazon.com>

* Fix off-by-one on FPS calculation (shouldn't include the not-yet-rendered frame)

Signed-off-by: nvsickle <nvsickle@amazon.com>

* Clarify frame time begin initialization

Signed-off-by: nvsickle <nvsickle@amazon.com>

* Fix TrackView export.

Signed-off-by: nvsickle <nvsickle@amazon.com>

* Address some reviewer feedback, revert RPISystem API change, fix CPU profiler.

Signed-off-by: nvsickle <nvsickle@amazon.com>

* Add g_simulation_tick_rate

Signed-off-by: nvsickle <nvsickle@amazon.com>

* Address review feedback, make frame limit updates event driven

Signed-off-by: nvsickle <nvsickle@amazon.com>

* Remove timestamp update from ComponentApplication::Tick

Signed-off-by: nvsickle <nvsickle@amazon.com>
4 years ago
Qing Tao d9cbc97ec0
ATOM-16063 Remove SetShaderResourceGroupCallback in scene and update scene srg handling (#3969)
ATOM-16273 Compiling SceneSRG before updating it can cause a gpu crash

Changes include:
1. Removed Scene::SetShaderResourceGroupCallback() function and clean up code which use this function.
2. Moved SceneTimeSrg.azsli to RPI's DefaultSceneSrg folder and setup the constants in RPI::Scene
3. Add AZ::Event for Scene's update srg event which features and update scene srg at proper place
4. UpdateTransformServcie FP to use PrepareSceneSrg event handler.
5. Clean up shaders and srgs used in project templates.

Signed-off-by: Qing Tao <qingtao@amazon.com>
4 years ago
Jeremy Ong 5e04c3737f Add preliminary budget tracking system and remove driller integration
Signed-off-by: Jeremy Ong <jcong@amazon.com>
4 years ago
Jeremy Ong 07a14bdce1 Add AZ_BUDGET_DEFINE/AZ_BUDGET_DECLARE and remove driller
NOTE: The memory driller is still intact for now to avoid needing to
modify allocators, but the frame/cpu portions of driller and the
standalone executable are now gone.

Signed-off-by: Jeremy Ong <jcong@amazon.com>
4 years ago
Jeremy Ong a5f072f7a9 Remove statistics profiler
Signed-off-by: Jeremy Ong <jcong@amazon.com>
4 years ago
Jeremy Ong df9b4d4a2f Deprecate profiler categories based on global enum
(to be supplanted by registered budgets in the future)

Signed-off-by: Jeremy Ong <jcong@amazon.com>
4 years ago
Esteban Papp b33a4db332 Merge branch 'development' into cmake/SPEC-2513_w4267 4 years ago
Jacob Hilliard 4d618ea619 Profiling: Add more instrumentation
Adds new instrumentation macros throughout the codebase, using the
visualizer to find where current instrumentation is lacking using the
shadowed sponza sample + editor. Some notes from exploring:

- We spend ~5ms in CullingScene: BeginCulling
- PipelineStateCache: Compact usually 1ms
- CompileImageBarriers takes most of the time in CompileResourceBarriers

Signed-off-by: Jacob Hilliard <jhlliar@amazon.com>
4 years ago
pappeste 97f9ac870d Atom
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
4 years ago
Steve Pham 38261d0800
Shorten copyright headers by splitting into 2 lines (#2213)
* Updated all copyright headers to split the longer original copyright line into 2 shorter lines

Signed-off-by: Steve Pham <spham@amazon.com>
4 years ago
Chris Galvan d7574777a8 Resolved merge conflicts
Signed-off-by: Chris Galvan <chgalvan@amazon.com>
5 years ago
Steve Pham b4a2edec6a
Final update copyright headers to reference license files at the repo root (#1693)
* Final update copyright headers to reference license files at the repo root

Signed-off-by: spham <spham@amazon.com>

* Fix copyright validator unit tests to support the stale O3DE header scenario

Signed-off-by: spham <spham@amazon.com>
5 years ago
Gene Walters 4e14c0069b Merge branch 'upstream/stabilization/2106' into genewalt/gitflow_210628 5 years ago
Steve Pham 70042fcdcd
O3DE Copyright Updates for Linux Foundation (#1504) 5 years ago
Doug McDiarmid e769219bac Merge branch 'development' into Atom/dmcdiar/ATOM-5702
# Conflicts:
#	Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader.cpp
#	Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderAsset.cpp
5 years ago
Doug McDiarmid dc1d34c83f NoMSAA supervariant support
Added a ShaderSystem supervariant to provide a system-wide supervariant name.
Changed ShaderAsset to append the system-wide supervariant name when searching for supervariants.
Added the NoMSAA supervariant to several shaders.
5 years ago
nvsickle e55580af57 Merge remote-tracking branch 'upstream/stabilization/2106' into nvsickle/MergeStabilizationJun18 5 years ago
Qing Tao aa2c27b22d
ATOM-15780 Improve cpu profiler allows pause and output profiling data to a file for reference (#1358)
- Added a pause button in imgui cpu profiler.
- Added a capture button to save cpu profiling data to a data file.
- Added some profile marks in both RPI and RHI.
5 years ago
galibzon cc615a8f32
[ATOM-15472] Shader Build Pipeline: Remove Deprecated Files And Funct… (#1079)
* [ATOM-15472] Shader Build Pipeline: Remove Deprecated Files And Functions That
Predate The Shader Supervariants

These are the essential impactful changes as a result of deprecating the
ShaderResourceGroupAsset.

* Addressed feedback by @moudgils. Better comments in header files.

* More updates related with deprecation of ShaderResourceGroupAsset

* Deleted the temporary version 2 classes.

* Updated version of the shader asset builders.

* Updated version of all the shader related classes impacted
by the Supervariant concept and deprecation of ShaderResourceGroupAsset

* Changes to *.pass and DGI, Reflections and RayTracing.

* changes to material related assets

* changes to core lights

* Changes to auxgeom/dynamic draw.

* changes to decals, lyshine, imguipass

* changes to RPI Pass classes

* Shader for SceneSrg, ViewSrg and ForwardPass Srgs.

* changes to mesh, skinned mesh, Morphtarget.

* Fixes to RayTracingPass.cpp & now allow empty srg in shaders.

* Updated Atom_RPI.Tests

* Simplified InstanceDatabase by removing AddHandler

------------------------------------------------------------------------------------
* Updated DiffuseGI precompiled shaders.
Added RayTracingSceneSrg and RayTracingMaterialSrg shader asset.
Updated ShaderAssetCreator::Clone to handle the supervariant when processing root variants.
Co-authored-by: Doug McDiarmid <dmcdiar@amazon.com>
------------------------------------------------------------------------------------

* Changed semantics for some PassSrg to SRG_PerPass_WithFallback.

AuxGeom/FixedShapeProcessor.cpp requires SRG_PerDraw on ObjectSrg.

Removed names of SceneSrg and ViewSrg from RPISystemDescriptor.cpp

* Moved ShaderLib/Atom/Features/DummyEntryFunctions.azsli
To  Gems/Atom/RPI/Assets/ShaderLib/Atom/RPI/DummyEntryFunctions.azsli

Removed redundant checking for finalization in
ShaderResourceGroupLayout.cpp

* Fixed race condition bug for Shader::FindOrCreate.
InstanceDatabase<>::CreateInstance() needs to be atomic
for instance creation and initialization.

Added optional InstanceHandler::CreateFunctionWithParams to accomodate
to the needs of Instances that need more than an asset reference
to be able to be created an initialzed.

Removed ShaderResourceGroup::FindOrCreate() only ::Create is available
now.

* Renamed scene_and_view_srgs.* as SceneAndViewSrgs.*

Changed GetAzslFileOfOrigin for GetUniqueId

* Fixed unit tests.

* Reverted the serialization name of m_uniqueId back to
"m_azslFileOfOrigin" so precompiled shaders don't fail
in layout comparison.

* Fixed AtomCore.Tests
Removed non-applicable test. InstanceDatabase.AddHandler() is not
available anymore.

* The Null rhi is re-enabled for shader compilation.

Signed-off-by: garrieta <garrieta@amazon.com>
5 years ago
antonmic 2a40010089 Pass changes: fixed reflection probe bake 5 years ago
antonmic c996b34835 Pass changes WIP: small optimization 5 years ago
Vicky 1c575763c7
ATOM-4661 Improvement with pass templates registration from data (#735)
* ATOM-4661 Improvement with pass templates registration from data
- Update PassLibrary so it can load pass templates from more than one files and report duplicate pass templates.
- Added load templates events to pass system so the handlers from any gems can load their own pass templates.
- Added PassSystemInterface::OnReadyLoadTemplatesEvent::Handler in FeatureCommon gem's CommonSystemeComponet to load the PassTemplates.azasset in featureCommon gem.
- Misc: moved BindlessPrototypeSrg.asli from RPI to ASV project; fixed an assert issue when exit ASV
5 years ago
AMZN-koppersr 5e4094b258
Revamped AzFramework::Scene (#332)
Updated AzFramework::Scene to allow it to serve as the one-stop location for localized singletons. Localized singletons in this case are instance that can only occur once in an environment but multiple times within an application. As an example, this allows settings up a single camera per viewport for instance.

Highlights of changes:

Replaced the original ebuses with interfaces and events for easy of use and performance.
Removed the Entity Context specific code and moved that to new locations within the Entity Context itself.
Allowed basic inheritance. If a subsystem isn't found in a scene the parent can optionally be searched.
Scenes can enter a zombie state and avoid immediately being deleted. This is needed for situations where subsystems can't be destroyed until async calls have been completed.
5 years ago
qingtao 60db6b55d0 Address feedback of PR for ATOM-6088.
* Rename DrawItemKeyPair to DrawItemProperties.
* Switch back to use Ptr<DrawListTagRegistry> instead of DrawListTagRegistry
* Updated some comment.
5 years ago
qingtao 12f528d744 ATOM-6088 Unified approach to send draws to a single viewport
- Created a template class TagRegistery which implements the previous DrawListTagRegistry. The template is used for both DrawListTagRegistry and DrawFilterTagRegistry
- Added DrawFilterTag to DrawItemKeyPair
- Added DrawFilterMask support in DrawPacket and DrawPacketBuilder
- Added CreateDynamicContext for render pipeline which allows draw to selected render pipeline.
- Updated RasterPass's BuildCommandListInternal function to filter draw items for its owner RenderPipeline.
- Updated RHI unit tests.
5 years ago
alexpete 8469c9ca0a Integrating github/staging through commit 5f214be 5 years ago
alexpete 75dc720198 Integrating latest 47acbe8 5 years ago
alexpete a10351f38d Initial commit 5 years ago