* Added a StealHandlers function to AZ Event
The StealHandlers function is able to take all the handlers from an AZ
Event parameter and register them with the current AZ Event
This allows stealing handlers from expiring AZ Events, which is useful
for a lock and swap algorithm for thread safety.
1. Lock persistent AZ::Event
2. Swap persistent AZ::Event with local AZ::Event
3. Unlock persistent AZ::Event - Other threads can now add to this
AZ::Event
4. Invoke handlers from local AZ::Event
5. Relock persistent AZ::Event
5. Swap local AZ::Event with persistent AZ::Event
6. Local AZ::Event now contains handlers that were added when the lock
was free
7. Persistent AZ::Event now steals from local AZ::Event
8. Unlock persistent AZ::Event
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
* Separated SettingRegistry update/query mutex from Notifier update mutex
The Settings Registry update/query mutex is also better scoped to reduce
the amount of lock time.
The Notifier mutex being separate allows the Settings Registry to signal
a notification event without being under any mutex, by locking and
swapping the notifier event with a local instance
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
* Renamed StealHandlers function to ClaimHandlers
Replaced decltype keywords in ClaimHandlers to auto
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
* Minimal TypeInfo header/reduce std interdependencies.
TypeInfoSimple.h is a small header that can replace the use of
TypeInfo.h in some cases.
Signed-off-by: Nemerle <nemerle5+git@gmail.com>
* Windows build fixed
Removed algorithm.h from string_view.h
smoke-test passed
Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>
* Resotore dynamic_pointer_cast in intrusive_ptr
Requested by reviewer.
Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>
* Fix CI build
string.h - missed alogorithm.h, since it was removed from string_view
NodeWrapper.h - missing smart_ptr.h
Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>
Co-authored-by: Nemerle <nemerle5+git@gmail.com>
* Converted the AZStd implementations of unintialized construct to use std
The uninitialized_default_construct and uninitialized_value_construct
functions implementations have been removed and the Standard library
implementations have been brought into the AZStd namespace scope
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
* Added a default construct to the UninitializedValueConstruct test case
which value initializes the int member which uses zero initialization to
initalize it to zero.
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
The drain function was used only before the API gained the ability to
wait on the completion of a graph. This is the correct way to "drain"
the task executor of work.
Signed-off-by: Jeremy Ong <jcong@amazon.com>
Also, came up with more useful benchmarks that actually measure the
enqueue/dequeue operations for various simple workflows. For retained
graphs, time-of-flight from submission to execution is ~1us per job,
indicating job granularity should be >20us for retained jobs. For
dynamic jobs, where we need to pay the cost of allocation, a granularity
of ~100+ us may be advised.
Signed-off-by: Jeremy Ong <jcong@amazon.com>
* Fixed bug in hash_table that made rehash() function to run infinitely on specific conditions when inserting an already existing element
Signed-off-by: Garcia Ruiz <aljanru@amazon.co.uk>
* Replaced erasing to happen in the source list instead
Signed-off-by: Garcia Ruiz <aljanru@amazon.co.uk>
* minor comment improvement
Signed-off-by: Garcia Ruiz <aljanru@amazon.co.uk>
* Small commment improvement
Signed-off-by: Garcia Ruiz <aljanru@amazon.co.uk>
* Small comment fix
Signed-off-by: Garcia Ruiz <aljanru@amazon.co.uk>
* Added assert and fixed code with incorrect hashing
Signed-off-by: Garcia Ruiz <aljanru@amazon.co.uk>
* .
Signed-off-by: Garcia Ruiz <aljanru@amazon.co.uk>
* Addressed PR comments, reverted to void* as it size_t hash is different
Signed-off-by: Garcia Ruiz <aljanru@amazon.co.uk>
* Fixed build on linux
Signed-off-by: Garcia Ruiz <aljanru@amazon.co.uk>
* Addressed PR comments
Signed-off-by: Garcia Ruiz <aljanru@amazon.co.uk>
Co-authored-by: Garcia Ruiz <aljanru@amazon.co.uk>
* Fixed the emplace function implementations for stack and queue
Cleaned up several functions in the stack, queue and priority_queue
classes that were non-standard or weren't needed.
Updated the "style" of the code to use more modern concepts: "typedef" ->
"using", empty constructor body -> default keyword.
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
* Replaced the custom implementations of AZStd stack, (proirity)queue
Theses classes now have a template alias to the standard library version
of the classes
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
* Add missing RTTI include to fix non-unity build error
* Add missing includes that were automatically added as part of unity builds
Signed-off-by: Steve Pham <spham@amazon.com>
* [GHI 2178] Fixed missing vegetation info
The entity debug drawing culling system was removing it due to the level entity not having an AABB. Since this component can draw infinitely far, it just needed a max AABB.
With the culling fixed, it made another culling problem evident - a bug in the font code where it wasn't culling 3D text rendered behind the camera. Now it is.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Fix problem with debug rendering not immediately showing up.
When using FloatMax for the AABB, it causes math overflows with the initial camera frustrum. Changing to max/2.0f is sufficient to avoid the overflows.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Fixed normals on mesh raycasts.
The normals needed to be normalized after transformation, and didn't need the non-uniform scale applied to them, since they're normals.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Fixed the bug that prevented max-size AABBs from working with ShapeIntersection::Overlap.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Fix compile error from -Wwritable-strings
Signed-off-by: Chris Burel <burelc@amazon.com>
* Fix flags used to build MaskedOcclusionCulling with clang
Signed-off-by: Chris Burel <burelc@amazon.com>
* Fix class that has a final destructor, but the class itself was not final
Signed-off-by: Chris Burel <burelc@amazon.com>
* 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>