* Up the hard coded size for the HpAllocator buffer to 18KiB
Added a static assert in the HphaSchema.cpp file to validate that the
HpAllocator aligned storage buffer is at least the size of the
HpAllocator class.
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
* Removed comment blocks with username from HphaSchema.h
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
CMake has a built-in property, `POSITION_INDEPENDENT_CODE`, that determines
if code will be built with `-fPIC`. This property is `True` by default for
`SHARED` and `MODULE` library targets and `False` otherwise. Previously,
we were always passing the `-fPIC` flag manually. With this change, we set
the appropriate CMake variable that will enable the property for all
compile jobs.
Furthermore, with CMake policy CMP0083 set to "new" (which happens by
default when the `cmake_minimum_required` version is >=3.14), CMake has
built-in support for passing the `-fpie` flag when building executables. It
uses the same property, `POSITION_INDEPENDENT_CODE`, so setting this
property (and enabling it with the CMake `CheckPIESupported` module) allows
us to use CMake's built-in support for these flags.
Signed-off-by: Chris Burel <burelc@amazon.com>
* MacOS build fix
Updated the HpAllocator::bucket to align upwards to the nearest power of
2.
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
* Adding static assets to validate teh AlignUpToPowerOfTwo function.
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
* Add comparison operators to SurfaceTagWeight.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Changed AddSurfaceTagWeight to always combine weights.
This simplifies the API a bit and defines the behavior if someone ever tries to add a duplicate tag.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Added benchmarks for measuring the performance-critical APIs.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Changed SurfaceTagWeights to a fixed_vector.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Add inPosition to AddSurfacePoint.
This will be used to detect which input the surface point is associated with.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Add inPositionIndex to the appropriate APIs.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Switched Gradient Surface benchmarks to use actual surface components.
The gradient unit tests and benchmarks were previously using a mock surface data system, which led to misleading benchmark results. Now, the actual SurfaceData system gets constructed, and the tests use a mock provider, but the benchmarks use actual shape providers for more realistic benchmarking.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Fixed unit tests to have better query ranges.
Half of each previous range was querying outside the surface provider's data.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* First attempt at removing SurfacePointLists.
This currently runs significantly slower than the previous code but passes the unit tests.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Another attempt at optimization.
This one runs faster than the previous, but still slow.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Fix the cmake dependency so that the gradient tests rebuild SurfaceData.dll when run.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Switch SurfaceAltitudeGradient over to the new bulk API.
Also, optimized the non-bulk API by having it reuse the SurfacePointList to avoid the repeated allocation / deallocation cost.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Switched to using an indirect index so that all allocations are consecutive in our reserved buffer.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Switched back to SurfaceTagWeight again.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Added runtime dependency to LmbrCentral for unit tests.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Switched code over to use the full EnumeratePoints in most cases.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Added knowledge of max surface point creation into the system.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Add generic GetSurfacePointsFromList API implementation for surface providers.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Fixed implementation to use the correct maximum number of input points based on the surface providers being queried.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Fix out-of-bounds references on empty lists.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Fix memory allocation that caused benchmark runs to crash.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Starting to clean up the API.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Move SurfacePointList into separate files for easier maintainability.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Fixed bug where too many points were filtered out due to using the position Z as a part of the AABB check.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Made FilterPoints an internal part of SurfacePointList so we can choose when and how to perform the filtering.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Final cleanup / comments.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Added includes for non-unity builds.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Changed how unit tests initialize the mock lists to try and fix the linux errors.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Fixed compile error.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
Previously, with no level loaded in the main editor, and no assets loaded
in the EMotionFX editor, the AnimGraph viewport would only update at 15fps,
even on a 64 core machine.
Digging into this with Pix, I found that EMotionFX's UI would only get
updated for every other call to the ComponentApplication tick.
The Editor's QApplication instance controls how the
`ComponentApplication::OnTick` method is called. This is done in the
`maybeProcessIdle()` method. Generally, I found callstacks like this:
```
EditorQtApplication::maybeProcessIdle()
CCryEditApp::OnIdle()
CCryEditApp::IdleProcessing()
CGameEngine::Update() # ~2.2ms
PhysX::Update() # ~1.8ms
EMotionFX::Update() # ~0.2ms
calls QWidget::update() on all the widgets that change per
frame, only puts update events on the event queue, doesn't
paint anything
AZ::ComponentApplication::TickSystem() # ~25ms
renders the frame with Atom # ~24ms
```
The `maybeProcessIdle()` method is invoked by a QTimer, with a timeout
that changes depending on the application state. If the Editor is in
game mode, it used a timeout of 0, which essentially forced the game to
run at as high an fps as possible. If the Editor application has focus,
it used a timeout of 1ms, asking for the idle processing to happen at
1000 fps. Otherwise, it used a timeout of 10ms, asking for idle
processing at 100 fps.
Those fps targets are not realistic. What happened in this case is that
while the PhysX system was being updated, while the previous
`maybeProcessIdle()` call was still processing, the idle processing
timer would timeout again, and place a timer event on Qt's event queue,
before anything else had a chance to do anything. Only afterward would
EMotionFX's MainWindow::OnTick would be invoked, placing paint events on
Qt's event queue.
The fix for this is to use a single shot timer at the end of each
`maybeProcessIdle()` call. This ensures that any events that are
enqueued during the `maybeProcessIdle()` call are processed prior to the
next call to `maybeProcessIdle()`.
Signed-off-by: Chris Burel <burelc@amazon.com>
* Fixes the problem with using actor render flags in actor component
Signed-off-by: rhhong <rhhong@amazon.com>
* In progress work for actor render flag rework
Signed-off-by: rhhong <rhhong@amazon.com>
* add an utlity function to check bit
Signed-off-by: rhhong <rhhong@amazon.com>
* code cleanup
Signed-off-by: rhhong <rhhong@amazon.com>
* More CR cleanup
Signed-off-by: rhhong <rhhong@amazon.com>
* build fix
Signed-off-by: rhhong <rhhong@amazon.com>
* CR feedback
Signed-off-by: rhhong <rhhong@amazon.com>
* Prototype - refactor the selection system for the Outliner (WIP)
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* WIP - unify custom drag, still trying to find a way to make it so that the selection isn't affected by drag/drop of unselected entity
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Wrap up changes
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Minor refactor - move from enum to bool
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Prevent clicks on the spacing column from selecting the entity; better refresh the hover state.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Fix weird flicker introduced by latest commit
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Change color for the drag select rectangle.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Add more thorough comments, and also make some helper variables const.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Fixed incorrect variable types (Qt uses ints for on-screen dimensions)
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
Fixed crash in Allocators Benchmark multithreaded test due to the HPHA schema not having proper multithread protection around the `mFreeTree` member in `tree_get_unused_memory` function.
The `mFreeTree intrusive set is able to modified on multiple threads.
Replaced the custom intrusive_list implementation n HPHA schema with AZStd::intrusive_list
Added a `ScopedAllocatorBenchmarkEnvironment` class to provide an RAI mechanism for initializing the SystemAllocator in Benchmark Test
Rermoved the `AzCoreBenchmarkEnvironment` in lieu of the `ScopedAllocatorBenchmarkEnvironment` class
Fixed assert when running Allocator Benchmarks in debug due to mismatch PauseTiming/ResumeTiming in Allocator Benchmark Fixtures
Added `ScopedRegisterBenchmarkEnvironment` RAII class to provide lifetime guarantees on BenchmarkEnvironments registered via the `AZ_UNIT_TEST_HOOK`
Initialized the intrusive_multiset_node members to nullptr in all build configurations instead of only debug as the cost negligible and it is useful for debugging.
fixes LYN-10210
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
* 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>
Standardizing how document classes are implemented between atom tools.
Moved several functions that were added to allow shader variant lists to be built from a Python script into the tools document class.
Reimplemented the portion of the script that generated a shader variant list from a shader asset into the document class. Opening a shader management console document from a shader asset will automatically generate this shader variant list data inside the document. Description now just opens and saves the documents to a new location.
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
These viewport controls will be shared with material canvas and other tools that share a similar environment and viewport configurations.
These classes are currently duplicated between the material editor and prototype projects.
This change generalizes some things that are specific to the material editor and moves the system to a common location.
Event buses were removed and replaced with a normal interface.
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
* beginning updates to surface manipulator intersect
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* initial changes to support surface manipulator being able to ignore custom entity ids
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* updates to use type aliases
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* add test for self-intersection test for SurfaceManipulator when holding Ctrl
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
This work has been on hold for a while. Revisiting removal of thumbnail contexts now while debugging related lockups exiting tools from script. Thumbnail contexts are an unused layer of indirection that makes debugging the system more difficult. All systems were only referencing the default context.
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
* Added tests in python to ensure interfaces used by PM exist and have the expected signature
Signed-off-by: nggieber <52797929+AMZN-nggieber@users.noreply.github.com>
* Fix crash if there is python error but no redirected output from python
Signed-off-by: nggieber <52797929+AMZN-nggieber@users.noreply.github.com>
* Add new line to end of tests file
Signed-off-by: nggieber <52797929+AMZN-nggieber@users.noreply.github.com>
* Initialize python bindings error count variable in if statement
Signed-off-by: nggieber <52797929+AMZN-nggieber@users.noreply.github.com>
* Call len() instead of __len__
Signed-off-by: nggieber <52797929+AMZN-nggieber@users.noreply.github.com>
* enable disabled repo tests
Signed-off-by: nggieber <52797929+AMZN-nggieber@users.noreply.github.com>
The benchmark builds weren't building the dependent DLLs due to missing dependencies in the cmake files.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
The version of Lua has updated - script canvas needs to rebuild
all of the scriptcanvas files with the new lua version.
This adds the lua version into the fingerprint of all scriptcanvas jobs
which will cause them to rebuild next time you start Asset Processor.
Signed-off-by: lawsonamzn <70027408+lawsonamzn@users.noreply.github.com>
The _FORTIFY_SOURCE option must be used with the -O optimization flag.
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
* Don't show ${Name} gems and fix template names
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
* Fix overlay size so it doesn't overlap parent border
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
* Hide warning when building
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
* Fix gem download fail due to param type change
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
* Restore missing functionionality for gem repos
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
* Use the parent's width for the gem inspector
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
* Restore regressed code for gem repos and folders
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
* Revert home folder override
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>