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/Code/Framework/AzFramework/Tests
bosnichd d0e5f9d20b
Added Async APIs for the various Process*FromList/Region terrain functions. (#7480)
* Added Async APIs for the various Process*FromList terrain functions.

Please note that we are currently defaulting the number of worker threads to one, because splitting the work over multiple threads causes contention when locking various mutexes, resulting in slower overall wall time for async requests split over multiple threads vs one where all the work is done on a single thread. The latter is still preferable over a regular synchronous call because it is just as quick and prevents the main thread from blocking. This should be changed once the mutex contention issues have been addressed, so that async calls automatically split the work between available job manager worker threads, unless the ProcessAsyncParams specify a different desired number of jobs.

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

* Fix Linux builds by adding missing #include

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

* Added a test for cancellation of terrain async requests, and fix it so that it works.

Note that the benchmarks show this implementation to be slightly slower than the previous one, which I presume is because we're now calling a 'perSurfacePointFunction' in the inner loop; this can probably be addressed, but will result in a lot of code duplication, and I think efforts will be better spent on removing the mutex contention to enable running multiple terrain async jobs at the same time.

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

* Added Async versions for all Process*Region terrain API functions, along with benchmarks.

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

* Fix the newly added terrain async request benchmarks to actually use the async APIs.

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

* Revert to the original version which just calls the synchronous API from the job function, along with some other updates in response to review feedback.

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

* Change the TerrainWorldDebugger to use the async API, along with the following changes:
- TerrainJobContext no longer uses a JobCancelGroup so we can guarantee the completion callbacks of associated jobs will be invoked even if it is cancelled.
- As a result of the above change, the ProcessAsyncCompleteCallback function signature again accepts the associated TerrainJobContext as a param.
- The TerrainProcessAsyncCancellation test has been resurrected and simplified by using binary semaphores instead of condition variables.
- All the async related TerrainSystemBenchmark functions have been simplified by using binary semaphores instead of condition variables.
- Global cancellation of all terrain jobs on deactivation of the TerrainSystem has been reintroduced, but in a different way than before.
- Other miscellaneous changes/fixes made while testing and based on earlier PR feedback.

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

* Updates based on review feedback:
- Go back to using a vector instead of an array (fixed the original problem by adding custom copy/assignment constructors/operators to the WireframeSector struct).
- When calling WireframeSector::Reset, block until any associated in flight has completed.
- Added the concept of a minimum number of positions per terrain job.

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

* Use semaphore instead of binary_semaphore in a bunch of places to account for the race condition where a completion callback fires before we started waiting for it.

Signed-off-by: bosnichd <bosnichd@amazon.com>
4 years ago
..
Mocks Added Async APIs for the various Process*FromList/Region terrain functions. (#7480) 4 years ago
Platform Removes some leftover log 4 years ago
Spawnable Minor updates to the Spawnable Entity Aliases in response to PR feedback. 4 years ago
Utils Fixes for viewport selection issues (#5494) 4 years ago
Application.cpp Update the FileIO Aliases (#4186) 4 years ago
ArchiveCompressionTests.cpp Update how Project Filepaths are calculated when not supplied via command line (#5194) 4 years ago
ArchiveTests.cpp Add support for configuring default Archive File Search Mode through a Cache Var (#5668) 4 years ago
AssetCatalog.cpp [development] fixed ambiguous 'byte' type MSVC build error (#7184) 4 years ago
AssetProcessorConnection.cpp Remove unused traits that disabled certain failed unit tests 4 years ago
BehaviorEntityTests.cpp Modernization + AZStd::function compare fix. (#3680) 4 years ago
BinToTextEncode.cpp Fixes test in AzFramework 4 years ago
CameraInputTests.cpp Fixes for `CameraInput` handling (#6425) 4 years ago
CameraState.cpp Clang 13: Fix build errors ... 4 years ago
ClickDetectorTests.cpp Improvement for click detection when clicking quickly between mouse moves (#5786) 4 years ago
CursorStateTests.cpp Fixes for viewport selection issues (#5494) 4 years ago
EntityContext.cpp Removes m_enableDrilling 4 years ago
FileIO.cpp Update the FileIO Aliases (#4186) 4 years ago
FileTagTests.cpp Removes m_enableDrilling 4 years ago
FrameworkApplicationFixture.h Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
GenAppDescriptors.cpp Update the FileIO Aliases (#4186) 4 years ago
InputTests.cpp Removed trait AZ_TRAIT_DISABLE_FAILED_INPUT_TESTS 4 years ago
Main.cpp Add a unit test for `XcbInputDeviceKeyboard` (#4393) 4 years ago
NativeWindow.cpp Modernization + AZStd::function compare fix. (#3680) 4 years ago
OctreePerformanceTests.cpp fixes AzFramework 4 years ago
OctreeTests.cpp Code/Framework compiling 4 years ago
PlatformHelper.cpp Add linux equivalents for all the places that enumerate platforms (#3325) 4 years ago
ProcessLaunchMain.cpp Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
ProcessLaunchParseTests.cpp Remove AZ_TRAIT_DISABLE_FAILED_PROCESS_LAUNCHER_TESTS and disabled tests from it (#7325) 4 years ago
Scene.cpp Removes m_enableDrilling 4 years ago
framework_shared_tests_files.cmake Fixes for viewport selection issues (#5494) 4 years ago
frameworktests_files.cmake Added unit tests for spawnable entity aliases. 4 years ago
process_launch_test_files.cmake Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
terrain_mock_files.cmake Moved TerrainDataRquestBus to AzFrameworkTestShared (#5835) 4 years ago