* Updated the GameApplication to mount the engine.pak
This allows loading the autoexec.cfg and bootstrap.game.<config>.<platform>.setreg from the engine.pak files
The engine.pak is searched for in the following order: <ExecutableDirectory>/engine.pak, followed by <ProjectCacheRoot>/engine.pak
Removed a lot of unused APIs from the AZ::IO::Archive feature suite
Updated many of the AZ::IO::Archive classes to use AZ::IO::Path internally.
The logic to search for files within an Archive has been updated to use AZ::IO::Path and to remove case-insensitve string comparisons
Somehow removed the CryFile dependency on anything Cry
Updated the Settings Registry to support reading from the FileIOBase and therefore Archive files in the GameLauncher via the `SetUseFileIO` function
Removed AzFramework Dependency on md5 3rdParty library
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
* Linux build fix
Added an include of <stdio.h> before the <rapidxml/rapidxml.h> include as it usesnprintf.
Added `static` to the constexpr constants in ExtractFileDescription in SettingsRegistryImpl.cpp to fix clang compile issue
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
* Updated the case used to mount the Engine PAK file in the GameApplication to be Engine.pak to match the other locations where it is mounted
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
* Updated the proper FFont call to FileIOBase::Size to supply the correct
integer type of AZ::u64 instead of size_t
This fixes building on platforms where size_t is type defined to be
unsigned long
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
* Fixed segmentation fault in Archive::Unregister when outputing the filename of the Archive file being closed
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
* Fix calls to OpenPack in the Legacy LevelSystem
The LevelSystem was calling the incorrect overload of OpenPack that
accepts BindRoot for the mounted level.pak instead of the overload that
that passes a memory block object.
This was causing the level pak files to be mounted using an invalid
directory, causing file accesses inside the level pak to fail.
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
* Updated the error messages in the ZipDir CacheFactory class to use AZ_Warning directly
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
* Updated the ArchiveFileIO m_trackedFiles container to store mapped type as an AZ::IO::Path
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
* Marking DistanceBetweenFilter tests with xfail due to Editor deadlock
Signed-off-by: jckand-amzn <jckand@amazon.com>
* Updating xfail mark
Signed-off-by: jckand-amzn <jckand@amazon.com>
Wrong invalid index type caused the crash. Selecting another joint was broken as well and got fixed directly, too. The selection done event was never received due to not being connected to the node hierarchy widget.
Resolves#4108
Signed-off-by: Benjamin Jillich <jillich@amazon.com>
* expose sticky select option to the SettingsRegistry
Signed-off-by: hultonha <hultonha@amazon.co.uk>
* update missed callsites after API change to Manipulator Test Framework
Signed-off-by: hultonha <hultonha@amazon.co.uk>
* updates following review feedback
Signed-off-by: hultonha <hultonha@amazon.co.uk>
* [ATOM][RHI][Vulkan] Make sure to set super-variant for non-MSAA pipeline. Separate out reflection probe draw packet checks.
Signed-off-by: Peng <tonypeng@amazon.com>
* Missed from previous commit to make sure non-MSAA super-variant is used.
Signed-off-by: Peng <tonypeng@amazon.com>
* Minor comment edit.
Signed-off-by: Peng <tonypeng@amazon.com>
Merge pull request #4102 from aws-lumberyard-dev/Atom/santorac/WarnOnMaterialPsoChanges
These changes make material system report warnings when gameplay scripts attempt to change PSO-impacting material properties at runtime. So far the material system has always allowed any properties to be changed at runtime, including those that affect Pipeline State Objects (PSOs), as this is supported on several platforms. But some platforms require that Pipeline State Objects be pre-compiled and shipped with the game. At some point we will need to add new restrictions that limit what material properties can be changed at runtime. In the meantime, these warnings should alert users to avoid this, as the functionality likely won't be supported in the future.
- Made the Material and LuaMaterialFunctor classes configurable to report errors or warnings when material properties modify Pipeline State Objects. This is controlled by a new "MaterialPropertyPsoHandling" enum.
- Made the EditorMaterialComponent override PSO handling as Enabled, to prevent warnings when the user is editing material instance property overrides. This requried a new MaterialComponentNotificationBus bus message "OnMaterialInstanceCreated".
- Added a new ScopedValue utility class that simply sets a value when it goes out of scope.
- Removed unnecessary GetMaterialPropertyDependencies member from material functor context classes, as this is already available as part of the functor itself.
- Made Material::SetPropertyValue return early when the property value hadn't actually changed. Besides being more efficientn, this prevents unnecessary spamming of the new warning.
- Made a couple imporvements to material_find_overrides_demo.lua:
- Made the target material slot name configurable through an exposed component property.
- Fixed a timing issue where the assignmentId was invalid if FindMaterialAssignmentId is called too early.
* Add HDR color grading pass and shaders.
Signed-off-by: Robin <rbarrand@amazon.com>
* Improve code quality.
Signed-off-by: Robin <rbarrand@amazon.com>
* Code refactor.
Signed-off-by: Robin <rbarrand@amazon.com>
* Remove color grading pass from light adaptation parent pass due to failing ASV tests. This will be added back later on.
Signed-off-by: Robin <rbarrand@amazon.com>
* Add newline.
Signed-off-by: Robin <rbarrand@amazon.com>
* Correct case for file.
Signed-off-by: Robin <rbarrand@amazon.com>
* Update comment.
Signed-off-by: Robin <rbarrand@amazon.com>
Co-authored-by: Robin <rbarrand@amazon.com>
* Fix code that deregisters the Atom Scene subsystem from the AzFramework Scene
The AzFramework Scene subsystem API is a generic container based on the
type of argument that is passed to it. It maintains a vector of typeids,
and only one object of any type is stored at a time. The Bootstrap system
component registers the Atom scene as a `ScenePtr` (aka
`AZStd::shared_ptr<RPI:Scene>`) with the AzFramework Scene's generic
subsystem. However, the component was previously deregistering the type by
value, `RPI::Scene`. Since no subsystem for the type `RPI::Scene` was set,
unsetting this type did nothing. The result was that the `RPI::Scene`
object would still be around by the time that all the Atom
`InstanceDatabse`s were being destroyed, resulting in a large number of
errors reported about leaked instances during global shutdown.
This fixes the above issue by passing the `m_defaultScene` as a parameter
to `AzFramework::Scene::UnsetSubsystem`, the same value that is passed to
`SetSubsystem`. This is better, because instead of providing explicit
template arguments (which were specifying the incorrect type), this now
allows the compiler to deduce the correct type, and the syntax is symmetric
with the call to `SetSubsystem`.
Signed-off-by: Chris Burel <burelc@amazon.com>
* Correctly release the AWS API from the `HttpRequestManager` module
This code was incorrectly assuming that
`AWSNativeSDKInit::InitializationManager::Shutdown()` would be called
automatically by the `InitializationManager` itself. However, all that
`InitAwsApi()` does is create an `AZ::EnvironmentVariable`, which is a
ref-counted type, and stores it in a global static. That global static is
defined in a static library (namely `AWSNativeSDKInit`), which is linked
in to the `HttpRequestManager` dynamic lib. Because it is a global static,
it has to be explicitly cleared with the call to `Shutdown()`. Otherwise
the destructor of the EnvironmentVariable doesn't happen until global
destruction, by which time the allocator that is supplied to the AWS SDK
has already been destroyed, and the shutdown of the AWS SDK attempts to use
the already-destroyed allocator.
Signed-off-by: Chris Burel <burelc@amazon.com>
* Avoid blocking the remote console server thread if there are no connections
The Remote console server runs in a separate thread. Previously, it would
directly call `AzSock::Accept()` and block the server thread until some
client connected to it. However, if no client connected, the thread would
continue to be blocked, even if the game launcher tried to exit.
This adds a check to see if there's a client on the socket before calling
`Accept()`, to avoid the deadlock on launcher exit.
Signed-off-by: Chris Burel <burelc@amazon.com>
* Fix a log message to print one message per line
Signed-off-by: Chris Burel <burelc@amazon.com>
* Allow pumping the event loop to close the launcher window
Events from the OS are handled in the game's main loop. The general loop
looks like this:
* Read events from the OS
* Tick the game application
One of the events that can come from the OS is that the window hosting the
game is closed. When this event happens, many resources provided by the
renderer are freed, and the game application's `shouldExit` bit is set.
However, when the game's `Tick()` is called, there is lots of code that
assumes the renderer is still there. To avoid crashing in the `Tick()`
call, check if the game should exit after pumping the system events.
Signed-off-by: Chris Burel <burelc@amazon.com>
* Unload the level when exiting the launcher
This ensures that any resources held onto by the level are freed before the
launcher exits.
Signed-off-by: Chris Burel <burelc@amazon.com>
* Add an explicit bus `Disconnect()` call to `AZCoreLogSink`
This is necessary because this bus has virtual functions and can be called
from multiple threads.
Signed-off-by: Chris Burel <burelc@amazon.com>
* Allow normal cleanup to take place when exiting the game launcher
Previously, global cleanup was side-stepped by calling `TerminateProcess`
or `exit`, when quitting the game launcher. This is in contrast to the call
to `_exit` on Linux and Mac when exiting the Editor. That leading `_` makes
a big difference: the former runs object destruction, the latter does not.
Instead of making the launcher exit with `_exit` on Linux, instead, remove
that call and actually run all the atexit code.
This does not modify the Editor's behavior however. It still uses `_exit`
and `TerminateProcess`.
Signed-off-by: Chris Burel <burelc@amazon.com>
* Remove the "TEST_SUPPORTED" traits.
Terrain unit tests should be usable on all platforms, so they shouldn't need a platform-specific trait to enable/disable.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Fix a few misc terrain bugs.
* Change Activate/Deactivate to happen immediately instead of deferring. There were too many order-of-operation bugs caused by trying to defer this.
* Added implementation for calculating normals.
* Fixed bug where GetHeightSynchronous wasn't stopping at the highest-priority layer.
* Added locks for SurfaceData bus to help ensure we lock our mutexes in the correct order and avoid deadlocks.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Add trivial TerrainSystem tests.
Tests construction, Activate(), Deactivate(), and destruction.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Unified Terrain system calls on single bus.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Added mock for TerrainDataNotificationBus listener.
Also added unit tests to verify the listener, and added in missing notification events.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Removed extra Sampler class.
Fixed up APIs to correctly pass Sampler and terrainExistsPtr around.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Switched MockTerrainSystem to be proper gmock.
This makes it for flexible to use and easier to reuse from other test environments.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Fix settings bug caused by bad order of operations that occurred when the methods moved to a different bus.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Eliminate extra EBus by simplifying area initialization.
Previously, there was a back-and-forth ebus signal used for the terrain system to find any terrain spawners that were created prior to the terrain system activation. Now it uses the more simple technique of just grabbing all the spawners that are currently hooked up to the spawner ebus.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Switch to NiceMock so that "uninteresting" mock calls get ignored.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Addressed PR feedback.
Filled in terrainExistsPtr at the end, and added it to GetNormal as well.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Fixed shader height calculation.
It was off by half a pixel, and it was interpolating, both of which were wrong.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* [ATOM-5441] Shader Builders May Fail When Multiple
New Files Are Added
ShaderAssetBuilder::CreateJobs now recursively parses *.azsl files
looking for #include lines and builds the list of source dependencies
using a depth-first algorithm. It was using MCPP before but not anymore
(during CreateJobs).
The new algorithm may over prescribe, but fixes the issues
when multiple new shader related files are added, at once or out of order, to a game project
or Gem.
Overall the new ShaderAssetBuilder::CreateJobs() is around 40% faster
and, of course, handles source dependencies in a robust way.
* Added new test suite to AutomatedTesting project:
Gem/PythonTests/atom_renderer/test_Atom_ShaderBuildPipelineSuite.py
Bug fix to Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderAssetBuilder.cpp
discovered thanks to the automated test suite. The idea is that
CreateJobs doesn't fail if the AZSL file doesn't exist. The failure is
deferred during ProcessJob. This way if the AZSL file exists the .shader
file is rebuilt automatically.
* For testability purposes and avoid memory leakage errors
during Unit Tests created the class ShaderBuilderUtility::IncludedFilesParser
Now accepts "# include <file>" with space between '#' and 'include'.
Also now accepts the '-' character inside the file path.
Added Unit Test to validate all cases of "#include <file>" parsing.
* Fixed linux runtime issues for Unit Tests in Atom_Asset_Shader.Tests
Signed-off-by: garrieta <garrieta@amazon.com>
* Fixed issue where two Paths could compare equal to each other, but hash
differently
This issue is caused by the Path comparison logic using the path
separator of the left path in a comparison of two paths(left and right)
to determine whether the PathComparison is case-sensitive or not.
The logic has been updated to only perform a non-case-sensitive path
comparison if both paths are using the WindowsPathSeperator of `\`
Also fixed issue with the Hashing algorihtm of the Path class to always
hash the root directory as if it is `/`.
This allows a path of "C:\foo" and "C:/foo" to hash to the equivalent
value.
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
* MS Build Tools 14.29 workaround around suppressing warnings using the external header feature
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
* Replacing the old gaussian blur with a much faster, better quality kawase blur
Signed-off-by: mrieggeramzn <mriegger@amazon.com>
* Removing atomtesting outdated msg
Signed-off-by: mrieggeramzn <mriegger@amazon.com>
* Some recommendations from Tommy
Signed-off-by: mrieggeramzn <mriegger@amazon.com>
* Adding early termination from previous gaussian filtering algorithm that kawase replaces
Signed-off-by: mrieggeramzn <mriegger@amazon.com>
* Removing pcf method
Signed-off-by: mrieggeramzn <mriegger@amazon.com>
* removing the old blur and adding in the new kawase blur into .cmake file
Signed-off-by: mrieggeramzn <mriegger@amazon.com>
* Removing the boundary search method. Bicubic is now the default and only PCF filtering method
* Removing padding (based upon feedback)
* Removing PCF method from py auto testing
Signed-off-by: mrieggeramzn <mriegger@amazon.com>
Adds support for creating an SDK layout from a Monolithic build and have the same install prefix used between monolithic and non-monolithic
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* Added a max_size function to all AZStd container style allocator
functions
The max_size functions returns the maximum value that a single contiguous
allocation value returns
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
* Updated the BestFitExternalMapSchema and MallocSchema
GetMaxContiguousAllocationSize function
Those functions now return a Max allocation size of
AZ_CORE_MAX_ALLOCATOR size to indicate the maximum size for a single
allocation
Changed the IAllocatorAllocator::GetMaxContiguousAllocationSize function
from a pure virtual function to regular virtual function
Removed the left over String.cpp test to validate that the issue with
the allocator::max_size() function was occuring
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
* Fixes to icon generation. Generating a pixmap out of a size won't take the screen scaling factor into account, resulting in blurry results.
Note that this is not a catchall solution, every case needs to be addressed manually.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* HighDpi fixes for startup splashscreen and About dialog
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Add helper function to generate appropriate pixmaps for a screen based on its dpi settings.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* NetworkInput now has new attribute called ExposeToScript. NetworkInput with this attribute set to True will be exposed to behavior context. Also added a CreateFromValues for the NetworkInput where scripters can create an instance of the MyComponentNetworkInput class which will eventually be passed around CreateInput and ProcessInput events.
Signed-off-by: Gene Walters <genewalt@amazon.com>
* Adding Create Input event handler. SC can now receive the event to create input, and send it over the network
Signed-off-by: Gene Walters <genewalt@amazon.com>
* Auto-component controller will now generate CreateInput/ProcessInput methods if they have input exposed to script, not ready for use yet, just stubbed in
Signed-off-by: Gene Walters <genewalt@amazon.com>
* Reducing code replication by putting common network input variables into AutoComponent_Common.jinja
Signed-off-by: Gene Walters <genewalt@amazon.com>
* Fix minor comment typo in the CreateInput method
Signed-off-by: Gene Walters <genewalt@amazon.com>
* Small fix. Changing ebus call from MyComponentNameCreateInput to just CreateInput. It's part of the MyComponentRequestBus so adding the component name before CreateInput is noisy
Signed-off-by: Gene Walters <genewalt@amazon.com>
* Cleaning with jinja a bit using macro calls to iterate over scriptable netinputs
Signed-off-by: Gene Walters <genewalt@amazon.com>
* ProcessInput will now be triggered in script
Signed-off-by: Gene Walters <genewalt@amazon.com>
* ProcessInput event is sent to script. Script can now create and process input. Tested locally with a simple script.
Signed-off-by: Gene Walters <genewalt@amazon.com>
* Created a seperate CreateInputFromScript and ProcessInputFromScript. Developers no longer need to remember to call the BaseClass::CreateInput and ProcessInput since CreateInputFromScript will automatically be called beforehand.
Signed-off-by: Gene Walters <genewalt@amazon.com>
* 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>
- Made the Material and LuaMaterialFunctor classes configurable to report errors or warnings when material properties modify Pipeline State Objects. This is controlled by a new "MaterialPropertyPsoHandling" enum.
- Made the EditorMaterialComponent override PSO handling as Enabled, to prevent warnings when the user is editing material instance property overrides. This requried a new MaterialComponentNotificationBus bus message "OnMaterialInstanceCreated".
- Removed unnecessary GetMaterialPropertyDependencies member from material functor context classes, as this is already available as part of the functor itself.
- Made Material::SetPropertyValue return early when the property value hadn't actually changed. Besides being more efficientn, this prevents unnecessary spamming of the new warning.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
- Made the target material slot name configurable through an exposed component property.
- Fixed a timing issue where the assignmentId was invalid if FindMaterialAssignmentId is called too early.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>