From 0c339d2e2d85aec0703a99bf640880c54dfdc93c Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Fri, 16 Jul 2021 21:55:26 -0500 Subject: [PATCH 01/17] Fixed the SettingsRegistryBuilder not merging the Registry directories within Gems Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- .../SettingsRegistryBuilder.cpp | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/Code/Tools/AssetProcessor/native/InternalBuilders/SettingsRegistryBuilder.cpp b/Code/Tools/AssetProcessor/native/InternalBuilders/SettingsRegistryBuilder.cpp index f574206637..f0651411c6 100644 --- a/Code/Tools/AssetProcessor/native/InternalBuilders/SettingsRegistryBuilder.cpp +++ b/Code/Tools/AssetProcessor/native/InternalBuilders/SettingsRegistryBuilder.cpp @@ -263,6 +263,12 @@ namespace AssetProcessor return; } + using FixedValueString = AZ::SettingsRegistryInterface::FixedValueString; + // Placeholder Key used by the local Settings Registry for storing all Gems SourcePaths + // array entries. + constexpr auto PlaceholderGemKey = FixedValueString(AZ::SettingsRegistryMergeUtils::OrganizationRootKey) + + "/Gems/__SettingsRegistryBuilderPlaceholder"; + AZ::SettingsRegistryImpl registry; // Seed the local settings registry using the AssetProcessor settings registry @@ -279,18 +285,47 @@ namespace AssetProcessor for (const auto& settingsKey : settingsToCopy) { - AZ::SettingsRegistryInterface::FixedValueString settingsValue; + FixedValueString settingsValue; [[maybe_unused]] bool settingsCopied = settingsRegistry->Get(settingsValue, settingsKey) && registry.Set(settingsKey, settingsValue); AZ_Warning("Settings Registry Builder", settingsCopied, "Unable to copy setting %s from AssetProcessor settings registry" " to local settings registry", settingsKey.c_str()); } + + // Read the AssetProcessor loaded Gem Information from the global Registry + AZStd::vector gemInfos; + size_t pathIndex{}; + if (AzFramework::GetGemsInfo(gemInfos, *settingsRegistry)) + { + AZStd::vector sourcePaths; + for (const AzFramework::GemInfo& gemInfo : gemInfos) + { + for (const AZ::IO::Path& absoluteSourcePath : gemInfo.m_absoluteSourcePaths) + { + if (auto foundIt = AZStd::find(sourcePaths.begin(), sourcePaths.end(), absoluteSourcePath); + foundIt == sourcePaths.end()) + { + sourcePaths.emplace_back(absoluteSourcePath); + } + } + } + + for (const AZ::IO::Path& sourcePath : sourcePaths) + { + // Use JSON Pointer to append elements to the SourcePaths array + registry.Set(FixedValueString::format("%s/SourcePaths/%zu", PlaceholderGemKey.c_str(), pathIndex++), + sourcePath.Native()); + } + } } AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_EngineRegistry(registry, platform, specialization, &scratchBuffer); AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_GemRegistries(registry, platform, specialization, &scratchBuffer); AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_ProjectRegistry(registry, platform, specialization, &scratchBuffer); + // The Placeholder Key is removed now that the each gem "/Registry" directory has been merged + registry.Remove(PlaceholderGemKey); + // Merge the Project User and User home settings registry only in non-release builds constexpr bool executeRegDumpCommands = false; AZ::CommandLine* commandLine{}; From 4b74fcf708dcfd96ccb88586a41b979bfb21f168 Mon Sep 17 00:00:00 2001 From: Terry Michaels Date: Mon, 19 Jul 2021 14:58:18 -0500 Subject: [PATCH 02/17] Updated CONTRIBUTING.md Signed-off-by: Terry Michaels --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ba7f134922..0bb1c7cad6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,7 +8,7 @@ To contribute, please review our [Code of Conduct](https://github.com/o3de/o3de/ ## Making contributions with the Developer Certificate of Origin (DCO) -When contributing, your pull requests will require that you have agreed to our DCO found here: [Devloper Certificate of Origin](https://developercertificate.org/) +When contributing, your pull requests will require that you have agreed to our DCO found here: [Developer Certificate of Origin](https://developercertificate.org/). All commits require the --signoff flag to show DCO compliance. You can do this by using the -s option in git. Example: ```git commit -s -m 'my commit message'``` \ No newline at end of file From ce6514de6db04a63944bfaa47173dda0c1b815a4 Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Mon, 19 Jul 2021 14:58:19 -0500 Subject: [PATCH 03/17] Added clarifying comments as to why the Gem's SourcePaths directory is temporarily copied over to the SettingsRegistryBuilder local Settings Registry instance Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- .../InternalBuilders/SettingsRegistryBuilder.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Code/Tools/AssetProcessor/native/InternalBuilders/SettingsRegistryBuilder.cpp b/Code/Tools/AssetProcessor/native/InternalBuilders/SettingsRegistryBuilder.cpp index f0651411c6..f808850ad7 100644 --- a/Code/Tools/AssetProcessor/native/InternalBuilders/SettingsRegistryBuilder.cpp +++ b/Code/Tools/AssetProcessor/native/InternalBuilders/SettingsRegistryBuilder.cpp @@ -271,7 +271,7 @@ namespace AssetProcessor AZ::SettingsRegistryImpl registry; - // Seed the local settings registry using the AssetProcessor settings registry + // Seed the local settings registry using the AssetProcessor Settings Registry if (auto settingsRegistry = AZ::Interface::Get(); settingsRegistry != nullptr) { AZStd::array settingsToCopy{ @@ -292,7 +292,12 @@ namespace AssetProcessor " to local settings registry", settingsKey.c_str()); } - // Read the AssetProcessor loaded Gem Information from the global Registry + // The purpose of this section is to copy the Gem's SourcePaths from the Global Settings Registry + // the local SettingsRegistry. The reason this is needed is so that the call to + // `MergeSettingsToRegistry_GemRegistries` below is able to locate each gem's "/Registry" folder + // that will be merged into the bootstrap.game...setreg file + // This is used by the GameLauncher applications to read from a single merged .setreg file + // containing the settings needed to run a game/simulation without have access to the source code base registry AZStd::vector gemInfos; size_t pathIndex{}; if (AzFramework::GetGemsInfo(gemInfos, *settingsRegistry)) @@ -320,10 +325,13 @@ namespace AssetProcessor } AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_EngineRegistry(registry, platform, specialization, &scratchBuffer); + // This function iterates over each path for each the "/Amazon/Gems//SourcePaths" key and attempts + // to merge the "Registry" directory in each path. AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_GemRegistries(registry, platform, specialization, &scratchBuffer); AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_ProjectRegistry(registry, platform, specialization, &scratchBuffer); - // The Placeholder Key is removed now that the each gem "/Registry" directory has been merged + // The Placeholder Key is removed now that each gem's "/Registry" directory have been merged to + // the local Settings Registry instance via `MergeSettingsToRegistry_GemRegistries` registry.Remove(PlaceholderGemKey); // Merge the Project User and User home settings registry only in non-release builds From da02d47069a4c0492b45310e9236c41d7755b8bc Mon Sep 17 00:00:00 2001 From: Chris Burel Date: Fri, 16 Jul 2021 16:58:11 -0700 Subject: [PATCH 04/17] Re-enable using non-officially-supported generators when building with MSVC Signed-off-by: Chris Burel --- cmake/Platform/Common/MSVC/Configurations_msvc.cmake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cmake/Platform/Common/MSVC/Configurations_msvc.cmake b/cmake/Platform/Common/MSVC/Configurations_msvc.cmake index d61558bd49..156f6bbfd9 100644 --- a/cmake/Platform/Common/MSVC/Configurations_msvc.cmake +++ b/cmake/Platform/Common/MSVC/Configurations_msvc.cmake @@ -6,13 +6,15 @@ # # +set(minimum_supported_toolset 142) +if(MSVC_TOOLSET_VERSION VERSION_LESS ${minimum_supported_toolset}) + message(FATAL_ERROR "MSVC toolset ${MSVC_TOOLSET_VERSION} is too old, minimum supported toolset is ${minimum_supported_toolset}") +endif() +unset(minimum_supported_toolset) + include(cmake/Platform/Common/Configurations_common.cmake) include(cmake/Platform/Common/VisualStudio_common.cmake) -if(NOT CMAKE_GENERATOR MATCHES "Visual Studio 1[6-7]") - message(FATAL_ERROR "Generator ${CMAKE_GENERATOR} not supported") -endif() - # Verify that it wasn't invoked with an unsupported target/host architecture. Currently only supports x64/x64 if(CMAKE_VS_PLATFORM_NAME AND NOT CMAKE_VS_PLATFORM_NAME STREQUAL "x64") message(FATAL_ERROR "${CMAKE_VS_PLATFORM_NAME} target architecture is not supported, it must be 'x64'") From ebfaf269f65f3e54b6365ac936e7f21832f92e3b Mon Sep 17 00:00:00 2001 From: Chris Burel Date: Mon, 19 Jul 2021 11:43:44 -0700 Subject: [PATCH 05/17] Remove special compiler flags for unsupported VS2017 compiler Signed-off-by: Chris Burel --- cmake/Platform/Common/MSVC/Configurations_msvc.cmake | 8 -------- 1 file changed, 8 deletions(-) diff --git a/cmake/Platform/Common/MSVC/Configurations_msvc.cmake b/cmake/Platform/Common/MSVC/Configurations_msvc.cmake index 156f6bbfd9..41de1bd6a0 100644 --- a/cmake/Platform/Common/MSVC/Configurations_msvc.cmake +++ b/cmake/Platform/Common/MSVC/Configurations_msvc.cmake @@ -116,14 +116,6 @@ else() ) endif() -if(CMAKE_GENERATOR MATCHES "Visual Studio 15") - # Visual Studio 2017 has problems with [[maybe_unused]] on lambdas. Sadly, there is no different warning, so 4100 has to remain disabled on 2017 - ly_append_configurations_options( - COMPILATION - /wd4100 - ) -endif() - # Configure system includes ly_set(LY_CXX_SYSTEM_INCLUDE_CONFIGURATION_FLAG /experimental:external # Turns on "external" headers feature for MSVC compilers From f3cb0ee94df762e6d49e4f3a8096adfdf6baf382 Mon Sep 17 00:00:00 2001 From: Chris Burel Date: Mon, 19 Jul 2021 11:44:38 -0700 Subject: [PATCH 06/17] Remvoe Jenkins build configuration for unsupported VS2017 compiler Signed-off-by: Chris Burel --- .../build/Platform/Windows/package_build_config.json | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/scripts/build/Platform/Windows/package_build_config.json b/scripts/build/Platform/Windows/package_build_config.json index a5ca861377..89431ad96e 100644 --- a/scripts/build/Platform/Windows/package_build_config.json +++ b/scripts/build/Platform/Windows/package_build_config.json @@ -1,15 +1,4 @@ { - "profile_vs2017_atom": { - "COMMAND": "build_windows.cmd", - "PARAMETERS": { - "CONFIGURATION": "profile", - "OUTPUT_DIRECTORY": "windows_vs2017", - "CMAKE_OPTIONS": "-G \"Visual Studio 15 2017\" -A x64 -T host=x64 -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=TRUE", - "CMAKE_LY_PROJECTS": "AtomTest;AtomSampleViewer", - "CMAKE_TARGET": "ALL_BUILD", - "CMAKE_NATIVE_BUILD_ARGS": "/m:4 /p:CL_MPCount=!HALF_PROCESSORS! /nologo" - } - }, "profile_vs2019_atom": { "COMMAND":"build_windows.cmd", "PARAMETERS": { From e76b65fce99af76c585d5a5d4c2d4bb06d986f1a Mon Sep 17 00:00:00 2001 From: nemerle <96597+nemerle@users.noreply.github.com> Date: Tue, 20 Jul 2021 02:31:38 +0200 Subject: [PATCH 07/17] Reduce inclusion overhead a little bit Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> --- Code/Framework/AzCore/AzCore/EBus/Event.h | 3 +- Code/Framework/AzCore/AzCore/Math/Frustum.h | 1 + .../AzCore/AzCore/Math/Transform.cpp | 23 +++++++++ Code/Framework/AzCore/AzCore/Math/Transform.h | 21 -------- Code/Framework/AzCore/AzCore/Math/Vector3.h | 1 - .../Physics/Common/PhysicsSceneQueries.h | 1 + .../UnitTest/TestDebugDisplayRequests.h | 2 + .../Visibility/OctreeSystemComponent.cpp | 1 + .../Input/User/LocalUserId_Default.h | 7 ++- .../Manipulators/ManipulatorSpace.h | 1 + .../Tests/Prefab/PrefabTestComponent.cpp | 1 + .../Utilities/CoordinateSystemConverter.h | 1 + .../SceneCore/Utilities/DebugOutput.cpp | 1 + .../SceneCore/Utilities/DebugOutput.h | 2 + .../Atom/RHI/Code/Include/Atom/RHI/DrawItem.h | 11 +++-- .../GradientWeightModifierController.cpp | 2 + ...adiusWeightModifierComponentController.cpp | 1 + ...ShapeWeightModifierComponentController.cpp | 1 + .../EntityReferenceComponentController.cpp | 1 + .../AudioSystemGemSystemComponent_default.cpp | 1 + Gems/EMotionFX/Code/EMotionFX/Source/Mesh.h | 1 + .../LYCommonMenu/ImGuiLYAssetExplorer.h | 1 + .../Asset/AssetSystemDebugComponent.cpp | 1 + .../Source/UiFlipbookAnimationComponent.cpp | 49 ++++++++++--------- .../Source/UiFlipbookAnimationComponent.h | 3 -- .../Source/System/PhysXJointInterface.cpp | 1 + 26 files changed, 84 insertions(+), 55 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/EBus/Event.h b/Code/Framework/AzCore/AzCore/EBus/Event.h index 2edce0ecca..b3c29b63a2 100644 --- a/Code/Framework/AzCore/AzCore/EBus/Event.h +++ b/Code/Framework/AzCore/AzCore/EBus/Event.h @@ -9,11 +9,12 @@ #pragma once #include +#include #include #include #include #include -#include +#include namespace AZ { diff --git a/Code/Framework/AzCore/AzCore/Math/Frustum.h b/Code/Framework/AzCore/AzCore/Math/Frustum.h index c9eadfbceb..d9c6f5547e 100644 --- a/Code/Framework/AzCore/AzCore/Math/Frustum.h +++ b/Code/Framework/AzCore/AzCore/Math/Frustum.h @@ -14,6 +14,7 @@ #include #include #include +#include namespace AZ { diff --git a/Code/Framework/AzCore/AzCore/Math/Transform.cpp b/Code/Framework/AzCore/AzCore/Math/Transform.cpp index e1d5dcf399..5cb09fe9a8 100644 --- a/Code/Framework/AzCore/AzCore/Math/Transform.cpp +++ b/Code/Framework/AzCore/AzCore/Math/Transform.cpp @@ -13,9 +13,32 @@ #include #include #include +#include namespace AZ { + namespace + { + class TransformSerializer + : public SerializeContext::IDataSerializer + { + public: + // number of floats in the serialized representation, 4 for rotation, 1 for scale and 3 for translation + static constexpr int NumFloats = 8; + + // number of floats in version 1, which used 4 for rotation, 3 for scale and 3 for translation + static constexpr int NumFloatsVersion1 = 10; + + // number of floats in version 0, which stored a 3x4 matrix + static constexpr int NumFloatsVersion0 = 12; + + size_t Save(const void* classPtr, IO::GenericStream& stream, bool isDataBigEndian) override; + size_t DataToText(IO::GenericStream& in, IO::GenericStream& out, bool isDataBigEndian) override; + size_t TextToData(const char* text, unsigned int textVersion, IO::GenericStream& stream, bool isDataBigEndian) override; + bool Load(void* classPtr, IO::GenericStream& stream, unsigned int version, bool isDataBigEndian) override; + bool CompareValueData(const void* lhs, const void* rhs) override; + }; + } namespace Internal { void TransformDefaultConstructor(Transform* thisPtr) diff --git a/Code/Framework/AzCore/AzCore/Math/Transform.h b/Code/Framework/AzCore/AzCore/Math/Transform.h index 394c9d31a6..c231063c77 100644 --- a/Code/Framework/AzCore/AzCore/Math/Transform.h +++ b/Code/Framework/AzCore/AzCore/Math/Transform.h @@ -13,30 +13,9 @@ #include #include #include -#include namespace AZ { - class TransformSerializer - : public SerializeContext::IDataSerializer - { - public: - // number of floats in the serialized representation, 4 for rotation, 1 for scale and 3 for translation - static constexpr int NumFloats = 8; - - // number of floats in version 1, which used 4 for rotation, 3 for scale and 3 for translation - static constexpr int NumFloatsVersion1 = 10; - - // number of floats in version 0, which stored a 3x4 matrix - static constexpr int NumFloatsVersion0 = 12; - - size_t Save(const void* classPtr, IO::GenericStream& stream, bool isDataBigEndian) override; - size_t DataToText(IO::GenericStream& in, IO::GenericStream& out, bool isDataBigEndian) override; - size_t TextToData(const char* text, unsigned int textVersion, IO::GenericStream& stream, bool isDataBigEndian) override; - bool Load(void* classPtr, IO::GenericStream& stream, unsigned int version, bool isDataBigEndian) override; - bool CompareValueData(const void* lhs, const void* rhs) override; - }; - //! Limits for transform scale values. //! The scale should not be zero to avoid problems with inverting. //! @{ diff --git a/Code/Framework/AzCore/AzCore/Math/Vector3.h b/Code/Framework/AzCore/AzCore/Math/Vector3.h index 3c7d702f41..4be70aa02e 100644 --- a/Code/Framework/AzCore/AzCore/Math/Vector3.h +++ b/Code/Framework/AzCore/AzCore/Math/Vector3.h @@ -10,7 +10,6 @@ #include #include -#include namespace AZ { diff --git a/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSceneQueries.h b/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSceneQueries.h index f84a4f55bb..8d25922f58 100644 --- a/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSceneQueries.h +++ b/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSceneQueries.h @@ -7,6 +7,7 @@ */ #pragma once +#include #include #include #include diff --git a/Code/Framework/AzFramework/AzFramework/UnitTest/TestDebugDisplayRequests.h b/Code/Framework/AzFramework/AzFramework/UnitTest/TestDebugDisplayRequests.h index 38aba9be27..d4c6992057 100644 --- a/Code/Framework/AzFramework/AzFramework/UnitTest/TestDebugDisplayRequests.h +++ b/Code/Framework/AzFramework/AzFramework/UnitTest/TestDebugDisplayRequests.h @@ -7,6 +7,8 @@ */ #pragma once + +#include #include namespace UnitTest diff --git a/Code/Framework/AzFramework/AzFramework/Visibility/OctreeSystemComponent.cpp b/Code/Framework/AzFramework/AzFramework/Visibility/OctreeSystemComponent.cpp index 86454e26d0..5ef1cda30e 100644 --- a/Code/Framework/AzFramework/AzFramework/Visibility/OctreeSystemComponent.cpp +++ b/Code/Framework/AzFramework/AzFramework/Visibility/OctreeSystemComponent.cpp @@ -8,6 +8,7 @@ #include #include +#include namespace AzFramework { diff --git a/Code/Framework/AzFramework/Platform/Common/Default/AzFramework/Input/User/LocalUserId_Default.h b/Code/Framework/AzFramework/Platform/Common/Default/AzFramework/Input/User/LocalUserId_Default.h index 114bb6dc73..727f103c9a 100644 --- a/Code/Framework/AzFramework/Platform/Common/Default/AzFramework/Input/User/LocalUserId_Default.h +++ b/Code/Framework/AzFramework/Platform/Common/Default/AzFramework/Input/User/LocalUserId_Default.h @@ -9,7 +9,12 @@ #pragma once #include -#include +#include + +namespace AZ +{ + class ReflectContext; +} // namespace Az //////////////////////////////////////////////////////////////////////////////////////////////////// namespace AzFramework diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ManipulatorSpace.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ManipulatorSpace.h index 6c2b8971a3..c372afcf32 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ManipulatorSpace.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ManipulatorSpace.h @@ -8,6 +8,7 @@ #pragma once #include +#include namespace AZ { diff --git a/Code/Framework/AzToolsFramework/Tests/Prefab/PrefabTestComponent.cpp b/Code/Framework/AzToolsFramework/Tests/Prefab/PrefabTestComponent.cpp index 2a0cb72692..8f7ee398a0 100644 --- a/Code/Framework/AzToolsFramework/Tests/Prefab/PrefabTestComponent.cpp +++ b/Code/Framework/AzToolsFramework/Tests/Prefab/PrefabTestComponent.cpp @@ -7,6 +7,7 @@ */ #include +#include namespace UnitTest { diff --git a/Code/Tools/SceneAPI/SceneCore/Utilities/CoordinateSystemConverter.h b/Code/Tools/SceneAPI/SceneCore/Utilities/CoordinateSystemConverter.h index 5c14b14c7d..24f7243b32 100644 --- a/Code/Tools/SceneAPI/SceneCore/Utilities/CoordinateSystemConverter.h +++ b/Code/Tools/SceneAPI/SceneCore/Utilities/CoordinateSystemConverter.h @@ -11,6 +11,7 @@ #include #include #include +#include #include namespace AZ::SceneAPI diff --git a/Code/Tools/SceneAPI/SceneCore/Utilities/DebugOutput.cpp b/Code/Tools/SceneAPI/SceneCore/Utilities/DebugOutput.cpp index 50fefce632..e688ebccd4 100644 --- a/Code/Tools/SceneAPI/SceneCore/Utilities/DebugOutput.cpp +++ b/Code/Tools/SceneAPI/SceneCore/Utilities/DebugOutput.cpp @@ -7,6 +7,7 @@ */ #include "DebugOutput.h" +#include namespace AZ::SceneAPI::Utilities { diff --git a/Code/Tools/SceneAPI/SceneCore/Utilities/DebugOutput.h b/Code/Tools/SceneAPI/SceneCore/Utilities/DebugOutput.h index 7032696bbb..5bb57a6167 100644 --- a/Code/Tools/SceneAPI/SceneCore/Utilities/DebugOutput.h +++ b/Code/Tools/SceneAPI/SceneCore/Utilities/DebugOutput.h @@ -11,6 +11,8 @@ #include #include #include +#include +#include #include namespace AZ::SceneAPI::Utilities diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/DrawItem.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/DrawItem.h index 9c9e7c9930..4a342a06d1 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/DrawItem.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/DrawItem.h @@ -7,7 +7,6 @@ */ #pragma once -#include #include #include #include @@ -23,6 +22,10 @@ namespace AZ class ShaderResourceGroup; struct Scissor; struct Viewport; + struct DefaultNamespaceType; + // Forward declaration to + template + struct Handle; struct DrawLinear { @@ -149,13 +152,13 @@ namespace AZ }; using DrawItemSortKey = int64_t; - + // A filter associate to a DrawItem which can be used to filter the DrawItem when submitting to command list - using DrawFilterTag = Handle; + using DrawFilterTag = Handle; using DrawFilterMask = uint32_t; // AZStd::bitset's impelmentation is too expensive. constexpr uint32_t DrawFilterMaskDefaultValue = uint32_t(-1); // Default all bit to 1. static_assert(sizeof(DrawFilterMask) * 8 >= Limits::Pipeline::DrawFilterTagCountMax, "DrawFilterMask doesn't have enough bits for maximum tag count"); - + struct DrawItemProperties { DrawItemProperties() = default; diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/PostProcess/GradientWeightModifier/GradientWeightModifierController.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/PostProcess/GradientWeightModifier/GradientWeightModifierController.cpp index f8a43063f9..dd1eef9039 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/PostProcess/GradientWeightModifier/GradientWeightModifierController.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/PostProcess/GradientWeightModifier/GradientWeightModifierController.cpp @@ -6,7 +6,9 @@ * */ + #include +#include namespace AZ { diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/PostProcess/RadiusWeightModifier/RadiusWeightModifierComponentController.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/PostProcess/RadiusWeightModifier/RadiusWeightModifierComponentController.cpp index 8c02b200c1..c2d7176436 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/PostProcess/RadiusWeightModifier/RadiusWeightModifierComponentController.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/PostProcess/RadiusWeightModifier/RadiusWeightModifierComponentController.cpp @@ -7,6 +7,7 @@ */ #include +#include namespace AZ { diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/PostProcess/ShapeWeightModifier/ShapeWeightModifierComponentController.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/PostProcess/ShapeWeightModifier/ShapeWeightModifierComponentController.cpp index 62eed9252b..42898cd188 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/PostProcess/ShapeWeightModifier/ShapeWeightModifierComponentController.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/PostProcess/ShapeWeightModifier/ShapeWeightModifierComponentController.cpp @@ -8,6 +8,7 @@ #include #include +#include namespace AZ { diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Scripting/EntityReferenceComponentController.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Scripting/EntityReferenceComponentController.cpp index 00a1142446..b1ef3f97d6 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Scripting/EntityReferenceComponentController.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Scripting/EntityReferenceComponentController.cpp @@ -7,6 +7,7 @@ */ #include +#include namespace AZ { diff --git a/Gems/AudioSystem/Code/Platform/Common/Default/AudioSystemGemSystemComponent_default.cpp b/Gems/AudioSystem/Code/Platform/Common/Default/AudioSystemGemSystemComponent_default.cpp index ac565c89b2..9078b07aaa 100644 --- a/Gems/AudioSystem/Code/Platform/Common/Default/AudioSystemGemSystemComponent_default.cpp +++ b/Gems/AudioSystem/Code/Platform/Common/Default/AudioSystemGemSystemComponent_default.cpp @@ -9,6 +9,7 @@ #include #include #include +#include namespace Audio::Platform { diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/Mesh.h b/Gems/EMotionFX/Code/EMotionFX/Source/Mesh.h index 07b8401895..f9a9f960ce 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/Mesh.h +++ b/Gems/EMotionFX/Code/EMotionFX/Source/Mesh.h @@ -10,6 +10,7 @@ #include "EMotionFXConfig.h" #include +#include #include #include "BaseObject.h" #include "VertexAttributeLayer.h" diff --git a/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYAssetExplorer.h b/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYAssetExplorer.h index bf7b00c5aa..6d264c2f4e 100644 --- a/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYAssetExplorer.h +++ b/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYAssetExplorer.h @@ -14,6 +14,7 @@ #include #include #include +#include namespace ImGui { diff --git a/Gems/LmbrCentral/Code/Source/Asset/AssetSystemDebugComponent.cpp b/Gems/LmbrCentral/Code/Source/Asset/AssetSystemDebugComponent.cpp index f3d4d34b42..1f95f2a55d 100644 --- a/Gems/LmbrCentral/Code/Source/Asset/AssetSystemDebugComponent.cpp +++ b/Gems/LmbrCentral/Code/Source/Asset/AssetSystemDebugComponent.cpp @@ -12,6 +12,7 @@ #include "AzCore/Asset/AssetManager.h" #include #include +#include namespace LmbrCentral { diff --git a/Gems/LyShine/Code/Source/UiFlipbookAnimationComponent.cpp b/Gems/LyShine/Code/Source/UiFlipbookAnimationComponent.cpp index 5986714100..f0423c93a3 100644 --- a/Gems/LyShine/Code/Source/UiFlipbookAnimationComponent.cpp +++ b/Gems/LyShine/Code/Source/UiFlipbookAnimationComponent.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -130,6 +131,29 @@ public: } }; +//////////////////////////////////////////////////////////////////////////////////////////////////// +static bool UiFlipbookAnimationComponentVersionConverter(AZ::SerializeContext& context, + AZ::SerializeContext::DataElementNode& classElement) +{ + // conversion from version 2: + // - Rename "frame delay" to "framerate" + // - Set "framerate unit" to seconds (default moving forward is FPS, but we use seconds for legacy compatibility) + if (classElement.GetVersion() <= 2) + { + if (!ConvertFrameDelayToFramerate(context, classElement)) + { + return false; + } + + if (!ConvertFramerateUnitToSeconds(context, classElement)) + { + return false; + } + } + + return true; +} + //////////////////////////////////////////////////////////////////////////////////////////////////// void UiFlipbookAnimationComponent::Reflect(AZ::ReflectContext* context) @@ -138,7 +162,7 @@ void UiFlipbookAnimationComponent::Reflect(AZ::ReflectContext* context) if (serializeContext) { serializeContext->Class() - ->Version(3, &VersionConverter) + ->Version(3, &UiFlipbookAnimationComponentVersionConverter) ->Field("Start Frame", &UiFlipbookAnimationComponent::m_startFrame) ->Field("End Frame", &UiFlipbookAnimationComponent::m_endFrame) ->Field("Loop Start Frame", &UiFlipbookAnimationComponent::m_loopStartFrame) @@ -268,29 +292,6 @@ void UiFlipbookAnimationComponent::Reflect(AZ::ReflectContext* context) } } -//////////////////////////////////////////////////////////////////////////////////////////////////// -bool UiFlipbookAnimationComponent::VersionConverter(AZ::SerializeContext& context, - AZ::SerializeContext::DataElementNode& classElement) -{ - // conversion from version 2: - // - Rename "frame delay" to "framerate" - // - Set "framerate unit" to seconds (default moving forward is FPS, but we use seconds for legacy compatibility) - if (classElement.GetVersion() <= 2) - { - if (!ConvertFrameDelayToFramerate(context, classElement)) - { - return false; - } - - if (!ConvertFramerateUnitToSeconds(context, classElement)) - { - return false; - } - } - - return true; -} - //////////////////////////////////////////////////////////////////////////////////////////////////// AZ::u32 UiFlipbookAnimationComponent::GetMaxFrame() const { diff --git a/Gems/LyShine/Code/Source/UiFlipbookAnimationComponent.h b/Gems/LyShine/Code/Source/UiFlipbookAnimationComponent.h index 12b6200802..ec47dbcd3d 100644 --- a/Gems/LyShine/Code/Source/UiFlipbookAnimationComponent.h +++ b/Gems/LyShine/Code/Source/UiFlipbookAnimationComponent.h @@ -107,9 +107,6 @@ protected: // static functions static void Reflect(AZ::ReflectContext* context); ////////////////////////////////////////////////////////////////////////// - static bool VersionConverter(AZ::SerializeContext& context, - AZ::SerializeContext::DataElementNode& classElement); - protected: // functions //! Returns a string representation of the indices used to index sprite-sheet types. diff --git a/Gems/PhysX/Code/Source/System/PhysXJointInterface.cpp b/Gems/PhysX/Code/Source/System/PhysXJointInterface.cpp index 4338d51dbd..f92801b0c7 100644 --- a/Gems/PhysX/Code/Source/System/PhysXJointInterface.cpp +++ b/Gems/PhysX/Code/Source/System/PhysXJointInterface.cpp @@ -8,6 +8,7 @@ #include #include +#include #include #include From d5431e1c575b7a6da4028b771da91541b3d79706 Mon Sep 17 00:00:00 2001 From: sharmajs-amzn <82233357+sharmajs-amzn@users.noreply.github.com> Date: Tue, 20 Jul 2021 09:26:11 -0700 Subject: [PATCH 08/17] {LYN-4996} Asset Processor is not reprocessing STL files after settings are edited/updated (#2095) * add asset importer file extension Signed-off-by: sharmajs * add new test setreg file Signed-off-by: sharmajs * removed an unnecessary namespace Signed-off-by: sharmajs * addressed feedback Signed-off-by: sharmajs * addressed feedback Signed-off-by: sharmajs * remove unnecessay method Signed-off-by: sharmajs * add file Signed-off-by: sharmajs * reduce waiting time in block until idle Signed-off-by: sharmajs --- .../AzToolsFramework/Asset/AssetUtils.h | 3 + Code/Tools/AssetProcessor/CMakeLists.txt | 8 +++ .../assetprocessor_test_files.cmake | 1 + .../AssetProcessorManagerTest.cpp | 57 +++++++++++++++++++ .../assetmanager/AssetProcessorManagerTest.h | 7 +++ .../platformconfigurationtests.cpp | 22 +++++++ .../utilities/PlatformConfiguration.cpp | 27 +++++++++ .../native/utilities/PlatformConfiguration.h | 15 +++++ .../AssetProcessorPlatformConfig.setreg | 16 ++++++ .../SceneImportRequestHandler.cpp | 7 ++- 10 files changed, 161 insertions(+), 2 deletions(-) create mode 100644 Code/Tools/AssetProcessor/testdata/config_metadata/AssetProcessorPlatformConfig.setreg diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Asset/AssetUtils.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Asset/AssetUtils.h index c1beea08f0..39aab4d3fb 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Asset/AssetUtils.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Asset/AssetUtils.h @@ -17,6 +17,9 @@ class QString; namespace AzToolsFramework::AssetUtils { + static constexpr const char* AssetImporterSettingsKey{ "/O3DE/SceneAPI/AssetImporter" }; + static constexpr const char* AssetImporterSupportedFileTypeKey{ "SupportedFileTypeExtensions" }; + //! Reads the "/Amazon/AssetProcessor/Settings/Platforms" entry from the settings registry //! to retrieve all enabled platforms void ReadEnabledPlatformsFromSettingsRegistry(AZ::SettingsRegistryInterface& settingsRegistry, diff --git a/Code/Tools/AssetProcessor/CMakeLists.txt b/Code/Tools/AssetProcessor/CMakeLists.txt index 1d51b2e775..f10e4a9e05 100644 --- a/Code/Tools/AssetProcessor/CMakeLists.txt +++ b/Code/Tools/AssetProcessor/CMakeLists.txt @@ -238,6 +238,14 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) OUTPUT_SUBDIRECTORY testdata/DummyProject ) + ly_add_target_files( + TARGETS + AssetProcessor.Tests + FILES + ${CMAKE_CURRENT_SOURCE_DIR}/testdata/config_metadata/AssetProcessorPlatformConfig.setreg + OUTPUT_SUBDIRECTORY + testdata/config_metadata + ) # Have the AssetProcessorTest use the LY_CMAKE_TARGET define of AssetProcessorBatch for the purpose # of looking up the generated cmake build dependencies settings registry .setreg file diff --git a/Code/Tools/AssetProcessor/assetprocessor_test_files.cmake b/Code/Tools/AssetProcessor/assetprocessor_test_files.cmake index 747413d6cc..6aebc8bc25 100644 --- a/Code/Tools/AssetProcessor/assetprocessor_test_files.cmake +++ b/Code/Tools/AssetProcessor/assetprocessor_test_files.cmake @@ -12,6 +12,7 @@ set(FILES testdata/config_broken_noscans/AssetProcessorPlatformConfig.setreg testdata/config_broken_recognizers/AssetProcessorPlatformConfig.setreg testdata/config_regular/AssetProcessorPlatformConfig.setreg + testdata/config_metadata/AssetProcessorPlatformConfig.setreg testdata/config_regular_platform_scanfolder/AssetProcessorPlatformConfig.setreg testdata/EmptyDummyProject/AssetProcessorGamePlatformConfig.setreg testdata/DummyProject/AssetProcessorGamePlatformConfig.setreg diff --git a/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.cpp b/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.cpp index f0cf8aaf19..10ecc411ab 100644 --- a/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.cpp +++ b/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.cpp @@ -76,6 +76,7 @@ public: friend class GTEST_TEST_CLASS_NAME_(ModtimeScanningTest, ModtimeSkipping_ModifyMetadataFile); friend class GTEST_TEST_CLASS_NAME_(ModtimeScanningTest, ModtimeSkipping_DeleteFile); friend class GTEST_TEST_CLASS_NAME_(DeleteTest, DeleteFolderSharedAcrossTwoScanFolders_CorrectFileAndFolderAreDeletedFromCache); + friend class GTEST_TEST_CLASS_NAME_(MetadataFileTest, MetadataFile_SourceFileExtensionDifferentCase); friend class AssetProcessorManagerTest; friend struct ModtimeScanningTest; @@ -5241,3 +5242,59 @@ void DuplicateProcessTest::SetUp() m_sharedConnection = m_assetProcessorManager->m_stateData.get(); ASSERT_TRUE(m_sharedConnection); } + +void MetadataFileTest::SetUp() +{ + AssetProcessorManagerTest::SetUp(); + m_config->AddMetaDataType("foo", "txt"); +} + +TEST_F(MetadataFileTest, MetadataFile_SourceFileExtensionDifferentCase) +{ + + using namespace AzToolsFramework::AssetSystem; + using namespace AssetProcessor; + + QDir tempPath(m_tempDir.path()); + + QString relFileName("Dummy.TXT"); + QString absPath(tempPath.absoluteFilePath("subfolder1/Dummy.TXT")); + QString watchFolder = tempPath.absoluteFilePath("subfolder1"); + UnitTestUtils::CreateDummyFile(absPath, "dummy"); + + JobEntry entry; + entry.m_watchFolderPath = watchFolder; + entry.m_databaseSourceName = entry.m_pathRelativeToWatchFolder = relFileName; + entry.m_jobKey = "txt"; + entry.m_platformInfo = { "pc", {"host", "renderer", "desktop"} }; + entry.m_jobRunKey = 1; + + QString productPath(m_normalizedCacheRootDir.absoluteFilePath("outputfile.TXT")); + UnitTestUtils::CreateDummyFile(productPath); + + AssetBuilderSDK::ProcessJobResponse jobResponse; + jobResponse.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success; + jobResponse.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(productPath.toUtf8().data())); + + QMetaObject::invokeMethod(m_assetProcessorManager.get(), "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, entry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, jobResponse)); + + ASSERT_TRUE(BlockUntilIdle(5000)); + + // Creating a metadata file for the source assets + // APM should process the source asset if a metadafile is detected + // We are intentionally having a source file with a different file extension casing than the one specified in the metadata rule. + QString metadataFile(tempPath.absoluteFilePath("subfolder1/Dummy.foo")); + UnitTestUtils::CreateDummyFile(metadataFile, "dummy"); + + // Capture the job details as the APM inspects the file. + JobDetails jobDetails; + auto connection = QObject::connect(m_assetProcessorManager.get(), &AssetProcessorManager::AssetToProcess, [&jobDetails](JobDetails job) + { + jobDetails = job; + }); + + m_assetProcessorManager->AssessAddedFile(tempPath.absoluteFilePath(metadataFile)); + + ASSERT_TRUE(BlockUntilIdle(5000)); + ASSERT_EQ(jobDetails.m_jobEntry.m_pathRelativeToWatchFolder, relFileName); +} diff --git a/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.h b/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.h index 94ba8e864f..3443a4c519 100644 --- a/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.h +++ b/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.h @@ -179,6 +179,13 @@ struct ModtimeScanningTest AZStd::unique_ptr m_data; }; + +struct MetadataFileTest + : public AssetProcessorManagerTest +{ + void SetUp() override; +}; + struct FingerprintTest : public AssetProcessorManagerTest { diff --git a/Code/Tools/AssetProcessor/native/tests/platformconfiguration/platformconfigurationtests.cpp b/Code/Tools/AssetProcessor/native/tests/platformconfiguration/platformconfigurationtests.cpp index 5654875b30..6f07901e27 100644 --- a/Code/Tools/AssetProcessor/native/tests/platformconfiguration/platformconfigurationtests.cpp +++ b/Code/Tools/AssetProcessor/native/tests/platformconfiguration/platformconfigurationtests.cpp @@ -21,6 +21,7 @@ class UnitTestPlatformConfiguration : public AssetProcessor::PlatformConfigurati { friend class GTEST_TEST_CLASS_NAME_(PlatformConfigurationUnitTests, Test_GemHandling); friend class GTEST_TEST_CLASS_NAME_(PlatformConfigurationUnitTests, Test_MetaFileTypes); + friend class GTEST_TEST_CLASS_NAME_(PlatformConfigurationUnitTests, Test_MetaFileTypes_AssetImporterExtensions); protected: }; @@ -665,3 +666,24 @@ TEST_F(PlatformConfigurationUnitTests, PlatformConfigFile_IsPresent_Found) ASSERT_TRUE(config.AddPlatformConfigFilePaths(platformConfigList)); ASSERT_EQ(platformConfigList.size(), 1); } + +TEST_F(PlatformConfigurationUnitTests, Test_MetaFileTypes_AssetImporterExtensions) +{ + using namespace AssetProcessor; + + const auto testExeFolder = AZ::IO::FileIOBase::GetInstance()->ResolvePath(TestAppRoot); + auto configRoot = AZ::IO::FileIOBase::GetInstance()->ResolvePath("@exefolder@/testdata/config_metadata"); + ASSERT_TRUE(configRoot); + UnitTestPlatformConfiguration config; + m_absorber.Clear(); + ASSERT_FALSE(config.InitializeFromConfigFiles(configRoot->c_str(), testExeFolder->c_str(), EmptyDummyProjectName, false, false)); + ASSERT_GT(m_absorber.m_numErrorsAbsorbed, 0); + ASSERT_TRUE(config.MetaDataFileTypesCount() == 2); + + QStringList entriesToTest{ "aaa", "bbb" }; + for (int idx = 0; idx < entriesToTest.size(); idx++) + { + ASSERT_EQ(config.GetMetaDataFileTypeAt(idx).first, QString("%1.assetinfo").arg(entriesToTest[idx])); + ASSERT_EQ(config.GetMetaDataFileTypeAt(idx).second, QString("%1").arg(entriesToTest[idx])); + } +} diff --git a/Code/Tools/AssetProcessor/native/utilities/PlatformConfiguration.cpp b/Code/Tools/AssetProcessor/native/utilities/PlatformConfiguration.cpp index 14ded4f98e..782e145ad6 100644 --- a/Code/Tools/AssetProcessor/native/utilities/PlatformConfiguration.cpp +++ b/Code/Tools/AssetProcessor/native/utilities/PlatformConfiguration.cpp @@ -14,6 +14,7 @@ #include #include #include +#include namespace { @@ -23,6 +24,21 @@ namespace namespace AssetProcessor { + + void AssetImporterPathsVisitor::Visit([[maybe_unused]] AZStd::string_view path, AZStd::string_view, AZ::SettingsRegistryInterface::Type, + AZStd::string_view value) + { + auto found = value.find('.'); + if (found != AZStd::string::npos) + { + m_supportedFileExtensions.emplace_back(value.substr(found + 1)); + } + else + { + m_supportedFileExtensions.emplace_back(value); + } + } + struct PlatformsInfoVisitor : AZ::SettingsRegistryInterface::Visitor { @@ -1126,6 +1142,17 @@ namespace AssetProcessor MetaDataTypesVisitor visitor; settingsRegistry->Visit(visitor, AZ::SettingsRegistryInterface::FixedValueString(AssetProcessorSettingsKey) + "/MetaDataTypes"); + + using namespace AzToolsFramework::AssetUtils; + AZStd::vector supportedFileExtensions; + AssetImporterPathsVisitor assetImporterVisitor{ settingsRegistry, supportedFileExtensions }; + settingsRegistry->Visit(assetImporterVisitor, AZ::SettingsRegistryInterface::FixedValueString(AssetImporterSettingsKey) + "/" + AssetImporterSupportedFileTypeKey); + + for (auto& entry : assetImporterVisitor.m_supportedFileExtensions) + { + visitor.m_metaDataTypes.push_back({ AZStd::string::format("%s.assetinfo", entry.c_str()), entry }); + } + for (const auto& metaDataType : visitor.m_metaDataTypes) { QString fileType = AssetUtilities::NormalizeFilePath(QString::fromUtf8(metaDataType.m_fileType.c_str(), diff --git a/Code/Tools/AssetProcessor/native/utilities/PlatformConfiguration.h b/Code/Tools/AssetProcessor/native/utilities/PlatformConfiguration.h index e70633202a..2c3615c4fc 100644 --- a/Code/Tools/AssetProcessor/native/utilities/PlatformConfiguration.h +++ b/Code/Tools/AssetProcessor/native/utilities/PlatformConfiguration.h @@ -40,6 +40,21 @@ namespace AssetProcessor extern const char AssetConfigPlatformDir[]; extern const char AssetProcessorPlatformConfigFileName[]; + struct AssetImporterPathsVisitor + : AZ::SettingsRegistryInterface::Visitor + { + AssetImporterPathsVisitor(AZ::SettingsRegistryInterface* settingsRegistry, AZStd::vector& supportedExtension) + : m_settingsRegistry(settingsRegistry) + , m_supportedFileExtensions(supportedExtension) + { + } + + void Visit(AZStd::string_view path, AZStd::string_view, AZ::SettingsRegistryInterface::Type, AZStd::string_view value) override; + + AZ::SettingsRegistryInterface* m_settingsRegistry; + AZStd::vector m_supportedFileExtensions; + }; + //! Information for a given recognizer, on a specific platform //! essentially a plain data holder, but with helper funcs class AssetPlatformSpec diff --git a/Code/Tools/AssetProcessor/testdata/config_metadata/AssetProcessorPlatformConfig.setreg b/Code/Tools/AssetProcessor/testdata/config_metadata/AssetProcessorPlatformConfig.setreg new file mode 100644 index 0000000000..9623b6268a --- /dev/null +++ b/Code/Tools/AssetProcessor/testdata/config_metadata/AssetProcessorPlatformConfig.setreg @@ -0,0 +1,16 @@ +{ + "O3DE": + { + "SceneAPI": + { + "AssetImporter": + { + "SupportedFileTypeExtensions": + [ + ".aaa", + ".bbb" + ] + } + } + } +} \ No newline at end of file diff --git a/Code/Tools/SceneAPI/SceneBuilder/SceneImportRequestHandler.cpp b/Code/Tools/SceneAPI/SceneBuilder/SceneImportRequestHandler.cpp index 65c2585baa..637fb47275 100644 --- a/Code/Tools/SceneAPI/SceneBuilder/SceneImportRequestHandler.cpp +++ b/Code/Tools/SceneAPI/SceneBuilder/SceneImportRequestHandler.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -23,19 +24,21 @@ namespace AZ { void SceneImporterSettings::Reflect(AZ::ReflectContext* context) { + using namespace AzToolsFramework::AssetUtils; if (auto serializeContext = azrtti_cast(context); serializeContext) { serializeContext->Class() ->Version(2) - ->Field("SupportedFileTypeExtensions", &SceneImporterSettings::m_supportedFileTypeExtensions); + ->Field(AssetImporterSupportedFileTypeKey, &SceneImporterSettings::m_supportedFileTypeExtensions); } } void SceneImportRequestHandler::Activate() { + using namespace AzToolsFramework::AssetUtils; if (auto* settingsRegistry = AZ::SettingsRegistry::Get()) { - settingsRegistry->GetObject(m_settings, "/O3DE/SceneAPI/AssetImporter"); + settingsRegistry->GetObject(m_settings, AssetImporterSettingsKey); } BusConnect(); From 69b5c04b7f8c6a73f010a3b7623873a26f3b7a89 Mon Sep 17 00:00:00 2001 From: AMZN-stankowi <4838196+AMZN-stankowi@users.noreply.github.com> Date: Tue, 20 Jul 2021 10:11:09 -0700 Subject: [PATCH 09/17] Cleared m_scriptFilename between scene files. (#2278) This fixes a bug where a Python script file would be run on a scene file that didn't have a script file set. Added a general case version to SceneBuilderWorker.cpp, to make it easy to mark all scene files as dirty. Automated tests for this will come in a separate pull request. Signed-off-by: stankowi <4838196+AMZN-stankowi@users.noreply.github.com> --- .../SceneData/Behaviors/ScriptProcessorRuleBehavior.cpp | 5 +++++ .../Code/Source/SceneBuilder/SceneBuilderWorker.cpp | 2 ++ 2 files changed, 7 insertions(+) diff --git a/Code/Tools/SceneAPI/SceneData/Behaviors/ScriptProcessorRuleBehavior.cpp b/Code/Tools/SceneAPI/SceneData/Behaviors/ScriptProcessorRuleBehavior.cpp index 2bec5a10c7..8924f10115 100644 --- a/Code/Tools/SceneAPI/SceneData/Behaviors/ScriptProcessorRuleBehavior.cpp +++ b/Code/Tools/SceneAPI/SceneData/Behaviors/ScriptProcessorRuleBehavior.cpp @@ -305,6 +305,11 @@ namespace AZ::SceneAPI::Behaviors { using namespace AzToolsFramework; + // This behavior persists on the same AssetBuilder. Clear the script file name so that if + // this builder processes a scene file with a script file name, and then later processes + // a scene without a script file name, it won't run the old script on the new scene. + m_scriptFilename.clear(); + if (action != ManifestAction::Update) { return Events::ProcessingResult::Ignored; diff --git a/Gems/SceneProcessing/Code/Source/SceneBuilder/SceneBuilderWorker.cpp b/Gems/SceneProcessing/Code/Source/SceneBuilder/SceneBuilderWorker.cpp index f43f1c7965..18ee0285b8 100644 --- a/Gems/SceneProcessing/Code/Source/SceneBuilder/SceneBuilderWorker.cpp +++ b/Gems/SceneProcessing/Code/Source/SceneBuilder/SceneBuilderWorker.cpp @@ -74,6 +74,8 @@ namespace SceneBuilder { m_cachedFingerprint.append(element); } + // A general catch all version fingerprint. Update this to force all FBX files to recompile. + m_cachedFingerprint.append("Version 1"); } return m_cachedFingerprint.c_str(); From d411c1d1d9e2abe0ccf0a3a980626f421cdd9782 Mon Sep 17 00:00:00 2001 From: Gene Walters <32776221+AMZN-Gene@users.noreply.github.com> Date: Tue, 20 Jul 2021 10:29:41 -0700 Subject: [PATCH 10/17] Autonomous to Authority Net Properties (#2153) * WIP. Autonomous->Authority network properties now functional. Still need some research in regards to entity ownership when it comes to the PropertyPublisher. Signed-off-by: Gene Walters * WIP. Exposing Auton->Auth Properties accessors and onchange events Signed-off-by: Gene Walters * Fix propertypublisher constructor to skip the creation state if we arent the owner. Removing ClientToServerReplicationWindow, return to just using NullReplicationWindow. Signed-off-by: Gene Walters * Reverting some wip debug prints Signed-off-by: Gene Walters * Minor whitespacing fix Signed-off-by: Gene Walters * minor undoing of whitespacing Signed-off-by: Gene Walters * NullReplicationWindow MaxReplication is 0, but now Autonomous entity updates will always be added to the send list (ignoring the max replication limit) Signed-off-by: Gene Walters * Updating PropertyPublisher comment to explicitly call out if we dont own the entity locally, the remote replicator must exist Signed-off-by: Gene Walters * Renaming RepiclationWindow GetMaxEntityReplicatorSendCount to GetMaxProxyEntityReplicatorSendCount; this number only affects the number of proxy sends and allows autonomous properties to always send Signed-off-by: Gene Walters --- .../ReplicationWindows/IReplicationWindow.h | 2 +- .../Source/AutoGen/AutoComponent_Header.jinja | 2 ++ .../Source/AutoGen/AutoComponent_Source.jinja | 2 ++ .../Source/MultiplayerSystemComponent.cpp | 1 + .../EntityReplicationManager.cpp | 22 ++++++++----------- .../EntityReplication/EntityReplicator.cpp | 8 ++----- .../EntityReplication/PropertyPublisher.cpp | 8 +++++++ .../NullReplicationWindow.cpp | 2 +- .../NullReplicationWindow.h | 2 +- .../ServerToClientReplicationWindow.cpp | 2 +- .../ServerToClientReplicationWindow.h | 2 +- 11 files changed, 29 insertions(+), 24 deletions(-) diff --git a/Gems/Multiplayer/Code/Include/Multiplayer/ReplicationWindows/IReplicationWindow.h b/Gems/Multiplayer/Code/Include/Multiplayer/ReplicationWindows/IReplicationWindow.h index 96dc3b5007..e2e4c5abfe 100644 --- a/Gems/Multiplayer/Code/Include/Multiplayer/ReplicationWindows/IReplicationWindow.h +++ b/Gems/Multiplayer/Code/Include/Multiplayer/ReplicationWindows/IReplicationWindow.h @@ -30,7 +30,7 @@ namespace Multiplayer virtual bool ReplicationSetUpdateReady() = 0; virtual const ReplicationSet& GetReplicationSet() const = 0; //! Max number of entities we can send updates for in one frame - virtual uint32_t GetMaxEntityReplicatorSendCount() const = 0; + virtual uint32_t GetMaxProxyEntityReplicatorSendCount() const = 0; virtual bool IsInWindow(const ConstNetworkEntityHandle& entityPtr, NetEntityRole& outNetworkRole) const = 0; virtual void UpdateWindow() = 0; virtual void DebugDraw() const = 0; diff --git a/Gems/Multiplayer/Code/Source/AutoGen/AutoComponent_Header.jinja b/Gems/Multiplayer/Code/Source/AutoGen/AutoComponent_Header.jinja index 79fbb4a99e..fdf1587990 100644 --- a/Gems/Multiplayer/Code/Source/AutoGen/AutoComponent_Header.jinja +++ b/Gems/Multiplayer/Code/Source/AutoGen/AutoComponent_Header.jinja @@ -459,6 +459,7 @@ namespace {{ Component.attrib['Namespace'] }} {{ DeclareNetworkPropertyGetters(Component, 'Authority', 'Server', false)|indent(8) -}} {{ DeclareNetworkPropertyGetters(Component, 'Authority', 'Client', false)|indent(8) -}} + {{ DeclareNetworkPropertyGetters(Component, 'Autonomous', 'Authority', false)|indent(8) -}} {{ DeclareArchetypePropertyGetters(Component)|indent(8) -}} {{ DeclareRpcInvocations(Component, 'Server', 'Authority', false)|indent(8) -}} {{ AutoComponentMacros.DeclareRpcEventGetters(Component, 'Authority', 'Client')|indent(8) -}} @@ -483,6 +484,7 @@ namespace {{ Component.attrib['Namespace'] }} {{ DeclareNetworkPropertyGetters(Component, 'Authority', 'Server', true)|indent(8) -}} {{ DeclareNetworkPropertyGetters(Component, 'Authority', 'Client', true)|indent(8) -}} + {{ DeclareNetworkPropertyGetters(Component, 'Autonomous', 'Authority', true)|indent(8) -}} {{ DeclareRpcInvocations(Component, 'Server', 'Authority', true)|indent(8) -}} {{ AutoComponentMacros.DeclareRpcHandlers(Component, 'Authority', 'Client', false)|indent(8) -}} {{ AutoComponentMacros.DeclareRpcSignals(Component, 'Authority', 'Client')|indent(8) -}} diff --git a/Gems/Multiplayer/Code/Source/AutoGen/AutoComponent_Source.jinja b/Gems/Multiplayer/Code/Source/AutoGen/AutoComponent_Source.jinja index aa6efae3a7..5c1a9fed3e 100644 --- a/Gems/Multiplayer/Code/Source/AutoGen/AutoComponent_Source.jinja +++ b/Gems/Multiplayer/Code/Source/AutoGen/AutoComponent_Source.jinja @@ -1548,8 +1548,10 @@ namespace {{ Component.attrib['Namespace'] }} {{ DefineNetworkPropertyGets(Component, 'Authority', 'Server', false, ComponentBaseName)|indent(4) -}} {{ DefineNetworkPropertyGets(Component, 'Authority', 'Client', false, ComponentBaseName)|indent(4) -}} +{{ DefineNetworkPropertyGets(Component, 'Autonomous', 'Authority', false, ComponentBaseName)|indent(4) -}} {{ DefineNetworkPropertyGets(Component, 'Authority', 'Server', true, ComponentBaseName)|indent(4) -}} {{ DefineNetworkPropertyGets(Component, 'Authority', 'Client', true, ComponentBaseName)|indent(4) }} +{{ DefineNetworkPropertyGets(Component, 'Autonomous', 'Authority', true, ComponentBaseName)|indent(4) }} {{ DefineArchetypePropertyGets(Component, ClassType, ComponentBaseName)|indent(4) -}} {{ DefineRpcInvocations(Component, ComponentBaseName, 'Server', 'Authority', false)|indent(4) -}} {{ DefineRpcInvocations(Component, ComponentBaseName, 'Server', 'Authority', true)|indent(4) }} diff --git a/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.cpp b/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.cpp index a796a75d7e..5fce900215 100644 --- a/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.cpp +++ b/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.cpp @@ -660,6 +660,7 @@ namespace Multiplayer AZStd::unique_ptr window = AZStd::make_unique(); reinterpret_cast(connection->GetUserData())->GetReplicationManager().SetEntityActivationTimeSliceMs(cl_defaultNetworkEntityActivationTimeSliceMs); + reinterpret_cast(connection->GetUserData())->GetReplicationManager().SetReplicationWindow(AZStd::move(window)); } } diff --git a/Gems/Multiplayer/Code/Source/NetworkEntity/EntityReplication/EntityReplicationManager.cpp b/Gems/Multiplayer/Code/Source/NetworkEntity/EntityReplication/EntityReplicationManager.cpp index 96ae19a981..b9e9a9a87e 100644 --- a/Gems/Multiplayer/Code/Source/NetworkEntity/EntityReplication/EntityReplicationManager.cpp +++ b/Gems/Multiplayer/Code/Source/NetworkEntity/EntityReplication/EntityReplicationManager.cpp @@ -185,16 +185,14 @@ namespace Multiplayer // Generate a list of all our entities that need updates EntityReplicatorList toSendList; - uint32_t elementsAdded = 0; - for (auto iter = m_replicatorsPendingSend.begin(); iter != m_replicatorsPendingSend.end() && elementsAdded < m_replicationWindow->GetMaxEntityReplicatorSendCount(); ) + uint32_t proxySendCount = 0; + for (auto iter = m_replicatorsPendingSend.begin(); iter != m_replicatorsPendingSend.end();) { - EntityReplicator* replicator = GetEntityReplicator(*iter); bool clearPendingSend = true; - if (replicator) + if (EntityReplicator* replicator = GetEntityReplicator(*iter)) { NetEntityId entityId = replicator->GetEntityHandle().GetNetEntityId(); - PropertyPublisher* propPublisher = replicator->GetPropertyPublisher(); - if (propPublisher) + if (PropertyPublisher* propPublisher = replicator->GetPropertyPublisher()) { // don't have too many replicators pending creation outstanding at a time bool canSend = true; @@ -220,19 +218,17 @@ namespace Multiplayer m_remoteEntitiesPendingCreation.insert(entityId); } - if (replicator->GetRemoteNetworkRole() == NetEntityRole::Autonomous) + if (replicator->GetRemoteNetworkRole() == NetEntityRole::Autonomous || + replicator->GetBoundLocalNetworkRole() == NetEntityRole::Autonomous) { toSendList.push_back(replicator); } - else + else if (proxySendCount < m_replicationWindow->GetMaxProxyEntityReplicatorSendCount()) { - if (elementsAdded < m_replicationWindow->GetMaxEntityReplicatorSendCount()) - { - toSendList.push_back(replicator); - } + toSendList.push_back(replicator); + ++proxySendCount; } } - ++elementsAdded; } } diff --git a/Gems/Multiplayer/Code/Source/NetworkEntity/EntityReplication/EntityReplicator.cpp b/Gems/Multiplayer/Code/Source/NetworkEntity/EntityReplication/EntityReplicator.cpp index a9a4411fcb..93fd3ea652 100644 --- a/Gems/Multiplayer/Code/Source/NetworkEntity/EntityReplication/EntityReplicator.cpp +++ b/Gems/Multiplayer/Code/Source/NetworkEntity/EntityReplication/EntityReplicator.cpp @@ -305,16 +305,12 @@ namespace Multiplayer bool EntityReplicator::RemoteManagerOwnsEntityLifetime() const { - bool ret(false); bool isServer = (GetBoundLocalNetworkRole() == NetEntityRole::Server) && (GetRemoteNetworkRole() == NetEntityRole::Authority); bool isClient = (GetBoundLocalNetworkRole() == NetEntityRole::Client) || (GetBoundLocalNetworkRole() == NetEntityRole::Autonomous); - if (isServer || isClient) - { - ret = true; - } - return ret; + + return isServer || isClient; } void EntityReplicator::MarkForRemoval() diff --git a/Gems/Multiplayer/Code/Source/NetworkEntity/EntityReplication/PropertyPublisher.cpp b/Gems/Multiplayer/Code/Source/NetworkEntity/EntityReplication/PropertyPublisher.cpp index 2ac336b90e..43815da6c5 100644 --- a/Gems/Multiplayer/Code/Source/NetworkEntity/EntityReplication/PropertyPublisher.cpp +++ b/Gems/Multiplayer/Code/Source/NetworkEntity/EntityReplication/PropertyPublisher.cpp @@ -22,6 +22,14 @@ namespace Multiplayer , m_pendingRecord(remoteNetworkRole) , m_sentRecords(net_EntityReplicatorRecordsMax) { + if ( ownsLifetime == OwnsLifetime::False ) + { + // This entity is owned by some other authority; this publisher will only be used for updating (not creating). + // Since this replicator does not own it's lifetime, the remote replicator must exist (otherwise, we would never have created a replicator that doesn't own its lifetime). + m_remoteReplicatorEstablished = true; + m_replicatorState = EntityReplicatorState::Updating; + } + AZ_Assert(m_netBindComponent, "NetBindComponent is nullptr"); m_pendingRecord.SetRemoteNetworkRole(remoteNetworkRole); } diff --git a/Gems/Multiplayer/Code/Source/ReplicationWindows/NullReplicationWindow.cpp b/Gems/Multiplayer/Code/Source/ReplicationWindows/NullReplicationWindow.cpp index 1afea2a053..7c9ee2a667 100644 --- a/Gems/Multiplayer/Code/Source/ReplicationWindows/NullReplicationWindow.cpp +++ b/Gems/Multiplayer/Code/Source/ReplicationWindows/NullReplicationWindow.cpp @@ -20,7 +20,7 @@ namespace Multiplayer return m_emptySet; } - uint32_t NullReplicationWindow::GetMaxEntityReplicatorSendCount() const + uint32_t NullReplicationWindow::GetMaxProxyEntityReplicatorSendCount() const { return 0; } diff --git a/Gems/Multiplayer/Code/Source/ReplicationWindows/NullReplicationWindow.h b/Gems/Multiplayer/Code/Source/ReplicationWindows/NullReplicationWindow.h index e66c6eb46f..91788a6b15 100644 --- a/Gems/Multiplayer/Code/Source/ReplicationWindows/NullReplicationWindow.h +++ b/Gems/Multiplayer/Code/Source/ReplicationWindows/NullReplicationWindow.h @@ -22,7 +22,7 @@ namespace Multiplayer //! @{ bool ReplicationSetUpdateReady() override; const ReplicationSet& GetReplicationSet() const override; - uint32_t GetMaxEntityReplicatorSendCount() const override; + uint32_t GetMaxProxyEntityReplicatorSendCount() const override; bool IsInWindow(const ConstNetworkEntityHandle& entityPtr, NetEntityRole& outNetworkRole) const override; void UpdateWindow() override; void DebugDraw() const override; diff --git a/Gems/Multiplayer/Code/Source/ReplicationWindows/ServerToClientReplicationWindow.cpp b/Gems/Multiplayer/Code/Source/ReplicationWindows/ServerToClientReplicationWindow.cpp index 12e4e72d27..740f9abea2 100644 --- a/Gems/Multiplayer/Code/Source/ReplicationWindows/ServerToClientReplicationWindow.cpp +++ b/Gems/Multiplayer/Code/Source/ReplicationWindows/ServerToClientReplicationWindow.cpp @@ -85,7 +85,7 @@ namespace Multiplayer return m_replicationSet; } - uint32_t ServerToClientReplicationWindow::GetMaxEntityReplicatorSendCount() const + uint32_t ServerToClientReplicationWindow::GetMaxProxyEntityReplicatorSendCount() const { return m_isPoorConnection ? sv_MinEntitiesToReplicate : sv_MaxEntitiesToReplicate; } diff --git a/Gems/Multiplayer/Code/Source/ReplicationWindows/ServerToClientReplicationWindow.h b/Gems/Multiplayer/Code/Source/ReplicationWindows/ServerToClientReplicationWindow.h index c349b9de7d..391693812d 100644 --- a/Gems/Multiplayer/Code/Source/ReplicationWindows/ServerToClientReplicationWindow.h +++ b/Gems/Multiplayer/Code/Source/ReplicationWindows/ServerToClientReplicationWindow.h @@ -44,7 +44,7 @@ namespace Multiplayer //! @{ bool ReplicationSetUpdateReady() override; const ReplicationSet& GetReplicationSet() const override; - uint32_t GetMaxEntityReplicatorSendCount() const override; + uint32_t GetMaxProxyEntityReplicatorSendCount() const override; bool IsInWindow(const ConstNetworkEntityHandle& entityPtr, NetEntityRole& outNetworkRole) const override; void UpdateWindow() override; void DebugDraw() const override; From 216542c939006c3371d012b231d5607baa8bdde7 Mon Sep 17 00:00:00 2001 From: AMZN-tpeng <82184807+AMZN-tpeng@users.noreply.github.com> Date: Tue, 20 Jul 2021 11:24:35 -0700 Subject: [PATCH 11/17] =?UTF-8?q?[ATOM][RHI][Vulkan][Android]=20-=20pick?= =?UTF-8?q?=20the=20correct=20share=20mode=20based=20on=20f=E2=80=A6=20(#2?= =?UTF-8?q?166)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [ATOM][RHI][Vulkan][Android] - pick the correct share mode based on flags and size of queue families Signed-off-by: Peng --- Gems/Atom/RHI/Vulkan/Code/Source/RHI/Device.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/Device.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/Device.cpp index 4e7a13444b..6d3080dce8 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/Device.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/Device.cpp @@ -815,11 +815,12 @@ namespace AZ createInfo.size = descriptor.m_byteCount; createInfo.usage = GetBufferUsageFlagBitsUnderRestrictions(descriptor.m_bindFlags); // Trying to guess here if the buffers are going to be used as attachments. Maybe it would be better to add an explicit flag in the descriptor. - createInfo.sharingMode = - RHI::CheckBitsAny( - descriptor.m_bindFlags, - RHI::BufferBindFlags::ShaderWrite | RHI::BufferBindFlags::Predication | RHI::BufferBindFlags::Indirect) - ? VK_SHARING_MODE_EXCLUSIVE + createInfo.sharingMode = + (RHI::CheckBitsAny( + descriptor.m_bindFlags, + RHI::BufferBindFlags::ShaderWrite | RHI::BufferBindFlags::Predication | RHI::BufferBindFlags::Indirect) || + (queueFamilies.size()) <= 1) + ? VK_SHARING_MODE_EXCLUSIVE : VK_SHARING_MODE_CONCURRENT; createInfo.queueFamilyIndexCount = static_cast(queueFamilies.size()); createInfo.pQueueFamilyIndices = queueFamilies.empty() ? nullptr : queueFamilies.data(); From e5983dd2afa1576518ba32c7287296eab0b6af21 Mon Sep 17 00:00:00 2001 From: Jeremy Ong <87345238+jeremyong-az@users.noreply.github.com> Date: Tue, 20 Jul 2021 13:38:12 -0600 Subject: [PATCH 12/17] Terminate AssetProcessor when spawned by the parent project process (#2272) * Terminate AssetProcessor when spawned by the parent project process Signed-off-by: Jeremy Ong * Maintain default behavior (leaving AP running on quit) To enable the autotermination feature, the ap_tether_lifetime CVAR is provided. Signed-off-by: Jeremy Ong --- .../AssetSystemComponentHelper_Windows.cpp | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/Code/Framework/AzFramework/Platform/Windows/AzFramework/Asset/AssetSystemComponentHelper_Windows.cpp b/Code/Framework/AzFramework/Platform/Windows/AzFramework/Asset/AssetSystemComponentHelper_Windows.cpp index e1d400ecfc..4b685b25a3 100644 --- a/Code/Framework/AzFramework/Platform/Windows/AzFramework/Asset/AssetSystemComponentHelper_Windows.cpp +++ b/Code/Framework/AzFramework/Platform/Windows/AzFramework/Asset/AssetSystemComponentHelper_Windows.cpp @@ -6,6 +6,7 @@ * */ +#include #include #include #include @@ -13,6 +14,9 @@ #include +AZ_CVAR(bool, ap_tether_lifetime, false, nullptr, AZ::ConsoleFunctorFlags::Null, + "If enabled, a parent process that launches the AP will terminate the AP on exit"); + namespace AzFramework::AssetSystem::Platform { void AllowAssetProcessorToForeground() @@ -100,6 +104,21 @@ namespace AzFramework::AssetSystem::Platform fullLaunchCommand += '"'; } + // Create or retrieve the job handle associated with the asset processor + HANDLE apJob = nullptr; + + if (ap_tether_lifetime) + { + apJob = ::CreateJobObjectA(nullptr, "AssetProcessorJob"); + if (apJob && GetLastError() != ERROR_ALREADY_EXISTS) + { + // We're creating the job for the first time. Configure it to close child processes when this process exits. + JOBOBJECT_EXTENDED_LIMIT_INFORMATION info = {}; + info.BasicLimitInformation.LimitFlags = JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE; + ::SetInformationJobObject(apJob, JobObjectExtendedLimitInformation, &info, sizeof(info)); + } + } + STARTUPINFO si; ZeroMemory(&si, sizeof(si)); si.cb = sizeof(si); @@ -107,6 +126,14 @@ namespace AzFramework::AssetSystem::Platform si.wShowWindow = SW_MINIMIZE; PROCESS_INFORMATION pi; - return ::CreateProcessA(nullptr, fullLaunchCommand.data(), nullptr, nullptr, FALSE, 0, nullptr, AZ::IO::FixedMaxPathString{ executableDirectory }.c_str(), &si, &pi) != 0; + bool createResult = ::CreateProcessA(nullptr, fullLaunchCommand.data(), nullptr, nullptr, FALSE, 0, nullptr, AZ::IO::FixedMaxPathString{ executableDirectory }.c_str(), &si, &pi) != 0; + + if (ap_tether_lifetime && apJob && createResult) + { + // Save process and thread handle to terminate AP when the parent process exits + ::AssignProcessToJobObject(apJob, pi.hProcess); + } + + return createResult; } } From a32a521a80813595ff60d939c004be190998accd Mon Sep 17 00:00:00 2001 From: Junbo Liang <68558268+junbo75@users.noreply.github.com> Date: Tue, 20 Jul 2021 13:39:54 -0700 Subject: [PATCH 13/17] Update automation tests for the AWS gems to reduce the run time (#2148) Simplify the automation tests to reduce the time they cost on Jenkins --- .../aws_metrics_automation_test.py | 213 +- .../aws_metrics/aws_metrics_custom_thread.py | 29 + .../Windows/aws_metrics/aws_metrics_utils.py | 6 +- .../PythonTests/AWS/Windows/cdk/cdk_utils.py | 56 +- ....py => aws_client_auth_automation_test.py} | 50 +- .../client_auth/test_anonymous_credentials.py | 77 - .../core/test_aws_resource_interaction.py | 188 +- .../resource_mappings/resource_mappings.py | 36 - .../Gem/PythonTests/AWS/conftest.py | 65 +- .../Levels/AWS/ClientAuth/ClientAuth.ly | 4 +- .../ConitoAnonymousAuthorization.scriptcanvas | 2020 ++-- .../AWS/ClientAuth/LevelData/Environment.xml | 1 - .../AWS/ClientAuth/LevelData/TimeOfDay.xml | 1 - .../Levels/AWS/ClientAuth/filelist.xml | 2 +- .../Levels/AWS/ClientAuth/level.pak | 4 +- .../ClientAuthPasswordSignIn.ly | 4 +- .../PasswordSignIn.scriptcanvas | 8462 ++++++++--------- .../AWS/ClientAuthPasswordSignIn/filelist.xml | 2 +- .../AWS/ClientAuthPasswordSignIn/level.pak | 4 +- .../ClientAuthPasswordSignUp.ly | 4 +- .../PasswordSignUp.scriptcanvas | 3100 +++--- .../AWS/ClientAuthPasswordSignUp/filelist.xml | 2 +- .../AWS/ClientAuthPasswordSignUp/level.pak | 4 +- .../Levels/AWS/Metrics/Script/Metrics.lua | 10 +- .../ScriptCanvas/dynamodbdemo.scriptcanvas | 3755 ++++---- .../ScriptCanvas/lambdademo.scriptcanvas | 2167 +++-- .../ScriptCanvas/s3demo.scriptcanvas | 6141 ++++++------ 27 files changed, 13115 insertions(+), 13292 deletions(-) create mode 100644 AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_custom_thread.py rename AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/{test_password_signin.py => aws_client_auth_automation_test.py} (65%) delete mode 100644 AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/test_anonymous_credentials.py delete mode 100644 AutomatedTesting/Levels/AWS/ClientAuth/LevelData/Environment.xml delete mode 100644 AutomatedTesting/Levels/AWS/ClientAuth/LevelData/TimeOfDay.xml diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_automation_test.py b/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_automation_test.py index cc864a095e..cd8858e7f2 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_automation_test.py +++ b/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_automation_test.py @@ -8,58 +8,43 @@ SPDX-License-Identifier: Apache-2.0 OR MIT import logging import os import pytest -import time import typing from datetime import datetime import ly_test_tools.log.log_monitor # fixture imports -from AWS.Windows.resource_mappings.resource_mappings import resource_mappings from assetpipeline.ap_fixtures.asset_processor_fixture import asset_processor from .aws_metrics_utils import aws_metrics_utils +from .aws_metrics_custom_thread import AWSMetricsThread AWS_METRICS_FEATURE_NAME = 'AWSMetrics' GAME_LOG_NAME = 'Game.log' +CONTEXT_VARIABLE = ['-c', 'batch_processing=true'] logger = logging.getLogger(__name__) -def setup(launcher: ly_test_tools.launchers.Launcher, - cdk: pytest.fixture, - asset_processor: asset_processor, - resource_mappings: resource_mappings, - context_variable: str = '') -> typing.Tuple[ly_test_tools.log.log_monitor.LogMonitor, str, str]: +def setup(launcher: pytest.fixture, + asset_processor: pytest.fixture) -> pytest.fixture: """ - Set up the CDK application and start the log monitor. + Set up the resource mapping configuration and start the log monitor. :param launcher: Client launcher for running the test level. - :param cdk: CDK application for deploying the AWS resources. :param asset_processor: asset_processor fixture. - :param resource_mappings: resource_mappings fixture. - :param context_variable: context_variable for enable optional CDK feature. :return log monitor object, metrics file path and the metrics stack name. """ - logger.info(f'Cdk stack names:\n{cdk.list()}') - stacks = cdk.deploy(context_variable=context_variable) - resource_mappings.populate_output_keys(stacks) - asset_processor.start() asset_processor.wait_for_idle() - metrics_file_path = os.path.join(launcher.workspace.paths.project(), 'user', - AWS_METRICS_FEATURE_NAME, 'metrics.json') - remove_file(metrics_file_path) - file_to_monitor = os.path.join(launcher.workspace.paths.project_log(), GAME_LOG_NAME) - remove_file(file_to_monitor) # Initialize the log monitor. log_monitor = ly_test_tools.log.log_monitor.LogMonitor(launcher=launcher, log_file_path=file_to_monitor) - return log_monitor, metrics_file_path, stacks[0] + return log_monitor -def monitor_metrics_submission(log_monitor: ly_test_tools.log.log_monitor.LogMonitor) -> None: +def monitor_metrics_submission(log_monitor: pytest.fixture) -> None: """ Monitor the messages and notifications for submitting metrics. :param log_monitor: Log monitor to check the log messages. @@ -67,6 +52,7 @@ def monitor_metrics_submission(log_monitor: ly_test_tools.log.log_monitor.LogMon expected_lines = [ '(Script) - Submitted metrics without buffer.', '(Script) - Submitted metrics with buffer.', + '(Script) - Flushed the buffered metrics.', '(Script) - Metrics is sent successfully.' ] @@ -87,87 +73,132 @@ def monitor_metrics_submission(log_monitor: ly_test_tools.log.log_monitor.LogMon f'unexpected_lines values: {unexpected_lines}') -def remove_file(file_path: str) -> None: +def query_metrics_from_s3(aws_metrics_utils: pytest.fixture, stack_name: str) -> None: """ - Remove a local file and its directory. - :param file_path: Path to the local file. + Verify that the metrics events are delivered to the S3 bucket and can be queried. + aws_metrics_utils: aws_metrics_utils fixture. + stack_name: name of the CloudFormation stack. """ - if os.path.exists(file_path): - os.remove(file_path) + analytics_bucket_name = aws_metrics_utils.get_analytics_bucket_name(stack_name) + aws_metrics_utils.verify_s3_delivery(analytics_bucket_name) + logger.info('Metrics are sent to S3.') - file_dir = os.path.dirname(file_path) - if os.path.exists(file_dir) and len(os.listdir(file_dir)) == 0: - os.rmdir(file_dir) + aws_metrics_utils.run_glue_crawler(f'{stack_name}-EventsCrawler') + aws_metrics_utils.run_named_queries(f'{stack_name}-AthenaWorkGroup') + logger.info('Query metrics from S3 successfully.') + # Empty the S3 bucket. S3 buckets can only be deleted successfully when it doesn't contain any object. + aws_metrics_utils.empty_batch_analytics_bucket(analytics_bucket_name) + + +def verify_operational_metrics(aws_metrics_utils: pytest.fixture, stack_name: str, start_time: datetime) -> None: + """ + Verify that operational health metrics are delivered to CloudWatch. + aws_metrics_utils: aws_metrics_utils fixture. + stack_name: name of the CloudFormation stack. + start_time: Time when the game launcher starts. + """ + aws_metrics_utils.verify_cloud_watch_delivery( + 'AWS/Lambda', + 'Invocations', + [{'Name': 'FunctionName', + 'Value': f'{stack_name}-AnalyticsProcessingLambdaName'}], + start_time) + logger.info('AnalyticsProcessingLambda metrics are sent to CloudWatch.') + + aws_metrics_utils.verify_cloud_watch_delivery( + 'AWS/Lambda', + 'Invocations', + [{'Name': 'FunctionName', + 'Value': f'{stack_name}-EventsProcessingLambda'}], + start_time) + logger.info('EventsProcessingLambda metrics are sent to CloudWatch.') + + +def start_kinesis_analytics_application(aws_metrics_utils: pytest.fixture, stack_name: str) -> None: + """ + Start the Kinesis analytics application for real-time analytics. + aws_metrics_utils: aws_metrics_utils fixture. + stack_name: name of the CloudFormation stack. + """ + analytics_application_name = f'{stack_name}-AnalyticsApplication' + aws_metrics_utils.start_kinesis_data_analytics_application(analytics_application_name) @pytest.mark.SUITE_periodic @pytest.mark.usefixtures('automatic_process_killer') @pytest.mark.parametrize('project', ['AutomatedTesting']) @pytest.mark.parametrize('level', ['AWS/Metrics']) @pytest.mark.parametrize('feature_name', [AWS_METRICS_FEATURE_NAME]) +@pytest.mark.usefixtures('resource_mappings') @pytest.mark.parametrize('resource_mappings_filename', ['default_aws_resource_mappings.json']) +@pytest.mark.usefixtures('aws_credentials') @pytest.mark.parametrize('profile_name', ['AWSAutomationTest']) @pytest.mark.parametrize('region_name', ['us-west-2']) @pytest.mark.parametrize('assume_role_arn', ['arn:aws:iam::645075835648:role/o3de-automation-tests']) +@pytest.mark.usefixtures('cdk') @pytest.mark.parametrize('session_name', ['o3de-Automation-session']) +@pytest.mark.parametrize('deployment_params', [CONTEXT_VARIABLE]) class TestAWSMetricsWindows(object): - def test_realtime_analytics_metrics_sent_to_cloudwatch(self, - level: str, - launcher: ly_test_tools.launchers.Launcher, - asset_processor: pytest.fixture, - workspace: pytest.fixture, - aws_utils: pytest.fixture, - aws_credentials: pytest.fixture, - resource_mappings: pytest.fixture, - cdk: pytest.fixture, - aws_metrics_utils: aws_metrics_utils, - ): - """ - Tests that the submitted metrics are sent to CloudWatch for real-time analytics. - """ - log_monitor, metrics_file_path, stack_name = setup(launcher, cdk, asset_processor, resource_mappings) + """ + Test class to verify the real-time and batch analytics for metrics. + """ - # Start the Kinesis Data Analytics application for real-time analytics. - analytics_application_name = f'{stack_name}-AnalyticsApplication' - aws_metrics_utils.start_kinesis_data_analytics_application(analytics_application_name) + @pytest.mark.parametrize('destroy_stacks_on_teardown', [False]) + def test_realtime_and_batch_analytics(self, + level: str, + launcher: pytest.fixture, + asset_processor: pytest.fixture, + workspace: pytest.fixture, + aws_utils: pytest.fixture, + cdk: pytest.fixture, + aws_metrics_utils: pytest.fixture): + """ + Verify that the metrics events are sent to CloudWatch and S3 for analytics. + """ + # Start Kinesis analytics application on a separate thread to avoid blocking the test. + kinesis_analytics_application_thread = AWSMetricsThread(target=start_kinesis_analytics_application, + args=(aws_metrics_utils, cdk.stacks[0])) + kinesis_analytics_application_thread.start() + log_monitor = setup(launcher, asset_processor) + # Kinesis analytics application needs to be in the running state before we start the game launcher. + kinesis_analytics_application_thread.join() launcher.args = ['+LoadLevel', level] launcher.args.extend(['-rhi=null']) - + start_time = datetime.utcnow() with launcher.start(launch_ap=False): - start_time = datetime.utcnow() monitor_metrics_submission(log_monitor) - # Verify that operational health metrics are delivered to CloudWatch. - aws_metrics_utils.verify_cloud_watch_delivery( - 'AWS/Lambda', - 'Invocations', - [{'Name': 'FunctionName', - 'Value': f'{stack_name}-AnalyticsProcessingLambdaName'}], - start_time) - logger.info('Operational health metrics sent to CloudWatch.') + # Verify that real-time analytics metrics are delivered to CloudWatch. aws_metrics_utils.verify_cloud_watch_delivery( AWS_METRICS_FEATURE_NAME, 'TotalLogins', [], start_time) - logger.info('Real-time metrics sent to CloudWatch.') + logger.info('Real-time metrics are sent to CloudWatch.') - # Stop the Kinesis Data Analytics application. - aws_metrics_utils.stop_kinesis_data_analytics_application(analytics_application_name) + # Run time-consuming verifications on separate threads to avoid blocking the test. + verification_threads = list() + verification_threads.append( + AWSMetricsThread(target=query_metrics_from_s3, args=(aws_metrics_utils, cdk.stacks[0]))) + verification_threads.append( + AWSMetricsThread(target=verify_operational_metrics, args=(aws_metrics_utils, cdk.stacks[0], start_time))) + for thread in verification_threads: + thread.start() + for thread in verification_threads: + thread.join() + @pytest.mark.parametrize('destroy_stacks_on_teardown', [True]) def test_unauthorized_user_request_rejected(self, level: str, - launcher: ly_test_tools.launchers.Launcher, - cdk: pytest.fixture, - aws_credentials: pytest.fixture, + launcher: pytest.fixture, asset_processor: pytest.fixture, - resource_mappings: pytest.fixture, workspace: pytest.fixture): """ - Tests that unauthorized users cannot send metrics events to the AWS backed backend. + Verify that unauthorized users cannot send metrics events to the AWS backed backend. """ - log_monitor, metrics_file_path, stack_name = setup(launcher, cdk, asset_processor, resource_mappings) + log_monitor = setup(launcher, asset_processor) + # Set invalid AWS credentials. launcher.args = ['+LoadLevel', level, '+cl_awsAccessKey', 'AKIAIOSFODNN7EXAMPLE', '+cl_awsSecretKey', 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY'] @@ -180,51 +211,3 @@ class TestAWSMetricsWindows(object): halt_on_unexpected=True) assert result, 'Metrics events are sent successfully by unauthorized user' logger.info('Unauthorized user is rejected to send metrics.') - - def test_batch_analytics_metrics_delivered_to_s3(self, - level: str, - launcher: ly_test_tools.launchers.Launcher, - cdk: pytest.fixture, - aws_credentials: pytest.fixture, - asset_processor: pytest.fixture, - resource_mappings: pytest.fixture, - aws_utils: pytest.fixture, - aws_metrics_utils: aws_metrics_utils, - workspace: pytest.fixture): - """ - Tests that the submitted metrics are sent to the data lake for batch analytics. - """ - log_monitor, metrics_file_path, stack_name = setup(launcher, cdk, asset_processor, resource_mappings, - context_variable='batch_processing=true') - - analytics_bucket_name = aws_metrics_utils.get_analytics_bucket_name(stack_name) - - launcher.args = ['+LoadLevel', level] - launcher.args.extend(['-rhi=null']) - - with launcher.start(launch_ap=False): - start_time = datetime.utcnow() - monitor_metrics_submission(log_monitor) - # Verify that operational health metrics are delivered to CloudWatch. - aws_metrics_utils.verify_cloud_watch_delivery( - 'AWS/Lambda', - 'Invocations', - [{'Name': 'FunctionName', - 'Value': f'{stack_name}-EventsProcessingLambda'}], - start_time) - logger.info('Operational health metrics sent to CloudWatch.') - - aws_metrics_utils.verify_s3_delivery(analytics_bucket_name) - logger.info('Metrics sent to S3.') - - # Run the glue crawler to populate the AWS Glue Data Catalog with tables. - aws_metrics_utils.run_glue_crawler(f'{stack_name}-EventsCrawler') - # Run named queries on the table to verify the batch analytics. - aws_metrics_utils.run_named_queries(f'{stack_name}-AthenaWorkGroup') - logger.info('Query metrics from S3 successfully.') - - # Kinesis Data Firehose buffers incoming data before it delivers it to Amazon S3. Sleep for the - # default interval (60s) to make sure that all the metrics are sent to the bucket before cleanup. - time.sleep(60) - # Empty the S3 bucket. S3 buckets can only be deleted successfully when it doesn't contain any object. - aws_metrics_utils.empty_s3_bucket(analytics_bucket_name) diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_custom_thread.py b/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_custom_thread.py new file mode 100644 index 0000000000..1bba9c3e39 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_custom_thread.py @@ -0,0 +1,29 @@ +""" +Copyright (c) Contributors to the Open 3D Engine Project. +For complete copyright and license terms please see the LICENSE at the root of this distribution. + +SPDX-License-Identifier: Apache-2.0 OR MIT +""" + +from threading import Thread + + +class AWSMetricsThread(Thread): + """ + Custom thread for raising assertion errors on the main thread. + """ + def __init__(self, **kwargs): + super().__init__(**kwargs) + self._error = None + + def run(self) -> None: + try: + super().run() + except AssertionError as e: + self._error = e + + def join(self, **kwargs) -> None: + super().join(**kwargs) + + if self._error: + raise AssertionError(self._error) diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_utils.py b/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_utils.py index 59773d401c..97cd563651 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_utils.py +++ b/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_utils.py @@ -13,7 +13,6 @@ import typing from datetime import datetime from botocore.exceptions import WaiterError -from AWS.common.aws_utils import AwsUtils from .aws_metrics_waiters import KinesisAnalyticsApplicationUpdatedWaiter, \ CloudWatchMetricsDeliveredWaiter, DataLakeMetricsDeliveredWaiter, GlueCrawlerReadyWaiter @@ -29,7 +28,7 @@ class AWSMetricsUtils: Provide utils functions for the AWSMetrics gem to interact with the deployed resources. """ - def __init__(self, aws_utils: AwsUtils): + def __init__(self, aws_utils: pytest.fixture): self._aws_util = aws_utils def start_kinesis_data_analytics_application(self, application_name: str) -> None: @@ -199,14 +198,13 @@ class AWSMetricsUtils: assert state == 'SUCCEEDED', f'Failed to run the named query {named_query.get("Name", {})}' - def empty_s3_bucket(self, bucket_name: str) -> None: + def empty_batch_analytics_bucket(self, bucket_name: str) -> None: """ Empty the S3 bucket following: https://boto3.amazonaws.com/v1/documentation/api/latest/guide/migrations3.html :param bucket_name: Name of the S3 bucket. """ - s3 = self._aws_util.resource('s3') bucket = s3.Bucket(bucket_name) diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/cdk/cdk_utils.py b/AutomatedTesting/Gem/PythonTests/AWS/Windows/cdk/cdk_utils.py index 4c4a9716d2..3643c3bb36 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/Windows/cdk/cdk_utils.py +++ b/AutomatedTesting/Gem/PythonTests/AWS/Windows/cdk/cdk_utils.py @@ -72,15 +72,14 @@ class Cdk: f'\nError:{error.stderr}') def setup(self, cdk_path: str, project: str, account_id: str, - workspace: pytest.fixture, session: boto3.session.Session, bootstrap_required: bool): + workspace: pytest.fixture, session: boto3.session.Session): """ :param cdk_path: Path where cdk app.py is stored. :param project: Project name used for cdk project name env variable. :param account_id: AWS account id to use with cdk application. :param workspace: ly_test_tools workspace fixture. - :param workspace: bootstrap_required deploys bootstrap stack. + :param session: Current boto3 session, provides credentials and region. """ - self._cdk_env = os.environ.copy() unique_id = uuid.uuid4().hex[-4:] self._cdk_env['O3DE_AWS_PROJECT_NAME'] = project[:4] + unique_id if len(project) > 4 else project + unique_id @@ -104,8 +103,7 @@ class Cdk: logger.info(f'Installing cdk python dependencies: {output}') - if bootstrap_required: - self.bootstrap() + self.bootstrap() def bootstrap(self) -> None: """ @@ -124,15 +122,19 @@ class Cdk: logger.warning(f'Failed creating Bootstrap stack {BOOTSTRAP_STACK_NAME} not found. ' f'\nError:{clientError["Error"]["Message"]}') - def list(self) -> List[str]: + def list(self, deployment_params: List[str] = None) -> List[str]: """ - lists cdk stack names - :return List of cdk stack names + lists cdk stack names. + :param deployment_params: Deployment parameters like --all can be passed in this way. + :return List of cdk stack names. """ if not self._cdk_path: return [] list_cdk_application_cmd = ['cdk', 'list'] + if deployment_params: + list_cdk_application_cmd.extend(deployment_params) + output = process_utils.check_output( list_cdk_application_cmd, cwd=self._cdk_path, @@ -141,36 +143,36 @@ class Cdk: return output.splitlines() - def synthesize(self) -> None: + def synthesize(self, deployment_params: List[str] = None) -> None: """ - Synthesizes all cdk stacks + Synthesizes all cdk stacks. + :param deployment_params: Deployment parameters like --all can be passed in this way. """ if not self._cdk_path: return - list_cdk_application_cmd = ['cdk', 'synth'] + synth_cdk_application_cmd = ['cdk', 'synth'] + if deployment_params: + synth_cdk_application_cmd.extend(deployment_params) process_utils.check_output( - list_cdk_application_cmd, + synth_cdk_application_cmd, cwd=self._cdk_path, env=self._cdk_env, shell=True) - def deploy(self, context_variable: str = '', additonal_params: List[str] = None) -> List[str]: + def deploy(self, deployment_params: List[str] = None) -> List[str]: """ Deploys all the CDK stacks. - :param context_variable: Context variable for enabling optional features. - :param additonal_params: Additonal parameters like --all can be passed in this way. + :param deployment_params: Deployment parameters like --all can be passed in this way. :return List of deployed stack arns. """ if not self._cdk_path: return [] deploy_cdk_application_cmd = ['cdk', 'deploy', '--require-approval', 'never'] - if additonal_params: - deploy_cdk_application_cmd.extend(additonal_params) - if context_variable: - deploy_cdk_application_cmd.extend(['-c', f'{context_variable}']) + if deployment_params: + deploy_cdk_application_cmd.extend(deployment_params) output = process_utils.check_output( deploy_cdk_application_cmd, @@ -178,21 +180,23 @@ class Cdk: env=self._cdk_env, shell=True) - stacks = [] for line in output.splitlines(): line_sections = line.split('/') assert len(line_sections), 3 - stacks.append(line.split('/')[-2]) + self._stacks.append(line.split('/')[-2]) - return stacks + return self._stacks - def destroy(self) -> None: + def destroy(self, deployment_params: List[str] = None) -> None: """ Destroys the cdk application. + :param deployment_params: Deployment parameters like --all can be passed in this way. """ logger.info(f'CDK Path {self._cdk_path}') - destroy_cdk_application_cmd = ['cdk', 'destroy', '--all', '-f'] + destroy_cdk_application_cmd = ['cdk', 'destroy', '-f'] + if deployment_params: + destroy_cdk_application_cmd.extend(deployment_params) try: process_utils.check_output( @@ -238,3 +242,7 @@ class Cdk: # self._session.client('cloudformation').delete_stack( # StackName=BOOTSTRAP_STACK_NAME # ) + + @property + def stacks(self): + return self._stacks diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/test_password_signin.py b/AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/aws_client_auth_automation_test.py similarity index 65% rename from AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/test_password_signin.py rename to AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/aws_client_auth_automation_test.py index db0e17fa89..bdd1eea469 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/test_password_signin.py +++ b/AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/aws_client_auth_automation_test.py @@ -10,10 +10,7 @@ import logging import ly_test_tools.log.log_monitor # fixture imports -from AWS.Windows.resource_mappings.resource_mappings import resource_mappings -from AWS.Windows.cdk.cdk_utils import Cdk -from AWS.common.aws_utils import AwsUtils -from assetpipeline.ap_fixtures.asset_processor_fixture import asset_processor as asset_processor +from assetpipeline.ap_fixtures.asset_processor_fixture import asset_processor AWS_PROJECT_NAME = 'AWS-AutomationTest' AWS_CLIENT_AUTH_FEATURE_NAME = 'AWSClientAuth' @@ -37,11 +34,47 @@ logger = logging.getLogger(__name__) @pytest.mark.parametrize('region_name', ['us-west-2']) @pytest.mark.parametrize('assume_role_arn', ['arn:aws:iam::645075835648:role/o3de-automation-tests']) @pytest.mark.parametrize('session_name', ['o3de-Automation-session']) -class TestAWSClientAuthPasswordSignIn(object): +@pytest.mark.usefixtures('cdk') +@pytest.mark.parametrize('deployment_params', [[]]) +class TestAWSClientAuthWindows(object): """ - Test class to verify AWS Cognito IDP Password sign in and Cognito Identity pool authenticated authorization. + Test class to verify AWS Client Auth gem features on Windows. """ + @pytest.mark.parametrize('level', ['AWS/ClientAuth']) + @pytest.mark.parametrize('destroy_stacks_on_teardown', [False]) + def test_anonymous_credentials(self, + level: str, + launcher: pytest.fixture, + resource_mappings: pytest.fixture, + workspace: pytest.fixture, + asset_processor: pytest.fixture + ): + """ + Test to verify AWS Cognito Identity pool anonymous authorization. + + Setup: Deploys cdk and updates resource mapping file. + Tests: Getting credentials when no credentials are configured + Verification: Log monitor looks for success credentials log. + """ + asset_processor.start() + asset_processor.wait_for_idle() + + file_to_monitor = os.path.join(launcher.workspace.paths.project_log(), GAME_LOG_NAME) + log_monitor = ly_test_tools.log.log_monitor.LogMonitor(launcher=launcher, log_file_path=file_to_monitor) + + launcher.args = ['+LoadLevel', level] + launcher.args.extend(['-rhi=null']) + + with launcher.start(launch_ap=False): + result = log_monitor.monitor_log_for_lines( + expected_lines=['(Script) - Success anonymous credentials'], + unexpected_lines=['(Script) - Fail anonymous credentials'], + halt_on_unexpected=True, + ) + assert result, 'Anonymous credentials fetched successfully.' + + @pytest.mark.parametrize('destroy_stacks_on_teardown', [True]) def test_password_signin_credentials(self, launcher: pytest.fixture, cdk: pytest.fixture, @@ -51,13 +84,12 @@ class TestAWSClientAuthPasswordSignIn(object): aws_utils: pytest.fixture ): """ + Test to verify AWS Cognito IDP Password sign in and Cognito Identity pool authenticated authorization. + Setup: Deploys cdk and updates resource mapping file. Tests: Sign up new test user, admin confirm the user, sign in and get aws credentials. Verification: Log monitor looks for success credentials log. """ - logger.info(f'Cdk stack names:\n{cdk.list()}') - stacks = cdk.deploy() - resource_mappings.populate_output_keys(stacks) asset_processor.start() asset_processor.wait_for_idle() diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/test_anonymous_credentials.py b/AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/test_anonymous_credentials.py deleted file mode 100644 index 379096c2a8..0000000000 --- a/AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/test_anonymous_credentials.py +++ /dev/null @@ -1,77 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" -import pytest -import os -import logging -import ly_test_tools.log.log_monitor - -# fixture imports -from AWS.Windows.resource_mappings.resource_mappings import resource_mappings -from AWS.Windows.cdk.cdk_utils import Cdk -from AWS.common.aws_utils import AwsUtils -from assetpipeline.ap_fixtures.asset_processor_fixture import asset_processor as asset_processor - -AWS_PROJECT_NAME = 'AWS-AutomationTest' -AWS_CLIENT_AUTH_FEATURE_NAME = 'AWSClientAuth' -AWS_CLIENT_AUTH_DEFAULT_PROFILE_NAME = 'default' - -GAME_LOG_NAME = 'Game.log' - -logger = logging.getLogger(__name__) - - -@pytest.mark.SUITE_periodic -@pytest.mark.usefixtures('automatic_process_killer') -@pytest.mark.usefixtures('asset_processor') -@pytest.mark.usefixtures('workspace') -@pytest.mark.parametrize('project', ['AutomatedTesting']) -@pytest.mark.parametrize('level', ['AWS/ClientAuth']) -@pytest.mark.usefixtures('cdk') -@pytest.mark.parametrize('feature_name', [AWS_CLIENT_AUTH_FEATURE_NAME]) -@pytest.mark.usefixtures('resource_mappings') -@pytest.mark.parametrize('resource_mappings_filename', ['default_aws_resource_mappings.json']) -@pytest.mark.usefixtures('aws_utils') -@pytest.mark.parametrize('region_name', ['us-west-2']) -@pytest.mark.parametrize('assume_role_arn', ['arn:aws:iam::645075835648:role/o3de-automation-tests']) -@pytest.mark.parametrize('session_name', ['o3de-Automation-session']) -class TestAWSClientAuthAnonymousCredentials(object): - """ - Test class to verify AWS Cognito Identity pool anonymous authorization. - """ - - def test_anonymous_credentials(self, - level: str, - launcher: pytest.fixture, - cdk: pytest.fixture, - resource_mappings: pytest.fixture, - workspace: pytest.fixture, - asset_processor: pytest.fixture - ): - """ - Setup: Deploys cdk and updates resource mapping file. - Tests: Getting AWS credentials for no signed in user. - Verification: Log monitor looks for success credentials log. - """ - logger.info(f'Cdk stack names:\n{cdk.list()}') - stacks = cdk.deploy() - resource_mappings.populate_output_keys(stacks) - asset_processor.start() - asset_processor.wait_for_idle() - - file_to_monitor = os.path.join(launcher.workspace.paths.project_log(), GAME_LOG_NAME) - log_monitor = ly_test_tools.log.log_monitor.LogMonitor(launcher=launcher, log_file_path=file_to_monitor) - - launcher.args = ['+LoadLevel', level] - launcher.args.extend(['-rhi=null']) - - with launcher.start(launch_ap=False): - result = log_monitor.monitor_log_for_lines( - expected_lines=['(Script) - Success anonymous credentials'], - unexpected_lines=['(Script) - Fail anonymous credentials'], - halt_on_unexpected=True, - ) - assert result, 'Anonymous credentials fetched successfully.' diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/core/test_aws_resource_interaction.py b/AutomatedTesting/Gem/PythonTests/AWS/Windows/core/test_aws_resource_interaction.py index 8fc4706d3c..55f06660e8 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/Windows/core/test_aws_resource_interaction.py +++ b/AutomatedTesting/Gem/PythonTests/AWS/Windows/core/test_aws_resource_interaction.py @@ -7,7 +7,8 @@ SPDX-License-Identifier: Apache-2.0 OR MIT import os import logging -import time +import typing +import shutil import pytest import ly_test_tools @@ -16,7 +17,6 @@ import ly_test_tools.environment.process_utils as process_utils import ly_test_tools.o3de.asset_processor_utils as asset_processor_utils from botocore.exceptions import ClientError -from AWS.Windows.resource_mappings.resource_mappings import resource_mappings from assetpipeline.ap_fixtures.asset_processor_fixture import asset_processor AWS_CORE_FEATURE_NAME = 'AWSCore' @@ -29,18 +29,49 @@ GAME_LOG_NAME = 'Game.log' logger = logging.getLogger(__name__) -def setup(launcher: pytest.fixture, cdk: pytest.fixture, resource_mappings: pytest.fixture, asset_processor: pytest.fixture): +def setup(launcher: pytest.fixture, asset_processor: pytest.fixture) -> typing.Tuple[pytest.fixture, str]: + """ + Set up the resource mapping configuration and start the log monitor. + :param launcher: Client launcher for running the test level. + :param asset_processor: asset_processor fixture. + :return log monitor object, metrics file path and the metrics stack name. + """ + # Create the temporary directory for downloading test file from S3. + user_dir = os.path.join(launcher.workspace.paths.project(), 'user') + s3_download_dir = os.path.join(user_dir, 's3_download') + if not os.path.exists(s3_download_dir): + os.makedirs(s3_download_dir) + asset_processor_utils.kill_asset_processor() - logger.info(f'Cdk stack names:\n{cdk.list()}') - stacks = cdk.deploy(additonal_params=['--all']) - resource_mappings.populate_output_keys(stacks) asset_processor.start() asset_processor.wait_for_idle() file_to_monitor = os.path.join(launcher.workspace.paths.project_log(), GAME_LOG_NAME) log_monitor = ly_test_tools.log.log_monitor.LogMonitor(launcher=launcher, log_file_path=file_to_monitor) - return log_monitor + return log_monitor, s3_download_dir + + +def write_test_data_to_dynamodb_table(resource_mappings: pytest.fixture, aws_utils: pytest.fixture) -> None: + """ + Write test data to the DynamoDB table created by the CDK application. + :param resource_mappings: resource_mappings fixture. + :param aws_utils: aws_utils fixture. + """ + table_name = resource_mappings.get_resource_name_id("AWSCore.ExampleDynamoTableOutput") + try: + aws_utils.client('dynamodb').put_item( + TableName=table_name, + Item={ + 'id': { + 'S': 'Item1' + } + } + ) + logger.info(f'Loaded data into table {table_name}') + except ClientError: + logger.exception(f'Failed to load data into table {table_name}') + raise @pytest.mark.SUITE_periodic @@ -58,130 +89,57 @@ def setup(launcher: pytest.fixture, cdk: pytest.fixture, resource_mappings: pyte @pytest.mark.parametrize('resource_mappings_filename', [AWS_RESOURCE_MAPPING_FILE_NAME]) @pytest.mark.usefixtures('aws_credentials') @pytest.mark.parametrize('profile_name', ['AWSAutomationTest']) +@pytest.mark.usefixtures('cdk') +@pytest.mark.parametrize('deployment_params', [['--all']]) +@pytest.mark.parametrize('destroy_stacks_on_teardown', [True]) class TestAWSCoreAWSResourceInteraction(object): """ - Test class to verify AWSCore can downloading a file from S3. + Test class to verify the scripting behavior for the AWSCore gem. """ - def test_download_from_s3(self, - level: str, - launcher: pytest.fixture, - cdk: pytest.fixture, - workspace: pytest.fixture, - asset_processor: pytest.fixture, - resource_mappings: pytest.fixture - ): + + @pytest.mark.parametrize('expected_lines', [ + ['(Script) - [S3] Head object request is done', + '(Script) - [S3] Head object success: Object example.txt is found.', + '(Script) - [S3] Get object success: Object example.txt is downloaded.', + '(Script) - [Lambda] Completed Invoke', + '(Script) - [Lambda] Invoke success: {"statusCode": 200, "body": {}}', + '(Script) - [DynamoDB] Results finished']]) + @pytest.mark.parametrize('unexpected_lines', [ + ['(Script) - [S3] Head object error: No response body.', + '(Script) - [S3] Get object error: Request validation failed, output file directory doesn\'t exist.', + '(Script) - Request validation failed, output file miss full path.', + '(Script) - ']]) + def test_scripting_behavior(self, + level: str, + launcher: pytest.fixture, + workspace: pytest.fixture, + asset_processor: pytest.fixture, + resource_mappings: pytest.fixture, + aws_utils: pytest.fixture, + expected_lines: typing.List[str], + unexpected_lines: typing.List[str]): """ Setup: Deploys cdk and updates resource mapping file. - Tests: Getting AWS credentials for no signed in user. - Verification: Log monitor looks for success download. The existence and contents of the file are also verified. + Tests: Interact with AWS S3, DynamoDB and Lambda services. + Verification: Script canvas nodes can communicate with AWS services successfully. """ - log_monitor = setup(launcher, cdk, resource_mappings, asset_processor) + log_monitor, s3_download_dir = setup(launcher, asset_processor) + write_test_data_to_dynamodb_table(resource_mappings, aws_utils) launcher.args = ['+LoadLevel', level] launcher.args.extend(['-rhi=null']) - user_dir = os.path.join(workspace.paths.project(), 'user') - download_dir = os.path.join(user_dir, 's3_download') - if not os.path.exists(download_dir): - os.makedirs(download_dir) - with launcher.start(launch_ap=False): result = log_monitor.monitor_log_for_lines( - expected_lines=['(Script) - [S3] Head object request is done', - '(Script) - [S3] Head object success: Object example.txt is found.', - '(Script) - [S3] Get object success: Object example.txt is downloaded.'], - unexpected_lines=['(Script) - [S3] Head object error: No response body.', - '(Script) - [S3] Get object error: Request validation failed, output file directory doesn\'t exist.'], + expected_lines=expected_lines, + unexpected_lines=unexpected_lines, halt_on_unexpected=True ) assert result, "Expected lines weren't found." - download_path = os.path.join(download_dir, 'output.txt') - - file_was_downloaded = os.path.exists(download_path) + assert os.path.exists(os.path.join(s3_download_dir, 'output.txt')), \ + 'The expected file wasn\'t successfully downloaded.' # clean up the file directories. - if file_was_downloaded: - os.remove(download_path) - os.rmdir(download_dir) - - assert file_was_downloaded, 'The expected file wasn\'t successfully downloaded' - - def test_invoke_lambda(self, - level: str, - launcher: pytest.fixture, - cdk: pytest.fixture, - resource_mappings: pytest.fixture, - workspace: pytest.fixture, - asset_processor: pytest.fixture - ): - """ - Setup: Deploys the CDK. - Tests: Runs the test level. - Verification: Searches the logs for the expected output from the example lambda. - """ - - log_monitor = setup(launcher, cdk, resource_mappings, asset_processor) - - launcher.args = ['+LoadLevel', level] - launcher.args.extend(['-rhi=null']) - - with launcher.start(launch_ap=False): - result = log_monitor.monitor_log_for_lines( - expected_lines=['(Script) - [Lambda] Completed Invoke', - '(Script) - [Lambda] Invoke success: {"statusCode": 200, "body": {}}'], - unexpected_lines=['(Script) - Request validation failed, output file miss full path.', - '(Script) - '], - halt_on_unexpected=True - ) - - assert result - - def test_get_dynamodb_value(self, - level: str, - launcher: pytest.fixture, - cdk: pytest.fixture, - resource_mappings: pytest.fixture, - workspace: pytest.fixture, - asset_processor: pytest.fixture, - aws_utils: pytest.fixture, - ): - """ - Setup: Deploys the CDK application - Test: Runs a launcher with a level that loads a scriptcanvas that pulls a DynamoDB table value. - Verification: The value is output in the logs and verified by the test. - """ - - def write_test_table_data(): - client = aws_utils.client('dynamodb') - table_name = resource_mappings.get_resource_name_id("AWSCore.ExampleDynamoTableOutput") - try: - client.put_item( - TableName=table_name, - Item={ - 'id': { - 'S': 'Item1' - } - } - ) - logger.info(f'Loaded data into table {table_name}') - except ClientError: - logger.exception(f'Failed to load data into table {table_name}') - raise - - log_monitor = setup(launcher, cdk, resource_mappings, asset_processor) - write_test_table_data() - - launcher.args = ['+LoadLevel', level] - launcher.args.extend(['-rhi=null']) - - with launcher.start(launch_ap=False): - result = log_monitor.monitor_log_for_lines( - expected_lines=['(Script) - [DynamoDB] Results finished'], - unexpected_lines=['(Script) - Request validation failed, output file miss full path.', - '(Script) - '], - halt_on_unexpected=True - ) - - assert result + shutil.rmtree(s3_download_dir) diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/resource_mappings/resource_mappings.py b/AutomatedTesting/Gem/PythonTests/AWS/Windows/resource_mappings/resource_mappings.py index 6a3ac49129..fd679de99d 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/Windows/resource_mappings/resource_mappings.py +++ b/AutomatedTesting/Gem/PythonTests/AWS/Windows/resource_mappings/resource_mappings.py @@ -6,7 +6,6 @@ SPDX-License-Identifier: Apache-2.0 OR MIT """ import os -from os.path import abspath import pytest import json import logging @@ -107,38 +106,3 @@ class ResourceMappings: def get_resource_name_id(self, resource_key: str): return self._resource_mappings[AWS_RESOURCE_MAPPINGS_KEY][resource_key]['Name/ID'] - - -@pytest.fixture(scope='function') -def resource_mappings( - request: pytest.fixture, - project: str, - feature_name: str, - resource_mappings_filename: str, - workspace: pytest.fixture, - aws_utils: pytest.fixture) -> ResourceMappings: - """ - Fixture for setting up resource mappings file. - :param request: _pytest.fixtures.SubRequest class that handles getting - a pytest fixture from a pytest function/fixture. - :param project: Project to find resource mapping file. - :param feature_name: AWS Gem name that is prepended to resource mapping keys. - :param resource_mappings_filename: Name of resource mapping file. - :param workspace: ly_test_tools workspace fixture. - :param aws_utils: AWS utils fixture. - :return: ResourceMappings class object. - """ - - path = f'{workspace.paths.engine_root()}/{project}/Config/{resource_mappings_filename}' - logger.info(f'Resource mapping path : {path}') - logger.info(f'Resource mapping resolved path : {abspath(path)}') - resource_mappings_obj = ResourceMappings(abspath(path), aws_utils.assume_session().region_name, feature_name, - aws_utils.assume_account_id(), workspace, - aws_utils.client('cloudformation')) - - def teardown(): - resource_mappings_obj.clear_output_keys() - - request.addfinalizer(teardown) - - return resource_mappings_obj diff --git a/AutomatedTesting/Gem/PythonTests/AWS/conftest.py b/AutomatedTesting/Gem/PythonTests/AWS/conftest.py index 06a6fe3a72..6ad495ab66 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/conftest.py +++ b/AutomatedTesting/Gem/PythonTests/AWS/conftest.py @@ -4,11 +4,15 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ -import pytest import logging +from os.path import abspath +import pytest +import typing + from AWS.common.aws_utils import AwsUtils from AWS.common.aws_credentials import AwsCredentials from AWS.Windows.cdk.cdk_utils import Cdk +from AWS.Windows.resource_mappings.resource_mappings import ResourceMappings logger = logging.getLogger(__name__) @@ -42,6 +46,41 @@ def aws_utils( pytest.cdk_obj = None +@pytest.fixture(scope='function') +def resource_mappings( + request: pytest.fixture, + project: str, + feature_name: str, + resource_mappings_filename: str, + workspace: pytest.fixture, + aws_utils: pytest.fixture) -> ResourceMappings: + """ + Fixture for setting up resource mappings file. + :param request: _pytest.fixtures.SubRequest class that handles getting + a pytest fixture from a pytest function/fixture. + :param project: Project to find resource mapping file. + :param feature_name: AWS Gem name that is prepended to resource mapping keys. + :param resource_mappings_filename: Name of resource mapping file. + :param workspace: ly_test_tools workspace fixture. + :param aws_utils: AWS utils fixture. + :return: ResourceMappings class object. + """ + + path = f'{workspace.paths.engine_root()}/{project}/Config/{resource_mappings_filename}' + logger.info(f'Resource mapping path : {path}') + logger.info(f'Resource mapping resolved path : {abspath(path)}') + resource_mappings_obj = ResourceMappings(abspath(path), aws_utils.assume_session().region_name, feature_name, + aws_utils.assume_account_id(), workspace, + aws_utils.client('cloudformation')) + + def teardown(): + resource_mappings_obj.clear_output_keys() + + request.addfinalizer(teardown) + + return resource_mappings_obj + + @pytest.fixture(scope='function') def cdk( request: pytest.fixture, @@ -49,8 +88,9 @@ def cdk( feature_name: str, workspace: pytest.fixture, aws_utils: pytest.fixture, - bootstrap_required: bool = True, - destroy_stacks_on_teardown: bool = True) -> Cdk: + resource_mappings: pytest.fixture, + deployment_params: typing.List[str], + destroy_stacks_on_teardown: bool) -> Cdk: """ Fixture for setting up a Cdk :param request: _pytest.fixtures.SubRequest class that handles getting @@ -59,8 +99,8 @@ def cdk( :param feature_name: Feature gem name to expect cdk folder in. :param workspace: ly_test_tools workspace fixture. :param aws_utils: aws_utils fixture. - :param bootstrap_required: Whether the bootstrap stack needs to be created to - provision resources the AWS CDK needs to perform the deployment. + :param resource_mappings: resource_mappings fixture. + :param deployment_params: Parameters for the CDK application deployment. :param destroy_stacks_on_teardown: option to control calling destroy ot the end of test. :return Cdk class object. """ @@ -70,22 +110,27 @@ def cdk( if pytest.cdk_obj is None: pytest.cdk_obj = Cdk() + pytest.cdk_obj.setup(cdk_path, project, aws_utils.assume_account_id(), workspace, aws_utils.assume_session()) + + stacks = pytest.cdk_obj.deploy(deployment_params=deployment_params) + + logger.info(f'Cdk stack names:\n{stacks}') + resource_mappings.populate_output_keys(stacks) - pytest.cdk_obj.setup(cdk_path, project, aws_utils.assume_account_id(), workspace, aws_utils.assume_session(), - bootstrap_required) def teardown(): if destroy_stacks_on_teardown: - pytest.cdk_obj.destroy() + pytest.cdk_obj.destroy(deployment_params=deployment_params) # Enable after https://github.com/aws/aws-cdk/issues/986 is fixed. # Until then clean the bootstrap bucket manually. - # cdk_obj.remove_bootstrap_stack() + # pytest.cdk_obj.remove_bootstrap_stack() + + pytest.cdk_obj = None request.addfinalizer(teardown) return pytest.cdk_obj - @pytest.fixture(scope='function') def aws_credentials(request: pytest.fixture, aws_utils: pytest.fixture, profile_name: str): """ diff --git a/AutomatedTesting/Levels/AWS/ClientAuth/ClientAuth.ly b/AutomatedTesting/Levels/AWS/ClientAuth/ClientAuth.ly index af8a7f5c8e..b4a2d6cb3a 100644 --- a/AutomatedTesting/Levels/AWS/ClientAuth/ClientAuth.ly +++ b/AutomatedTesting/Levels/AWS/ClientAuth/ClientAuth.ly @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f0f4d4e0155feaa76c80a14128000a0fd9570ab76e79f4847eaef9006324a4d2 -size 9084 +oid sha256:19f2c4454bb395cdc0a36d1e45e6a384bbd23037af1a2fb93e088ecfa0f10e5b +size 9343 diff --git a/AutomatedTesting/Levels/AWS/ClientAuth/ConitoAnonymousAuthorization.scriptcanvas b/AutomatedTesting/Levels/AWS/ClientAuth/ConitoAnonymousAuthorization.scriptcanvas index a2bbdfce39..6cbd951fae 100644 --- a/AutomatedTesting/Levels/AWS/ClientAuth/ConitoAnonymousAuthorization.scriptcanvas +++ b/AutomatedTesting/Levels/AWS/ClientAuth/ConitoAnonymousAuthorization.scriptcanvas @@ -3,12 +3,12 @@ - + - + @@ -16,783 +16,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -1210,21 +434,21 @@ - + - + - + @@ -1262,7 +486,7 @@ - + @@ -1300,7 +524,7 @@ - + @@ -1338,7 +562,7 @@ - + @@ -1376,7 +600,7 @@ - + @@ -1414,7 +638,7 @@ - + @@ -1423,11 +647,6 @@ - - - - - @@ -1457,7 +676,7 @@ - + @@ -1495,7 +714,7 @@ - + @@ -1533,7 +752,7 @@ - + @@ -1571,7 +790,7 @@ - + @@ -1607,16 +826,18 @@ - + - - - + + + + + @@ -1635,14 +856,14 @@ - + - + @@ -1659,14 +880,14 @@ - + - + @@ -1681,12 +902,681 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1790,42 +1680,118 @@ - - - + - + - - - - - - - + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -1835,7 +1801,7 @@ - + @@ -1843,7 +1809,7 @@ - + @@ -1856,7 +1822,7 @@ - + @@ -1866,7 +1832,7 @@ - + @@ -1874,7 +1840,7 @@ - + @@ -1887,7 +1853,7 @@ - + @@ -1897,7 +1863,7 @@ - + @@ -1905,7 +1871,7 @@ - + @@ -1916,15 +1882,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + @@ -1932,88 +1928,41 @@ - + - - + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - + @@ -2021,7 +1970,7 @@ - + @@ -2047,7 +1996,7 @@ - + @@ -2068,49 +2017,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -2120,8 +2027,8 @@ - - + + @@ -2131,10 +2038,72 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2153,11 +2122,25 @@ + + + + + + + + + - - - - + + + + + + + + + @@ -2168,9 +2151,17 @@ - - - + + + + + + + + + + + @@ -2178,41 +2169,46 @@ - + - - - - - - - - - - - + + + - + + + + + + + + + + + + + + + + + + + + - - - - - - - + @@ -2220,41 +2216,41 @@ - + - - - - + + + - - - - + + + - + - - - + + + + - - - + + + + @@ -2264,14 +2260,6 @@ - - - - - - - - @@ -2280,6 +2268,14 @@ + + + + + + + + @@ -2304,22 +2300,24 @@ - + - - - - - - - - - + + + + + + + + + + + diff --git a/AutomatedTesting/Levels/AWS/ClientAuth/LevelData/Environment.xml b/AutomatedTesting/Levels/AWS/ClientAuth/LevelData/Environment.xml deleted file mode 100644 index d4e3d33551..0000000000 --- a/AutomatedTesting/Levels/AWS/ClientAuth/LevelData/Environment.xml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/AutomatedTesting/Levels/AWS/ClientAuth/LevelData/TimeOfDay.xml b/AutomatedTesting/Levels/AWS/ClientAuth/LevelData/TimeOfDay.xml deleted file mode 100644 index d827d4da29..0000000000 --- a/AutomatedTesting/Levels/AWS/ClientAuth/LevelData/TimeOfDay.xml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/AutomatedTesting/Levels/AWS/ClientAuth/filelist.xml b/AutomatedTesting/Levels/AWS/ClientAuth/filelist.xml index 56c3f1efd4..6b5b5a8727 100644 --- a/AutomatedTesting/Levels/AWS/ClientAuth/filelist.xml +++ b/AutomatedTesting/Levels/AWS/ClientAuth/filelist.xml @@ -1,6 +1,6 @@ - + diff --git a/AutomatedTesting/Levels/AWS/ClientAuth/level.pak b/AutomatedTesting/Levels/AWS/ClientAuth/level.pak index 8da6f7f7d6..bd791070e9 100644 --- a/AutomatedTesting/Levels/AWS/ClientAuth/level.pak +++ b/AutomatedTesting/Levels/AWS/ClientAuth/level.pak @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:da041115014f11696d5878d5c21247c17b8d694fa9674e30692259261a7223a2 -size 3792 +oid sha256:8a674e05824e5ceec13a0487b318923568710bc8269e5be84adad59c495a7ceb +size 3610 diff --git a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/ClientAuthPasswordSignIn.ly b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/ClientAuthPasswordSignIn.ly index 24fe4f2482..40d9ad619c 100644 --- a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/ClientAuthPasswordSignIn.ly +++ b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/ClientAuthPasswordSignIn.ly @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:43b1a23b62fe2ffa05545ac99524f40b6fff49d6e35925b9d6138c00d8082e86 -size 9073 +oid sha256:a1c0b621525b8e88c3775ea4c60c2197d1e1b060ace9bad9d6efcb0532817e44 +size 9356 diff --git a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/PasswordSignIn.scriptcanvas b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/PasswordSignIn.scriptcanvas index 1a135f3e2c..1847f1f0ec 100644 --- a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/PasswordSignIn.scriptcanvas +++ b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/PasswordSignIn.scriptcanvas @@ -3,34 +3,34 @@ - + - + - + - + - + - + @@ -68,7 +68,7 @@ - + @@ -106,7 +106,7 @@ - + @@ -144,7 +144,7 @@ - + @@ -182,7 +182,7 @@ - + @@ -220,1007 +220,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -1258,7 +258,7 @@ - + @@ -1296,7 +296,7 @@ - + @@ -1334,7 +334,7 @@ - + @@ -1372,7 +372,7 @@ - + @@ -1410,7 +410,7 @@ - + @@ -1448,7 +448,7 @@ - + @@ -1486,7 +486,7 @@ - + @@ -1524,7 +524,7 @@ - + @@ -1562,7 +562,7 @@ - + @@ -1600,7 +600,7 @@ - + @@ -1638,7 +638,7 @@ - + @@ -1676,7 +676,7 @@ - + @@ -1714,7 +714,7 @@ - + @@ -1752,7 +752,7 @@ - + @@ -1790,7 +790,7 @@ - + @@ -1828,7 +828,7 @@ - + @@ -1866,7 +866,7 @@ - + @@ -1904,7 +904,7 @@ - + @@ -1942,7 +942,7 @@ - + @@ -1980,7 +980,7 @@ - + @@ -2018,7 +1018,7 @@ - + @@ -2056,7 +1056,7 @@ - + @@ -2094,7 +1094,7 @@ - + @@ -2132,7 +1132,7 @@ - + @@ -2181,20 +1181,20 @@ - + - + - + - + @@ -2211,14 +1211,14 @@ - + - + @@ -2235,14 +1235,14 @@ - + - + @@ -2259,14 +1259,14 @@ - + - + @@ -2283,14 +1283,14 @@ - + - + @@ -2307,14 +1307,14 @@ - + - + @@ -2331,14 +1331,14 @@ - + - + @@ -2355,14 +1355,14 @@ - + - + @@ -2379,7 +1379,7 @@ - + @@ -2399,14 +1399,14 @@ - + - + @@ -2423,14 +1423,14 @@ - + - + @@ -2447,14 +1447,14 @@ - + - + @@ -2474,21 +1474,59 @@ - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2526,7 +1564,7 @@ - + @@ -2564,7 +1602,2981 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2619,105 +4631,472 @@ - + - + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2725,7 +5104,7 @@ - + @@ -2733,14 +5112,14 @@ - + - + @@ -2778,7 +5157,7 @@ - + @@ -2831,645 +5210,21 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + @@ -3507,7 +5262,7 @@ - + @@ -3562,1883 +5317,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -5446,14 +5325,14 @@ - + - + @@ -5491,7 +5370,7 @@ - + @@ -5529,11 +5408,117 @@ - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -5546,245 +5531,28 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + @@ -5794,28 +5562,245 @@ - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -5829,9 +5814,8 @@ - - + @@ -5839,7 +5823,91 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -5850,7 +5918,7 @@ - + @@ -5858,14 +5926,14 @@ - + - + @@ -5886,7 +5954,138 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -5905,14 +6104,14 @@ - + - + @@ -5933,29 +6132,40 @@ - + - - + + - + + + + + + - - + + + + + + + + - + - + @@ -5964,18 +6174,12 @@ - - - - - - - + @@ -5983,7 +6187,7 @@ - + @@ -6003,7 +6207,7 @@ - + @@ -6017,7 +6221,7 @@ - + @@ -6025,7 +6229,7 @@ - + @@ -6043,15 +6247,15 @@ - - - + + + - - - + + + @@ -6059,7 +6263,7 @@ - + @@ -6067,7 +6271,7 @@ - + @@ -6085,15 +6289,15 @@ - - - + + + - - - + + + @@ -6101,46 +6305,20 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - - - - - + @@ -6148,96 +6326,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -6256,14 +6345,14 @@ - + - + @@ -6284,7 +6373,7 @@ - + @@ -6292,7 +6381,49 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -6312,7 +6443,7 @@ - + @@ -6324,167 +6455,16 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - + @@ -6492,11 +6472,11 @@ - + - + @@ -6508,17 +6488,21 @@ - - + + - + + + + + @@ -6526,29 +6510,31 @@ - + - + - + - - - - - - - + + + + + + + + + @@ -6565,9 +6551,9 @@ - + - + diff --git a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/filelist.xml b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/filelist.xml index f3e20f9b63..ce3f3f3407 100644 --- a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/filelist.xml +++ b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/filelist.xml @@ -1,6 +1,6 @@ - + diff --git a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/level.pak b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/level.pak index 49349b01e1..1af55520b6 100644 --- a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/level.pak +++ b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/level.pak @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a58292341785cb260dc0ccf346259e35e2817ee48fc401a21ab528f6afb97b52 -size 3551 +oid sha256:f318a1787069385de291660f79e350cea2ca2c3ef3b5e0576686066bd9c49395 +size 3667 diff --git a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/ClientAuthPasswordSignUp.ly b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/ClientAuthPasswordSignUp.ly index 3500584d99..b3f66ff34a 100644 --- a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/ClientAuthPasswordSignUp.ly +++ b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/ClientAuthPasswordSignUp.ly @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f3d5121b26608b02747e245071ccff29ac57358cb6349ec9495a7a003ac12467 -size 8942 +oid sha256:afc5d665128738e6bea09e78a16ee38acc923a8ecefff90d987858ce72c395fa +size 9360 diff --git a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/PasswordSignUp.scriptcanvas b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/PasswordSignUp.scriptcanvas index 632d27d5b0..f630d4aba3 100644 --- a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/PasswordSignUp.scriptcanvas +++ b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/PasswordSignUp.scriptcanvas @@ -3,12 +3,12 @@ - + - + @@ -16,7 +16,1249 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1266,364 +2508,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -2871,905 +3756,11 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -3779,7 +3770,7 @@ - + @@ -3787,7 +3778,7 @@ - + @@ -3800,7 +3791,7 @@ - + @@ -3810,7 +3801,7 @@ - + @@ -3818,7 +3809,7 @@ - + @@ -3831,7 +3822,7 @@ - + @@ -3841,7 +3832,7 @@ - + @@ -3849,7 +3840,7 @@ - + @@ -3862,7 +3853,7 @@ - + @@ -3872,7 +3863,7 @@ - + @@ -3880,7 +3871,7 @@ - + @@ -3893,25 +3884,25 @@ - + - + - + - + - + @@ -3928,9 +3919,8 @@ - - + @@ -3938,113 +3928,22 @@ - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -4052,123 +3951,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -4177,10 +3959,25 @@ - - + + - + + + + + + + + + + + + + + + + @@ -4189,6 +3986,152 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4200,7 +4143,7 @@ - + @@ -4221,56 +4164,33 @@ - + - - + + - - - - - - - - - - - - - - - - - - - - - + + + + + + - + - - - - - - - - - - - - + + + + @@ -4281,12 +4201,20 @@ - - - - + + + + + + + + + + + + @@ -4294,7 +4222,7 @@ - + @@ -4302,7 +4230,69 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4313,11 +4303,11 @@ - + - + @@ -4328,18 +4318,18 @@ - - - - - - - - + + + + + + + + @@ -4356,20 +4346,22 @@ - + - - - - - - - + + + + + + + + + diff --git a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/filelist.xml b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/filelist.xml index a9b73a9fb3..6565342dd4 100644 --- a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/filelist.xml +++ b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/filelist.xml @@ -1,6 +1,6 @@ - + diff --git a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/level.pak b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/level.pak index 85d3c59f9b..781de219f7 100644 --- a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/level.pak +++ b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/level.pak @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:605391d415b828b100bada11d108099520c0b6a020f17588887b610475805d90 -size 3546 +oid sha256:87882b64688a77815d93c6973929fa21b89dc6c13d4866c710124ce2cd0f411e +size 3652 diff --git a/AutomatedTesting/Levels/AWS/Metrics/Script/Metrics.lua b/AutomatedTesting/Levels/AWS/Metrics/Script/Metrics.lua index c7f86313f9..bbf6bad8c5 100644 --- a/AutomatedTesting/Levels/AWS/Metrics/Script/Metrics.lua +++ b/AutomatedTesting/Levels/AWS/Metrics/Script/Metrics.lua @@ -30,9 +30,6 @@ function metrics:OnSendMetricsFailure(requestId, errorMessage) end function metrics:OnDeactivate() - AWSMetricsRequestBus.Broadcast.FlushMetrics() - Debug.Log("Stop generating new test events and flushed the buffered metrics.") - self.tickBusHandler:Disconnect() self.metricsNotificationHandler:Disconnect() end @@ -40,7 +37,7 @@ end function metrics:OnTick(deltaTime, timePoint) self.tickTime = self.tickTime + deltaTime - if self.tickTime > 2.0 then + if self.tickTime > 5.0 then defaultAttribute = AWSMetrics_MetricsAttribute() defaultAttribute:SetName("event_name") defaultAttribute:SetStrValue("login") @@ -57,6 +54,9 @@ function metrics:OnTick(deltaTime, timePoint) if self.numSubmittedMetricsEvents % 2 == 0 then if AWSMetricsRequestBus.Broadcast.SubmitMetrics(attributeList.attributes, 0, "lua", false) then Debug.Log("Submitted metrics without buffer.") + + AWSMetricsRequestBus.Broadcast.FlushMetrics() + Debug.Log("Flushed the buffered metrics.") else Debug.Log("Failed to Submit metrics without buffer.") end @@ -67,7 +67,7 @@ function metrics:OnTick(deltaTime, timePoint) Debug.Log("Failed to Submit metrics with buffer.") end end - + self.numSubmittedMetricsEvents = self.numSubmittedMetricsEvents + 1 self.tickTime = 0 end diff --git a/AutomatedTesting/ScriptCanvas/dynamodbdemo.scriptcanvas b/AutomatedTesting/ScriptCanvas/dynamodbdemo.scriptcanvas index 52654666f8..286ac12551 100644 --- a/AutomatedTesting/ScriptCanvas/dynamodbdemo.scriptcanvas +++ b/AutomatedTesting/ScriptCanvas/dynamodbdemo.scriptcanvas @@ -3,12 +3,12 @@ - + - + @@ -16,1214 +16,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -1641,7 +434,7 @@ - + @@ -1664,11 +457,7 @@ - - - - - + @@ -1707,11 +496,7 @@ - - - - - + @@ -1868,178 +653,141 @@ - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2047,113 +795,66 @@ - + - + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + - + - + @@ -2176,11 +877,7 @@ - - - - - + @@ -2318,7 +1015,1176 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2422,11 +2288,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -2436,7 +2408,7 @@ - + @@ -2444,7 +2416,7 @@ - + @@ -2457,7 +2429,7 @@ - + @@ -2467,7 +2439,7 @@ - + @@ -2475,7 +2447,7 @@ - + @@ -2488,7 +2460,7 @@ - + @@ -2498,7 +2470,7 @@ - + @@ -2506,7 +2478,7 @@ - + @@ -2519,7 +2491,7 @@ - + @@ -2529,7 +2501,7 @@ - + @@ -2537,7 +2509,7 @@ - + @@ -2550,7 +2522,7 @@ - + @@ -2560,7 +2532,7 @@ - + @@ -2568,7 +2540,7 @@ - + @@ -2581,7 +2553,7 @@ - + @@ -2591,7 +2563,7 @@ - + @@ -2599,7 +2571,7 @@ - + @@ -2612,7 +2584,7 @@ - + @@ -2622,7 +2594,7 @@ - + @@ -2630,7 +2602,7 @@ - + @@ -2643,38 +2615,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -2684,7 +2625,7 @@ - + @@ -2692,7 +2633,7 @@ - + @@ -2705,7 +2646,7 @@ - + @@ -2715,7 +2656,7 @@ - + @@ -2723,7 +2664,7 @@ - + @@ -2736,7 +2677,7 @@ - + @@ -2746,7 +2687,7 @@ - + @@ -2754,7 +2695,7 @@ - + @@ -2767,7 +2708,7 @@ - + @@ -2777,7 +2718,7 @@ - + @@ -2785,7 +2726,7 @@ - + @@ -2798,7 +2739,7 @@ - + @@ -2808,7 +2749,7 @@ - + @@ -2816,7 +2757,7 @@ - + @@ -2827,15 +2768,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + @@ -2843,96 +2814,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -2945,135 +2827,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -3083,10 +2837,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -3100,7 +2898,175 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3113,7 +3079,7 @@ - + @@ -3134,7 +3100,7 @@ - + @@ -3142,77 +3108,22 @@ - + - - - - - - - - - - - - - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -3223,12 +3134,47 @@ - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3247,54 +3193,32 @@ - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -3302,14 +3226,14 @@ - + - + @@ -3322,7 +3246,54 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3338,18 +3309,6 @@ - - - - - - - - - - - - @@ -3362,6 +3321,18 @@ + + + + + + + + + + + + diff --git a/AutomatedTesting/ScriptCanvas/lambdademo.scriptcanvas b/AutomatedTesting/ScriptCanvas/lambdademo.scriptcanvas index d1ad940ccf..ec4b161711 100644 --- a/AutomatedTesting/ScriptCanvas/lambdademo.scriptcanvas +++ b/AutomatedTesting/ScriptCanvas/lambdademo.scriptcanvas @@ -3,12 +3,12 @@ - + - + @@ -16,7 +16,7 @@ - + @@ -434,7 +434,7 @@ - + @@ -483,49 +483,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -565,46 +522,16 @@ - - - - - - - - - - - - - - - - + - + - - - - - - - - + - - - - - - - - - - + + @@ -613,632 +540,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -1656,7 +958,7 @@ - + @@ -1705,6 +1007,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1744,58 +1085,666 @@ - + + + + + + + + + + + + + + + + - + - - - + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -1805,7 +1754,7 @@ - + @@ -1813,7 +1762,7 @@ - + @@ -1826,7 +1775,7 @@ - + @@ -1836,7 +1785,7 @@ - + @@ -1844,7 +1793,7 @@ - + @@ -1857,7 +1806,7 @@ - + @@ -1867,7 +1816,7 @@ - + @@ -1875,7 +1824,7 @@ - + @@ -1888,7 +1837,7 @@ - + @@ -1898,7 +1847,7 @@ - + @@ -1906,7 +1855,7 @@ - + @@ -1919,7 +1868,7 @@ - + @@ -1929,7 +1878,7 @@ - + @@ -1937,7 +1886,7 @@ - + @@ -1950,7 +1899,7 @@ - + @@ -1960,7 +1909,7 @@ - + @@ -1968,7 +1917,7 @@ - + @@ -1979,15 +1928,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + @@ -1995,329 +1974,10 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2336,12 +1996,158 @@ + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2351,8 +2157,8 @@ - - + + @@ -2360,26 +2166,199 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + diff --git a/AutomatedTesting/ScriptCanvas/s3demo.scriptcanvas b/AutomatedTesting/ScriptCanvas/s3demo.scriptcanvas index c87c647d60..925cc9da26 100644 --- a/AutomatedTesting/ScriptCanvas/s3demo.scriptcanvas +++ b/AutomatedTesting/ScriptCanvas/s3demo.scriptcanvas @@ -3,12 +3,12 @@ - + - + @@ -16,2340 +16,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -2967,7 +634,333 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3073,7 +1066,7 @@ - + @@ -3081,14 +1074,14 @@ - + - + @@ -3126,7 +1119,46 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3161,16 +1193,46 @@ - + + + + + + + + + + + + + + + + - + - + + + + + + + + - + + + + + + + + + + - @@ -3179,172 +1241,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -3962,7 +1859,1189 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4024,11 +3103,7 @@ - - - - - + @@ -4139,11 +3214,896 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -4153,7 +4113,7 @@ - + @@ -4161,7 +4121,7 @@ - + @@ -4174,7 +4134,7 @@ - + @@ -4184,7 +4144,7 @@ - + @@ -4192,7 +4152,7 @@ - + @@ -4205,7 +4165,7 @@ - + @@ -4215,7 +4175,7 @@ - + @@ -4223,7 +4183,7 @@ - + @@ -4236,7 +4196,7 @@ - + @@ -4246,7 +4206,7 @@ - + @@ -4254,7 +4214,7 @@ - + @@ -4267,7 +4227,7 @@ - + @@ -4277,7 +4237,7 @@ - + @@ -4285,7 +4245,7 @@ - + @@ -4298,7 +4258,7 @@ - + @@ -4308,7 +4268,7 @@ - + @@ -4316,7 +4276,7 @@ - + @@ -4329,7 +4289,7 @@ - + @@ -4339,7 +4299,7 @@ - + @@ -4347,7 +4307,7 @@ - + @@ -4360,7 +4320,7 @@ - + @@ -4370,7 +4330,7 @@ - + @@ -4378,7 +4338,7 @@ - + @@ -4391,38 +4351,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -4432,7 +4361,7 @@ - + @@ -4440,7 +4369,7 @@ - + @@ -4453,7 +4382,7 @@ - + @@ -4463,7 +4392,7 @@ - + @@ -4471,7 +4400,7 @@ - + @@ -4484,7 +4413,7 @@ - + @@ -4494,7 +4423,7 @@ - + @@ -4502,7 +4431,7 @@ - + @@ -4515,7 +4444,7 @@ - + @@ -4525,7 +4454,7 @@ - + @@ -4533,7 +4462,7 @@ - + @@ -4544,15 +4473,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + @@ -4560,7 +4519,7 @@ - + @@ -4568,301 +4527,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -4879,6 +4544,27 @@ + + + + + + + + + + + + + + + + + + + + + @@ -4888,30 +4574,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - + @@ -4922,15 +4585,17 @@ - - - + + + + - - - + + + + @@ -4938,33 +4603,41 @@ - + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + @@ -4974,28 +4647,6 @@ - - - - - - - - - - - - - - - - - - - - - - @@ -5004,148 +4655,41 @@ - - + + - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -5164,11 +4708,19 @@ + + + + + + + + + - - - - + + + @@ -5178,6 +4730,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -5187,20 +4889,269 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + @@ -5212,7 +5163,7 @@ - + @@ -5220,11 +5171,19 @@ - + - + + + + + + + + + From 5c0b6bf50f75856e61385f5e76064189ea1d0a28 Mon Sep 17 00:00:00 2001 From: Jacob Hilliard <64656371+jcbhl@users.noreply.github.com> Date: Tue, 20 Jul 2021 13:41:33 -0700 Subject: [PATCH 14/17] [GHI #2165] GPU Buffer/Image memory visualizer (#2242) * GPU Memory: basic tree view of pools + heaps * GPU Memory: pie charts of overall heap usage * GPU Memory: Implement tabular view * GPU Memory: final cleanup * GPU Memory: use AZ_ENUM macro for string conversion Signed-off-by: Jacob Hilliard --- .../Atom/RHI.Reflect/BufferDescriptor.h | 33 ++- .../Include/Atom/RHI.Reflect/ImageEnums.h | 26 +- .../RHI/Code/Include/Atom/RHI/RHISystem.h | 1 + .../Include/Atom/RHI/RHISystemInterface.h | 3 + Gems/Atom/RHI/Code/Source/RHI/RHISystem.cpp | 5 + Gems/Atom/RHI/Vulkan/Code/Source/RHI/Vulkan.h | 6 +- .../Include/Atom/Utils/ImGuiGpuProfiler.h | 43 +++ .../Include/Atom/Utils/ImGuiGpuProfiler.inl | 253 ++++++++++++++++++ 8 files changed, 339 insertions(+), 31 deletions(-) diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/BufferDescriptor.h b/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/BufferDescriptor.h index 323b44485d..80c41bec25 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/BufferDescriptor.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/BufferDescriptor.h @@ -10,6 +10,8 @@ #include #include + +#include #include namespace AZ @@ -22,47 +24,44 @@ namespace AZ * A set of combinable flags which inform the system how a buffer is to be * bound to the pipeline at all stages of its lifetime. */ - enum class BufferBindFlags : uint32_t - { - None = 0, + AZ_ENUM_CLASS_WITH_UNDERLYING_TYPE(BufferBindFlags, uint32_t, + (None , 0), /// Supports input assembly access through a IndexBufferView or StreamBufferView. This flag is for buffers that are not updated often - InputAssembly = AZ_BIT(0), + (InputAssembly , AZ_BIT(0)), /// Supports input assembly access through a IndexBufferView or StreamBufferView. This flag is for buffers that are updated frequently - DynamicInputAssembly = AZ_BIT(1), + (DynamicInputAssembly , AZ_BIT(1)), /// Supports constant access through a ShaderResourceGroup. - Constant = AZ_BIT(2), + (Constant , AZ_BIT(2)), /// Supports read access through a ShaderResourceGroup. - ShaderRead = AZ_BIT(3), + (ShaderRead , AZ_BIT(3)), /// Supports write access through ShaderResourceGroup. - ShaderWrite = AZ_BIT(4), + (ShaderWrite , AZ_BIT(4)), /// Supports read-write access through a ShaderResourceGroup. - ShaderReadWrite = ShaderRead | ShaderWrite, + (ShaderReadWrite , ShaderRead | ShaderWrite), /// Supports read access for GPU copy operations. - CopyRead = AZ_BIT(5), + (CopyRead , AZ_BIT(5)), /// Supports write access for GPU copy operations. - CopyWrite = AZ_BIT(6), + (CopyWrite , AZ_BIT(6)), /// Supports predication access for conditional rendering. - Predication = AZ_BIT(7), + (Predication , AZ_BIT(7)), /// Supports indirect buffer access for indirect draw/dispatch. - Indirect = AZ_BIT(8), + (Indirect , AZ_BIT(8)), /// Supports ray tracing acceleration structure usage. - RayTracingAccelerationStructure = AZ_BIT(9), + (RayTracingAccelerationStructure , AZ_BIT(9)), /// Supports ray tracing shader table usage. - RayTracingShaderTable = AZ_BIT(10) - - }; + (RayTracingShaderTable , AZ_BIT(10))); AZ_DEFINE_ENUM_BITWISE_OPERATORS(AZ::RHI::BufferBindFlags); diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/ImageEnums.h b/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/ImageEnums.h index a2e0850ec9..7b83ac377e 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/ImageEnums.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/ImageEnums.h @@ -9,43 +9,43 @@ #include +#include + namespace AZ { namespace RHI { //! A set of combinable flags which inform the system how an image is to be //! bound to the pipeline at all stages of its lifetime. - enum class ImageBindFlags : uint32_t - { - None = 0, + AZ_ENUM_CLASS_WITH_UNDERLYING_TYPE(ImageBindFlags, uint32_t, + (None, 0), /// Supports read access through a ShaderResourceGroup. - ShaderRead = AZ_BIT(0), + (ShaderRead, AZ_BIT(0)), /// Supports write access through a ShaderResourceGroup. - ShaderWrite = AZ_BIT(1), + (ShaderWrite, AZ_BIT(1)), /// Supports read-write access through a ShaderResourceGroup. - ShaderReadWrite = ShaderRead | ShaderWrite, + (ShaderReadWrite, ShaderRead | ShaderWrite), /// Supports use as a color attachment on a scope. - Color = AZ_BIT(2), + (Color, AZ_BIT(2)), /// Supports use as depth attachment on a scope. - Depth = AZ_BIT(3), + (Depth, AZ_BIT(3)), /// Supports use as stencil attachment on a scope. - Stencil = AZ_BIT(4), + (Stencil, AZ_BIT(4)), /// Supports use as a depth stencil attachment on a scope. - DepthStencil = Depth | Stencil, + (DepthStencil, Depth | Stencil), /// Supports read access for GPU copy operations. - CopyRead = AZ_BIT(5), + (CopyRead, AZ_BIT(5)), /// Supports write access for GPU copy operations. - CopyWrite = AZ_BIT(6), - }; + (CopyWrite, AZ_BIT(6))); AZ_DEFINE_ENUM_BITWISE_OPERATORS(AZ::RHI::ImageBindFlags); diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/RHISystem.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/RHISystem.h index b48f09ba01..e37fd75148 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/RHISystem.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/RHISystem.h @@ -51,6 +51,7 @@ namespace AZ void ModifyFrameSchedulerStatisticsFlags(RHI::FrameSchedulerStatisticsFlags statisticsFlags, bool enableFlags) override; const RHI::CpuTimingStatistics* GetCpuTimingStatistics() const override; const RHI::TransientAttachmentStatistics* GetTransientAttachmentStatistics() const override; + const RHI::MemoryStatistics* GetMemoryStatistics() const override; const RHI::TransientAttachmentPoolDescriptor* GetTransientAttachmentPoolDescriptor() const override; ConstPtr GetPlatformLimitsDescriptor() const override; void QueueRayTracingShaderTableForBuild(RayTracingShaderTable* rayTracingShaderTable) override; diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/RHISystemInterface.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/RHISystemInterface.h index fd2feb2dd3..277b974641 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/RHISystemInterface.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/RHISystemInterface.h @@ -11,6 +11,7 @@ #include #include #include +#include #include namespace AZ @@ -55,6 +56,8 @@ namespace AZ virtual const RHI::TransientAttachmentStatistics* GetTransientAttachmentStatistics() const = 0; + virtual const RHI::MemoryStatistics* GetMemoryStatistics() const = 0; + virtual const RHI::TransientAttachmentPoolDescriptor* GetTransientAttachmentPoolDescriptor() const = 0; virtual ConstPtr GetPlatformLimitsDescriptor() const = 0; diff --git a/Gems/Atom/RHI/Code/Source/RHI/RHISystem.cpp b/Gems/Atom/RHI/Code/Source/RHI/RHISystem.cpp index ef43b12164..083fb87b93 100644 --- a/Gems/Atom/RHI/Code/Source/RHI/RHISystem.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI/RHISystem.cpp @@ -281,6 +281,11 @@ namespace AZ return m_frameScheduler.GetTransientAttachmentStatistics(); } + const RHI::MemoryStatistics* RHISystem::GetMemoryStatistics() const + { + return m_frameScheduler.GetMemoryStatistics(); + } + const AZ::RHI::TransientAttachmentPoolDescriptor* RHISystem::GetTransientAttachmentPoolDescriptor() const { return m_frameScheduler.GetTransientAttachmentPoolDescriptor(); diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/Vulkan.h b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/Vulkan.h index 2f36a3f22d..51f79f3ac2 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/Vulkan.h +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/Vulkan.h @@ -23,7 +23,11 @@ namespace AZ namespace RHI { class ScopeAttachment; - enum class BufferBindFlags : uint32_t; + // NOTE: see BufferDescriptor.h, AZ_ENUM... macro wraps enum within an outer inline namespace. + inline namespace BufferBindFlagsNamespace + { + enum class BufferBindFlags : uint32_t; + } class BufferView; class ImageView; struct BufferSubresourceRange; diff --git a/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiGpuProfiler.h b/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiGpuProfiler.h index d6b29be61a..1bed2b5715 100644 --- a/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiGpuProfiler.h +++ b/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiGpuProfiler.h @@ -8,9 +8,12 @@ #pragma once +#include #include +#include #include +#include #include namespace AZ @@ -250,6 +253,44 @@ namespace AZ }; + class ImGuiGpuMemoryView + { + public: + // Draw the overall GPU memory profiling window. + void DrawGpuMemoryWindow(bool& draw); + + private: + // Draw the heap usage pie chart + void DrawPieChart(const AZ::RHI::MemoryStatistics::Heap& heap); + + // Update the saved pointers in m_tableRows according to new data/filters + void UpdateTableRows(); + + void DrawTable(); + + // Sort the table according to the appropriate column. + void SortTable(ImGuiTableSortSpecs* sortSpecs); + + struct TableRow + { + Name m_parentPoolName; + Name m_bufImgName; + size_t m_sizeInBytes = 0; + AZStd::string m_bindFlags; + }; + + // Table settings + bool m_includeBuffers = true; + bool m_includeImages = true; + bool m_includeTransientAttachments = true; + + ImGuiTextFilter m_nameFilter; + + AZStd::vector m_tableRows; + AZStd::vector m_savedPools; + AZStd::vector m_savedHeaps; + }; + class ImGuiGpuProfiler { public: @@ -275,9 +316,11 @@ namespace AZ bool m_drawTimestampView = false; bool m_drawPipelineStatisticsView = false; + bool m_drawGpuMemoryView = false; ImGuiTimestampView m_timestampView; ImGuiPipelineStatisticsView m_pipelineStatisticsView; + ImGuiGpuMemoryView m_gpuMemoryView; }; } //namespace Render } // namespace AZ diff --git a/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiGpuProfiler.inl b/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiGpuProfiler.inl index f2a9257172..ec7b30cd3e 100644 --- a/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiGpuProfiler.inl +++ b/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiGpuProfiler.inl @@ -6,12 +6,15 @@ * */ +#include #include #include #include #include #include +#include + #include namespace AZ @@ -87,6 +90,38 @@ namespace AZ } drawList->AddText(font, font->FontSize, pos, ImGui::GetColorU32(ImGuiCol_Text), text, nullptr, size.x); } + + inline static AZStd::string GetImageBindStrings(AZ::RHI::ImageBindFlags imageBindFlags) + { + AZStd::string imageBindStrings; + for (const auto& flag : AZ::RHI::ImageBindFlagsMembers) + { + if (flag.m_value != AZ::RHI::ImageBindFlags::None && AZ::RHI::CheckBitsAll(imageBindFlags, flag.m_value)) + { + imageBindStrings.append(flag.m_string); + imageBindStrings.append(", "); + } + } + return imageBindStrings; + } + + inline static AZStd::string GetBufferBindStrings(AZ::RHI::BufferBindFlags bufferBindFlags) + { + AZStd::string bufferBindStrings; + for (const auto& flag : AZ::RHI::BufferBindFlagsMembers) + { + if (flag.m_value != AZ::RHI::BufferBindFlags::None && AZ::RHI::CheckBitsAll(bufferBindFlags, flag.m_value)) + { + bufferBindStrings.append(flag.m_string); + bufferBindStrings.append(", "); + } + } + return bufferBindStrings; + } + + static constexpr u64 KB = 1024; + static constexpr u64 MB = 1024 * KB; + static constexpr u64 GB = 1024 * MB; } // namespace GpuProfilerImGuiHelper // --- PassEntry --- @@ -1025,6 +1060,219 @@ namespace AZ } } + // --- ImGuiGpuMemoryView --- + + inline void ImGuiGpuMemoryView::SortTable(ImGuiTableSortSpecs* sortSpecs) + { + const bool ascending = sortSpecs->Specs->SortDirection == ImGuiSortDirection_Ascending; + const ImS16 columnToSort = sortSpecs->Specs->ColumnIndex; + + // Sort by the appropriate column in the table + switch (columnToSort) + { + case (0): // Sorting by parent pool name + AZStd::sort(m_tableRows.begin(), m_tableRows.end(), + [ascending](const TableRow& lhs, const TableRow& rhs) + { + const auto lhsParentPool = lhs.m_parentPoolName.GetStringView(); + const auto rhsParentPool = rhs.m_parentPoolName.GetStringView(); + return ascending ? lhsParentPool < rhsParentPool : lhsParentPool > rhsParentPool; + }); + break; + case (1): // Sort by buffer/image name + AZStd::sort(m_tableRows.begin(), m_tableRows.end(), + [ascending](const TableRow& lhs, const TableRow& rhs) + { + const auto lhsName = lhs.m_bufImgName.GetStringView(); + const auto rhsName = rhs.m_bufImgName.GetStringView(); + return ascending ? lhsName < rhsName : lhsName > rhsName; + }); + break; + case (2): // Sort by memory usage + AZStd::sort(m_tableRows.begin(), m_tableRows.end(), + [ascending](const TableRow& lhs, const TableRow& rhs) + { + const float lhsSize = lhs.m_sizeInBytes; + const float rhsSize = rhs.m_sizeInBytes; + return ascending ? lhsSize < rhsSize : lhsSize > rhsSize; + }); + break; + } + sortSpecs->SpecsDirty = false; + } + + inline void ImGuiGpuMemoryView::DrawTable() + { + if (ImGui::BeginTable("Table", 4, ImGuiTableFlags_Borders | ImGuiTableFlags_Sortable | ImGuiTableFlags_Resizable)) + { + ImGui::TableSetupColumn("Parent pool"); + ImGui::TableSetupColumn("Name"); + ImGui::TableSetupColumn("Size (MB)", 0, 100.0f); + ImGui::TableSetupColumn("BindFlags", ImGuiTableColumnFlags_NoSort); + ImGui::TableHeadersRow(); + ImGui::TableNextColumn(); + + ImGuiTableSortSpecs* sortSpecs = ImGui::TableGetSortSpecs(); + if (sortSpecs && sortSpecs->SpecsDirty) + { + SortTable(sortSpecs); + } + + // Draw each row in the table + for (const auto& tableRow : m_tableRows) + { + // Don't draw the row if none of the row's text fields pass the filter + if (!m_nameFilter.PassFilter(tableRow.m_parentPoolName.GetCStr()) + && !m_nameFilter.PassFilter(tableRow.m_bufImgName.GetCStr()) + && !m_nameFilter.PassFilter(tableRow.m_bindFlags.c_str())) + { + continue; + } + + ImGui::Text(tableRow.m_parentPoolName.GetCStr()); + ImGui::TableNextColumn(); + ImGui::Text(tableRow.m_bufImgName.GetCStr()); + ImGui::TableNextColumn(); + ImGui::Text("%.2f", 1.0f * tableRow.m_sizeInBytes / GpuProfilerImGuiHelper::MB); + ImGui::TableNextColumn(); + ImGui::Text(tableRow.m_bindFlags.c_str()); + ImGui::TableNextColumn(); + } + } + ImGui::EndTable(); + } + + inline void ImGuiGpuMemoryView::UpdateTableRows() + { + // Update the table according to the latest filters applied + m_tableRows.clear(); + for (const auto& pool : m_savedPools) + { + Name poolName = pool.m_name.IsEmpty() ? Name("Unnamed pool") : pool.m_name; + + // Ignore transient pools + if (!m_includeTransientAttachments && pool.m_name.GetStringView().contains("Transient")) + { + continue; + } + + if (m_includeBuffers) + { + for (const auto& buf : pool.m_buffers) + { + const Name bufName = buf.m_name.IsEmpty() ? Name("Unnamed Buffer") : buf.m_name; + const AZStd::string flags = GpuProfilerImGuiHelper::GetBufferBindStrings(buf.m_bindFlags); + m_tableRows.push_back({ poolName, bufName, buf.m_sizeInBytes, flags }); + } + } + + if (m_includeImages) + { + for (const auto& img : pool.m_images) + { + const Name imgName = img.m_name.IsEmpty() ? Name("Unnamed Image") : img.m_name; + const AZStd::string flags = GpuProfilerImGuiHelper::GetImageBindStrings(img.m_bindFlags); + m_tableRows.push_back({ poolName, imgName, img.m_sizeInBytes, flags }); + } + } + } + } + + inline void ImGuiGpuMemoryView::DrawPieChart(const AZ::RHI::MemoryStatistics::Heap& heap) + { + if (ImGui::BeginChild("PieChart", {150, 150}, true)) + { + ImDrawList* drawList = ImGui::GetWindowDrawList(); + const auto [wx, wy] = ImGui::GetWindowPos(); + const auto [windowWidth, windowHeight] = ImGui::GetWindowSize(); + const ImVec2 center = { wx + windowWidth / 2, wy + windowHeight / 2 }; + const float radius = windowWidth / 2 - 10; + + // Draw the pie chart + drawList->AddCircleFilled(center, radius, ImGui::GetColorU32({.3, .3, .3, 1})); + const float usagePercent = 1.0f * heap.m_memoryUsage.m_residentInBytes / heap.m_memoryUsage.m_budgetInBytes; + drawList->PathArcTo(center, radius, 0, AZ::Constants::TwoPi * usagePercent); // Clockwise starting from rightmost point + drawList->PathArcTo(center, 0, 0, 0); // To center + drawList->PathArcTo(center, radius, 0, 0); // Back to starting position + drawList->PathFillConvex(ImGui::GetColorU32({ .039, .8, 0.556, 1 })); + ImGui::Text("%.2f%%", usagePercent * 100); + } + ImGui::EndChild(); + } + + inline void ImGuiGpuMemoryView::DrawGpuMemoryWindow(bool& draw) + { + // Enable GPU memory instrumentation while the window is open. Called every draw frame, but just a bitwise operation so overhead should be low. + auto* rhiSystem = AZ::RHI::RHISystemInterface::Get(); + AZ_Assert(rhiSystem != nullptr, "Error in drawing GPU memory window: RHI System Interface was nullptr"); + rhiSystem->ModifyFrameSchedulerStatisticsFlags(AZ::RHI::FrameSchedulerStatisticsFlags::GatherMemoryStatistics, draw); + + if (!draw) + { + return; + } + + ImGui::SetNextWindowSize({ 600, 600 }, ImGuiCond_Once); + if (ImGui::Begin("Gpu Memory Profiler", &draw, ImGuiViewportFlags_None)) + { + if (ImGui::Button("Capture")) + { + // Collect and save new GPU memory usage data + const auto* memoryStatistics = rhiSystem->GetMemoryStatistics(); + if (memoryStatistics) + { + m_tableRows.clear(); + m_savedPools = memoryStatistics->m_pools; + m_savedHeaps = memoryStatistics->m_heaps; + + // Collect the data into TableRows, ignoring depending on flags + UpdateTableRows(); + } + } + + if (ImGui::Checkbox("Show buffers", &m_includeBuffers) + || ImGui::Checkbox("Show images", &m_includeImages) + || ImGui::Checkbox("Show transient attachments", &m_includeTransientAttachments)) + { + UpdateTableRows(); + } + + ImGui::Text("Overall heap usage:"); + for (const auto& savedHeap : m_savedHeaps) + { + if (ImGui::BeginChild(savedHeap.m_name.GetCStr(), { ImGui::GetWindowWidth() / m_savedHeaps.size(), 250 }), ImGuiWindowFlags_NoScrollbar) + { + ImGui::Text(savedHeap.m_name.GetCStr()); + ImGui::Columns(2, "HeapData", true); + + ImGui::Text("Resident (MB): "); + ImGui::NextColumn(); + ImGui::Text("%.2f", 1.0 * savedHeap.m_memoryUsage.m_residentInBytes.load() / GpuProfilerImGuiHelper::MB); + ImGui::NextColumn(); + + ImGui::Text("Reserved (MB): "); + ImGui::NextColumn(); + ImGui::Text("%.2f", 1.0 * savedHeap.m_memoryUsage.m_reservedInBytes.load() / GpuProfilerImGuiHelper::MB); + ImGui::NextColumn(); + + ImGui::Text("Budget (MB): "); + ImGui::NextColumn(); + ImGui::Text("%.2f", 1.0 * savedHeap.m_memoryUsage.m_budgetInBytes / GpuProfilerImGuiHelper::MB); + + ImGui::Columns(1, "PieChartColumn"); + DrawPieChart(savedHeap); + } + ImGui::EndChild(); + ImGui::SameLine(ImGui::GetWindowWidth() / m_savedHeaps.size()); + } + ImGui::NewLine(); + ImGui::Separator(); + + m_nameFilter.Draw("Search"); + DrawTable(); + } + } + // --- ImGuiGpuProfiler --- inline void ImGuiGpuProfiler::Draw(bool& draw, RHI::Ptr rootPass) @@ -1045,6 +1293,8 @@ namespace AZ { rootPass->SetPipelineStatisticsQueryEnabled(m_drawPipelineStatisticsView); } + ImGui::Spacing(); + ImGui::Checkbox("Enable GpuMemoryView", &m_drawGpuMemoryView); }); // Draw the PipelineStatistics window. @@ -1053,6 +1303,9 @@ namespace AZ // Draw the PipelineStatistics window. m_pipelineStatisticsView.DrawPipelineStatisticsWindow(m_drawPipelineStatisticsView, rootPassEntryRef, m_passEntryDatabase, rootPass); + // Draw the GpuMemory window. + m_gpuMemoryView.DrawGpuMemoryWindow(m_drawGpuMemoryView); + //closing window if (wasDraw && !draw) { From 54cfd26b6c7bcabcf6cf14eb28574f8de74b933e Mon Sep 17 00:00:00 2001 From: Garcia Ruiz Date: Tue, 20 Jul 2021 23:15:09 +0200 Subject: [PATCH 15/17] Fixed cmake Python so it correctly reinstalls a local python package if its setup.py changes Signed-off-by: Garcia Ruiz --- cmake/LYPython.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/LYPython.cmake b/cmake/LYPython.cmake index c188bac983..21e220f1d8 100644 --- a/cmake/LYPython.cmake +++ b/cmake/LYPython.cmake @@ -143,7 +143,10 @@ function(ly_pip_install_local_package_editable package_folder_path pip_package_n # we only ever need to do this once per runtime install, since its a link # not an actual install: - if(EXISTS ${stamp_file}) + # If setup.py changes we must reinstall the package in case its dependencies changed + set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${package_folder_path}/setup.py) + + if(EXISTS ${stamp_file} AND ${stamp_file} IS_NEWER_THAN ${package_folder_path}/setup.py) ly_package_is_newer_than(${LY_PYTHON_PACKAGE_NAME} ${stamp_file} package_is_newer) if (NOT package_is_newer) # no need to run the command again, as the package is older than the stamp file From 1c2f5ab6d5fa60ac25d0891a673c528c974fd90c Mon Sep 17 00:00:00 2001 From: moudgils <47460854+moudgils@users.noreply.github.com> Date: Tue, 20 Jul 2021 14:58:54 -0700 Subject: [PATCH 16/17] Add support for LowEndRenderPipeline for mobile and the cleanup associated with it (#2292) Signed-off-by: moudgils --- .../DiffuseGlobalFullscreen_nomsaa.pass | 51 -------- .../Passes/LightCullingTilePrepare.pass | 63 ---------- .../Assets/Passes/PassTemplates.azasset | 4 - .../ReflectionGlobalFullscreen_nomsaa.pass | 119 ------------------ .../DiffuseComposite_nomsaa.shader | 56 --------- .../DiffuseGlobalFullscreen_nomsaa.shader | 56 --------- .../DiffuseProbeGridDownsample_nomsaa.shader | 34 ----- .../LightCulling/LightCullingTilePrepare.azsl | 18 ++- .../ReflectionComposite_nomsaa.shader | 53 -------- .../ReflectionGlobalFullscreen_nomsaa.shader | 44 ------- .../atom_feature_common_asset_files.cmake | 14 --- .../CoreLights/LightCullingTilePreparePass.h | 2 +- .../Source/Platform/Mac/RHI/Metal_RHI_Mac.cpp | 5 - .../Source/Platform/iOS/RHI/Metal_RHI_iOS.cpp | 11 -- Gems/Atom/RHI/Metal/Code/Source/RHI/Scope.cpp | 5 - .../RPI.Public/Shader/ShaderResourceGroup.cpp | 2 +- 16 files changed, 15 insertions(+), 522 deletions(-) delete mode 100644 Gems/Atom/Feature/Common/Assets/Passes/DiffuseGlobalFullscreen_nomsaa.pass delete mode 100644 Gems/Atom/Feature/Common/Assets/Passes/LightCullingTilePrepare.pass delete mode 100644 Gems/Atom/Feature/Common/Assets/Passes/ReflectionGlobalFullscreen_nomsaa.pass delete mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseComposite_nomsaa.shader delete mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseGlobalFullscreen_nomsaa.shader delete mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridDownsample_nomsaa.shader delete mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/Reflections/ReflectionComposite_nomsaa.shader delete mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/Reflections/ReflectionGlobalFullscreen_nomsaa.shader diff --git a/Gems/Atom/Feature/Common/Assets/Passes/DiffuseGlobalFullscreen_nomsaa.pass b/Gems/Atom/Feature/Common/Assets/Passes/DiffuseGlobalFullscreen_nomsaa.pass deleted file mode 100644 index 71121967a0..0000000000 --- a/Gems/Atom/Feature/Common/Assets/Passes/DiffuseGlobalFullscreen_nomsaa.pass +++ /dev/null @@ -1,51 +0,0 @@ -{ - "Type": "JsonSerialization", - "Version": 1, - "ClassName": "PassAsset", - "ClassData": { - "PassTemplate": { - "Name": "DiffuseGlobalFullscreenPass_nomsaaTemplate", - "PassClass": "FullScreenTriangle", - "Slots": [ - { - "Name": "AlbedoInput", - "SlotType": "Input", - "ScopeAttachmentUsage": "Shader" - }, - { - "Name": "NormalInput", - "SlotType": "Input", - "ScopeAttachmentUsage": "Shader" - }, - { - "Name": "DepthStencilTextureInput", - "SlotType": "Input", - "ScopeAttachmentUsage": "Shader", - "ImageViewDesc": { - "AspectFlags": [ - "Depth" - ] - } - }, - { - "Name": "DiffuseInputOutput", - "SlotType": "InputOutput", - "ScopeAttachmentUsage": "RenderTarget" - }, - { - "Name": "DepthStencilInputOutput", - "SlotType": "InputOutput", - "ScopeAttachmentUsage": "DepthStencil" - } - ], - "PassData": { - "$type": "FullscreenTrianglePassData", - "ShaderAsset": { - "FilePath": "Shaders/DiffuseGlobalIllumination/DiffuseGlobalFullscreen_nomsaa.shader" - }, - "StencilRef": 128, // See RenderCommon.h and DiffuseGlobalFullscreen.shader - "PipelineViewTag": "MainCamera" - } - } - } -} diff --git a/Gems/Atom/Feature/Common/Assets/Passes/LightCullingTilePrepare.pass b/Gems/Atom/Feature/Common/Assets/Passes/LightCullingTilePrepare.pass deleted file mode 100644 index 83803bcbb7..0000000000 --- a/Gems/Atom/Feature/Common/Assets/Passes/LightCullingTilePrepare.pass +++ /dev/null @@ -1,63 +0,0 @@ -{ - "Type": "JsonSerialization", - "Version": 1, - "ClassName": "PassAsset", - "ClassData": { - "PassTemplate": { - "Name": "LightCullingTilePrepareTemplate", - "PassClass": "LightCullingTilePreparePass", - "Slots": [ - { - "Name": "TileLightData", - "SlotType": "Output", - "ShaderInputName": "m_tileLightData", - "ScopeAttachmentUsage": "Shader" - }, - { - "Name": "Depth", - "SlotType": "Input", - "ShaderInputName": "m_depthBuffer", - "ScopeAttachmentUsage": "Shader", - "ImageViewDesc": { - "AspectFlags": [ - "Depth" - ] - } - } - ], - "ImageAttachments": [ - { - "Name": "TileLightData", - "SizeSource": { - "Source": { - "Pass": "This", - "Attachment": "Depth" - }, - "Multipliers": { - "WidthMultiplier": 0.0625, - "HeightMultiplier": 0.0625 - } - }, - "ImageDescriptor": { - "Format": "R32G32B32A32_UINT" - } - } - ], - "Connections": [ - { - "LocalSlot": "TileLightData", - "AttachmentRef": { - "Pass": "This", - "Attachment": "TileLightData" - } - } - ], - "PassData": { - "$type": "ComputePassData", - "ShaderAsset": { - "FilePath": "Shaders/LightCulling/LightCullingTilePrepare.shader" - } - } - } - } -} diff --git a/Gems/Atom/Feature/Common/Assets/Passes/PassTemplates.azasset b/Gems/Atom/Feature/Common/Assets/Passes/PassTemplates.azasset index 702ac8fe72..57d35fb48d 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/PassTemplates.azasset +++ b/Gems/Atom/Feature/Common/Assets/Passes/PassTemplates.azasset @@ -212,10 +212,6 @@ "Name": "LightCullingTemplate", "Path": "Passes/LightCulling.pass" }, - { - "Name": "LightCullingTilePrepareTemplate", - "Path": "Passes/LightCullingTilePrepare.pass" - }, { "Name": "LightCullingTilePrepareMSAATemplate", "Path": "Passes/LightCullingTilePrepareMSAA.pass" diff --git a/Gems/Atom/Feature/Common/Assets/Passes/ReflectionGlobalFullscreen_nomsaa.pass b/Gems/Atom/Feature/Common/Assets/Passes/ReflectionGlobalFullscreen_nomsaa.pass deleted file mode 100644 index 26c90b90e5..0000000000 --- a/Gems/Atom/Feature/Common/Assets/Passes/ReflectionGlobalFullscreen_nomsaa.pass +++ /dev/null @@ -1,119 +0,0 @@ -{ - "Type": "JsonSerialization", - "Version": 1, - "ClassName": "PassAsset", - "ClassData": { - "PassTemplate": { - "Name": "ReflectionGlobalFullscreenPass_nomsaaTemplate", - "PassClass": "FullScreenTriangle", - "Slots": [ - { - "Name": "DepthStencilTextureInput", - "SlotType": "Input", - "ScopeAttachmentUsage": "Shader", - "ImageViewDesc": { - "AspectFlags": [ - "Depth" - ] - } - }, - { - "Name": "NormalInput", - "SlotType": "Input", - "ScopeAttachmentUsage": "Shader" - }, - { - "Name": "SpecularF0Input", - "SlotType": "Input", - "ScopeAttachmentUsage": "Shader" - }, - { - "Name": "ReflectionBlendWeightInput", - "SlotType": "Input", - "ScopeAttachmentUsage": "Shader" - }, - { - "Name": "BRDFTextureInput", - "ShaderInputName": "m_brdfMap", - "SlotType": "Input", - "ScopeAttachmentUsage": "Shader" - }, - { - "Name": "DepthStencilInput", - "SlotType": "Input", - "ScopeAttachmentUsage": "DepthStencil", - "ImageViewDesc": { - "AspectFlags": [ - "Stencil" - ] - } - }, - { - "Name": "ReflectionOutput", - "SlotType": "Output", - "ScopeAttachmentUsage": "RenderTarget", - "LoadStoreAction": { - "ClearValue": { - "Value": [ - 0.4000000059604645, - 0.4000000059604645, - 0.4000000059604645, - 0.0 - ] - }, - "LoadAction": "Clear" - } - } - ], - "ImageAttachments": [ - { - "Name": "ReflectionImage", - "SizeSource": { - "Source": { - "Pass": "This", - "Attachment": "SpecularF0Input" - } - }, - "MultisampleSource": { - "Pass": "This", - "Attachment": "SpecularF0Input" - }, - "ImageDescriptor": { - "Format": "R16G16B16A16_FLOAT", - "SharedQueueMask": "Graphics" - } - }, - { - "Name": "BRDFTexture", - "Lifetime": "Imported", - "AssetRef": { - "FilePath": "Textures/BRDFTexture.attimage" - } - } - ], - "Connections": [ - { - "LocalSlot": "ReflectionOutput", - "AttachmentRef": { - "Pass": "This", - "Attachment": "ReflectionImage" - } - }, - { - "LocalSlot": "BRDFTextureInput", - "AttachmentRef": { - "Pass": "This", - "Attachment": "BRDFTexture" - } - } - ], - "PassData": { - "$type": "FullscreenTrianglePassData", - "ShaderAsset": { - "FilePath": "Shaders/Reflections/ReflectionGlobalFullscreen_nomsaa.shader" - }, - "PipelineViewTag": "MainCamera" - } - } - } -} diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseComposite_nomsaa.shader b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseComposite_nomsaa.shader deleted file mode 100644 index 76b64b6a19..0000000000 --- a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseComposite_nomsaa.shader +++ /dev/null @@ -1,56 +0,0 @@ -{ - "Source" : "DiffuseComposite_nomsaa", - - "RasterState" : - { - "CullMode" : "Back" - }, - - "DepthStencilState" : - { - "Depth" : - { - "Enable" : false - }, - "Stencil" : - { - "Enable" : true, - "ReadMask" : "0x80", - "WriteMask" : "0x00", - "FrontFace" : - { - "Func" : "Equal", - "DepthFailOp" : "Keep", - "FailOp" : "Keep", - "PassOp" : "Keep" - } - } - }, - - "BlendState" : { - "Enable" : true, - "BlendSource" : "One", - "BlendDest" : "One", - "BlendOp" : "Add", - "BlendAlphaSource" : "Zero", - "BlendAlphaDest" : "One", - "BlendAlphaOp" : "Add" - }, - - "DrawList" : "forward", - - "ProgramSettings": - { - "EntryPoints": - [ - { - "name": "MainVS", - "type": "Vertex" - }, - { - "name": "MainPS", - "type": "Fragment" - } - ] - } -} diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseGlobalFullscreen_nomsaa.shader b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseGlobalFullscreen_nomsaa.shader deleted file mode 100644 index c8aba3e4a7..0000000000 --- a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseGlobalFullscreen_nomsaa.shader +++ /dev/null @@ -1,56 +0,0 @@ -{ - "Source" : "DiffuseGlobalFullscreen_nomsaa", - - "RasterState" : - { - "CullMode" : "Back" - }, - - "DepthStencilState" : - { - "Depth" : - { - "Enable" : false - }, - "Stencil" : - { - "Enable" : true, - "ReadMask" : "0x80", - "WriteMask" : "0x00", - "FrontFace" : - { - "Func" : "Equal", - "DepthFailOp" : "Keep", - "FailOp" : "Keep", - "PassOp" : "Keep" - } - } - }, - - "BlendState" : { - "Enable" : true, - "BlendSource" : "One", - "BlendDest" : "One", - "BlendOp" : "Add", - "BlendAlphaSource" : "Zero", - "BlendAlphaDest" : "One", - "BlendAlphaOp" : "Add" - }, - - "DrawList" : "forward", - - "ProgramSettings": - { - "EntryPoints": - [ - { - "name": "MainVS", - "type": "Vertex" - }, - { - "name": "MainPS", - "type": "Fragment" - } - ] - } -} diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridDownsample_nomsaa.shader b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridDownsample_nomsaa.shader deleted file mode 100644 index 2dd5fb2419..0000000000 --- a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridDownsample_nomsaa.shader +++ /dev/null @@ -1,34 +0,0 @@ -{ - "Source" : "DiffuseProbeGridDownsample_nomsaa", - - "RasterState" : - { - "CullMode" : "Back" - }, - - "DepthStencilState" : - { - "Depth" : - { - "Enable" : true, // required to bind the depth buffer SRV - "CompareFunc" : "Always" - } - }, - - "DrawList" : "forward", - - "ProgramSettings": - { - "EntryPoints": - [ - { - "name": "MainVS", - "type": "Vertex" - }, - { - "name": "MainPS", - "type": "Fragment" - } - ] - } -} diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/LightCulling/LightCullingTilePrepare.azsl b/Gems/Atom/Feature/Common/Assets/Shaders/LightCulling/LightCullingTilePrepare.azsl index 8daaf482d4..dc0477fc36 100644 --- a/Gems/Atom/Feature/Common/Assets/Shaders/LightCulling/LightCullingTilePrepare.azsl +++ b/Gems/Atom/Feature/Common/Assets/Shaders/LightCulling/LightCullingTilePrepare.azsl @@ -66,9 +66,7 @@ void StoreTransparentMinMaxIntoSharedMemory(float2 data) ShaderResourceGroup PassSrg : SRG_PerPass { - // We will use one or the other depending upon if MSAA is enabled or not - Texture2D m_depthBuffer; - Texture2DMS m_depthBufferMSAA; + Texture2DMS m_depthBufferMSAA; // Depth buffer where we rendered the nearest pixels of transparent objects Texture2D m_depthBufferTransparentMin; @@ -282,9 +280,19 @@ void MainCS( float2 minmaxDepth_transparent = ReadTransparentMinMaxMSAA(dispatchThreadID.xy); - if (o_msaaMode == MsaaMode::Msaa2x) + if (o_msaaMode == MsaaMode::None || o_msaaMode == MsaaMode::Msaa2x) { - float2 opaqueDepthSamples = ReadOpaqueDepthSamples2xMSAA(dispatchThreadID.xy); + float2 opaqueDepthSamples; + if (o_msaaMode == MsaaMode::None) + { + float depth = PassSrg::m_depthBufferMSAA.Load(dispatchThreadID.xy, 0).x; + opaqueDepthSamples = float2(depth, depth); + } + else if (o_msaaMode == MsaaMode::Msaa2x) + { + opaqueDepthSamples = ReadOpaqueDepthSamples2xMSAA(dispatchThreadID.xy); + } + // Transparent geometry can't be behind opaque geometry. Just pick the first MSAA sample since we are trying to reduce reading from MSAA buffer minmaxDepth_transparent = DEPTH_MIN(minmaxDepth_transparent, opaqueDepthSamples.x); opaqueDepthSamples = ReplaceSkyPixelsWithFurthestPixelsFromTransparentObjects2x(opaqueDepthSamples, minmaxDepth_transparent); diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/Reflections/ReflectionComposite_nomsaa.shader b/Gems/Atom/Feature/Common/Assets/Shaders/Reflections/ReflectionComposite_nomsaa.shader deleted file mode 100644 index a7c893e5e8..0000000000 --- a/Gems/Atom/Feature/Common/Assets/Shaders/Reflections/ReflectionComposite_nomsaa.shader +++ /dev/null @@ -1,53 +0,0 @@ -{ - "Source" : "ReflectionComposite_nomsaa", - - "RasterState" : - { - "CullMode" : "Back" - }, - - "DepthStencilState" : - { - "Depth" : - { - "Enable" : false, - "WriteMask" : "Zero", - "CompareFunc" : "GreaterEqual" - }, - "Stencil" : - { - "Enable" : true, - "ReadMask" : "0xFF", - "WriteMask" : "0x00", - "FrontFace" : - { - "Func" : "LessEqual", - "DepthFailOp" : "Keep", - "FailOp" : "Keep", - "PassOp" : "Keep" - } - } - }, - - "BlendState" : { - "Enable" : true, - "BlendSource" : "One", - "BlendDest" : "One", - "BlendOp" : "Add" - }, - - "ProgramSettings": - { - "EntryPoints": - [ - { - "name": "MainVS", - "type": "Vertex" - }, - { - "name": "MainPS", - "type": "Fragment" - } - ] - } -} diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/Reflections/ReflectionGlobalFullscreen_nomsaa.shader b/Gems/Atom/Feature/Common/Assets/Shaders/Reflections/ReflectionGlobalFullscreen_nomsaa.shader deleted file mode 100644 index 13700a1fe0..0000000000 --- a/Gems/Atom/Feature/Common/Assets/Shaders/Reflections/ReflectionGlobalFullscreen_nomsaa.shader +++ /dev/null @@ -1,44 +0,0 @@ -{ - "Source" : "ReflectionGlobalFullscreen_nomsaa", - - "RasterState" : - { - "CullMode" : "Back" - }, - - "DepthStencilState" : - { - "Depth" : - { - "Enable" : false - }, - "Stencil" : - { - "Enable" : true, - "ReadMask" : "0xFF", - "WriteMask" : "0x00", - "FrontFace" : - { - "Func" : "Equal", - "DepthFailOp" : "Keep", - "FailOp" : "Keep", - "PassOp" : "Keep" - } - } - }, - - "ProgramSettings": - { - "EntryPoints": - [ - { - "name": "MainVS", - "type": "Vertex" - }, - { - "name": "MainPS", - "type": "Fragment" - } - ] - } -} diff --git a/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake b/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake index 4368f267c5..75181517a4 100644 --- a/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake +++ b/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake @@ -113,7 +113,6 @@ set(FILES Passes/DepthUpsample.pass Passes/DiffuseComposite.pass Passes/DiffuseGlobalFullscreen.pass - Passes/DiffuseGlobalFullscreen_nomsaa.pass Passes/DiffuseGlobalIllumination.pass Passes/DiffuseProbeGridBlendDistance.pass Passes/DiffuseProbeGridBlendIrradiance.pass @@ -152,7 +151,6 @@ set(FILES Passes/LightCullingHeatmap.pass Passes/LightCullingParent.pass Passes/LightCullingRemap.pass - Passes/LightCullingTilePrepare.pass Passes/LightCullingTilePrepareMSAA.pass Passes/LookModificationComposite.pass Passes/LookModificationTransform.pass @@ -176,7 +174,6 @@ set(FILES Passes/ReflectionComposite.pass Passes/ReflectionCopyFrameBuffer.pass Passes/ReflectionGlobalFullscreen.pass - Passes/ReflectionGlobalFullscreen_nomsaa.pass Passes/ReflectionProbeBlendWeight.pass Passes/ReflectionProbeRenderInner.pass Passes/ReflectionProbeRenderOuter.pass @@ -190,7 +187,6 @@ set(FILES Passes/ReflectionScreenSpaceComposite.pass Passes/ReflectionScreenSpaceMobile.pass Passes/ReflectionScreenSpaceTrace.pass - Passes/Reflections_nomsaa.pass Passes/ShadowParent.pass Passes/Skinning.pass Passes/SkyBox.pass @@ -320,16 +316,10 @@ set(FILES Shaders/Depth/DepthPassTransparentMin.shader Shaders/DiffuseGlobalIllumination/DiffuseComposite.azsl Shaders/DiffuseGlobalIllumination/DiffuseComposite.shader - Shaders/DiffuseGlobalIllumination/DiffuseComposite_nomsaa.azsl - Shaders/DiffuseGlobalIllumination/DiffuseComposite_nomsaa.shader Shaders/DiffuseGlobalIllumination/DiffuseGlobalFullscreen.azsl Shaders/DiffuseGlobalIllumination/DiffuseGlobalFullscreen.shader - Shaders/DiffuseGlobalIllumination/DiffuseGlobalFullscreen_nomsaa.azsl - Shaders/DiffuseGlobalIllumination/DiffuseGlobalFullscreen_nomsaa.shader Shaders/DiffuseGlobalIllumination/DiffuseProbeGridDownsample.azsl Shaders/DiffuseGlobalIllumination/DiffuseProbeGridDownsample.shader - Shaders/DiffuseGlobalIllumination/DiffuseProbeGridDownsample_nomsaa.azsl - Shaders/DiffuseGlobalIllumination/DiffuseProbeGridDownsample_nomsaa.shader Shaders/ImGui/ImGui.azsl Shaders/ImGui/ImGui.shader Shaders/LightCulling/LightCulling.azsl @@ -442,12 +432,8 @@ set(FILES Shaders/Reflections/ReflectionCommon.azsli Shaders/Reflections/ReflectionComposite.azsl Shaders/Reflections/ReflectionComposite.shader - Shaders/Reflections/ReflectionComposite_nomsaa.azsl - Shaders/Reflections/ReflectionComposite_nomsaa.shader Shaders/Reflections/ReflectionGlobalFullscreen.azsl Shaders/Reflections/ReflectionGlobalFullscreen.shader - Shaders/Reflections/ReflectionGlobalFullscreen_nomsaa.azsl - Shaders/Reflections/ReflectionGlobalFullscreen_nomsaa.shader Shaders/Reflections/ReflectionProbeBlendWeight.azsl Shaders/Reflections/ReflectionProbeBlendWeight.shader Shaders/Reflections/ReflectionProbeRenderCommon.azsli diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/LightCullingTilePreparePass.h b/Gems/Atom/Feature/Common/Code/Source/CoreLights/LightCullingTilePreparePass.h index ccc707f575..f320c34629 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CoreLights/LightCullingTilePreparePass.h +++ b/Gems/Atom/Feature/Common/Code/Source/CoreLights/LightCullingTilePreparePass.h @@ -38,7 +38,7 @@ namespace AZ static Name GetLightCullingTilePreparePassTemplateName() { - return AZ::Name("LightCullingTilePrepareTemplate"); + return AZ::Name("LightCullingTilePrepareMSAATemplate"); } private: diff --git a/Gems/Atom/RHI/Metal/Code/Source/Platform/Mac/RHI/Metal_RHI_Mac.cpp b/Gems/Atom/RHI/Metal/Code/Source/Platform/Mac/RHI/Metal_RHI_Mac.cpp index de20ea1a18..1a984e43ef 100644 --- a/Gems/Atom/RHI/Metal/Code/Source/Platform/Mac/RHI/Metal_RHI_Mac.cpp +++ b/Gems/Atom/RHI/Metal/Code/Source/Platform/Mac/RHI/Metal_RHI_Mac.cpp @@ -122,11 +122,6 @@ namespace Platform return reinterpret_cast([nativeWindow.contentViewController view]); } - void ApplyTileDimentions(MTLRenderPassDescriptor* mtlRenderPassDescriptor) - { - AZ_UNUSED(mtlRenderPassDescriptor); - } - void SynchronizeBufferOnCPU(id mtlBuffer, size_t bufferOffset, size_t bufferSize) { if(mtlBuffer.storageMode == MTLStorageModeManaged) diff --git a/Gems/Atom/RHI/Metal/Code/Source/Platform/iOS/RHI/Metal_RHI_iOS.cpp b/Gems/Atom/RHI/Metal/Code/Source/Platform/iOS/RHI/Metal_RHI_iOS.cpp index 0f07323525..faa1216c25 100644 --- a/Gems/Atom/RHI/Metal/Code/Source/Platform/iOS/RHI/Metal_RHI_iOS.cpp +++ b/Gems/Atom/RHI/Metal/Code/Source/Platform/iOS/RHI/Metal_RHI_iOS.cpp @@ -88,17 +88,6 @@ namespace Platform return reinterpret_cast([nativeWindow.rootViewController view]); } - void ApplyTileDimentions(MTLRenderPassDescriptor* mtlRenderPassDescriptor) - { - //Metal driver has a bug where if the tile dimensions changes between passes it will - //generate incorrect vertex positions (possible vertex invariance). For example vertex invariance was - //observed between Depth pass and forward pass. Hence for now we are setting global tile dimentions across all passes. - //For performance sake we should eventually remove this once this bug is addressed. - //[GFX_TODO][ATOM-13440] - Remove once driver bug is addressed. - mtlRenderPassDescriptor.tileWidth = 16; - mtlRenderPassDescriptor.tileHeight = 16; - } - void SynchronizeBufferOnCPU(id mtlBuffer, size_t bufferOffset, size_t bufferSize) { //No synchronization needed as ios uses shared memory and does not support MTLStorageModeManaged diff --git a/Gems/Atom/RHI/Metal/Code/Source/RHI/Scope.cpp b/Gems/Atom/RHI/Metal/Code/Source/RHI/Scope.cpp index aad1b848e5..d70a4d4e60 100644 --- a/Gems/Atom/RHI/Metal/Code/Source/RHI/Scope.cpp +++ b/Gems/Atom/RHI/Metal/Code/Source/RHI/Scope.cpp @@ -17,10 +17,6 @@ #include #include -namespace Platform -{ - void ApplyTileDimentions(MTLRenderPassDescriptor* mtlRenderPassDescriptor); -} namespace AZ { @@ -88,7 +84,6 @@ namespace AZ { AZ_Assert(m_renderPassDescriptor == nil, "m_renderPassDescriptor should be null"); m_renderPassDescriptor = [MTLRenderPassDescriptor renderPassDescriptor]; - Platform::ApplyTileDimentions(m_renderPassDescriptor); } if(GetEstimatedItemCount()) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/ShaderResourceGroup.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/ShaderResourceGroup.cpp index e00a51d867..499365a9a9 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/ShaderResourceGroup.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/ShaderResourceGroup.cpp @@ -98,7 +98,7 @@ namespace AZ { return RHI::ResultCode::Fail; } - m_shaderResourceGroup->SetName(srgName); + m_shaderResourceGroup->SetName(m_pool->GetRHIPool()->GetName()); m_data = RHI::ShaderResourceGroupData(m_layout); m_asset = { &shaderAsset, AZ::Data::AssetLoadBehavior::PreLoad }; From 36f2207558d00d7ab8374af74f331bab06135102 Mon Sep 17 00:00:00 2001 From: sconel Date: Tue, 20 Jul 2021 16:11:49 -0700 Subject: [PATCH 17/17] Remove unneeded fields from Entity and EditorTransform JsonSerializers Signed-off-by: sconel --- .../AzCore/Component/EntitySerializer.cpp | 23 ------------------- .../TransformComponentSerializer.cpp | 20 ---------------- 2 files changed, 43 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Component/EntitySerializer.cpp b/Code/Framework/AzCore/AzCore/Component/EntitySerializer.cpp index 530ea9e01b..16452be76d 100644 --- a/Code/Framework/AzCore/AzCore/Component/EntitySerializer.cpp +++ b/Code/Framework/AzCore/AzCore/Component/EntitySerializer.cpp @@ -89,15 +89,6 @@ namespace AZ result.Combine(componentLoadResult); } - { - JSR::ResultCode dependencyReadyLoadResult = - ContinueLoadingFromJsonObjectField(&entityInstance->m_isDependencyReady, - azrtti_typeidm_isDependencyReady)>(), - inputValue, "IsDependencyReady", context); - - result.Combine(dependencyReadyLoadResult); - } - { JSR::ResultCode runtimeActiveLoadResult = ContinueLoadingFromJsonObjectField(&entityInstance->m_isRuntimeActiveByDefault, @@ -184,20 +175,6 @@ namespace AZ result.Combine(resultComponents); } - { - AZ::ScopedContextPath subPathDependencyReady(context, "m_isDependencyReady"); - const bool* dependencyReady = &entityInstance->m_isDependencyReady; - const bool* dependencyReadyDefault = - defaultEntityInstance ? &defaultEntityInstance->m_isDependencyReady : nullptr; - - JSR::ResultCode resultDependencyReady = - ContinueStoringToJsonObjectField(outputValue, "IsDependencyReady", - dependencyReady, dependencyReadyDefault, - azrtti_typeidm_isDependencyReady)>(), context); - - result.Combine(resultDependencyReady); - } - { AZ::ScopedContextPath subPathRuntimeActive(context, "m_isRuntimeActiveByDefault"); const bool* runtimeActive = &entityInstance->m_isRuntimeActiveByDefault; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformComponentSerializer.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformComponentSerializer.cpp index f791d0f403..0e3d27ee26 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformComponentSerializer.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformComponentSerializer.cpp @@ -67,14 +67,6 @@ namespace AzToolsFramework result.Combine(isStaticLoadResult); } - { - JSR::ResultCode netSyncEnabledLoadResult = ContinueLoadingFromJsonObjectField( - &transformComponentInstance->m_netSyncEnabled, azrtti_typeidm_netSyncEnabled)>(), - inputValue, "Sync Enabled", context); - - result.Combine(netSyncEnabledLoadResult); - } - { JSR::ResultCode interpolatePositionLoadResult = ContinueLoadingFromJsonObjectField( &transformComponentInstance->m_interpolatePosition, azrtti_typeidm_interpolatePosition)>(), @@ -172,18 +164,6 @@ namespace AzToolsFramework result.Combine(resultIsStatic); } - { - AZ::ScopedContextPath subPathName(context, "m_netSyncEnabled"); - const bool* netSyncEnabled = &transformComponentInstance->m_netSyncEnabled; - const bool* defaultNetSyncEnabled = defaultTransformComponentInstance ? &defaultTransformComponentInstance->m_netSyncEnabled : nullptr; - - JSR::ResultCode resultNetSyncEnabled = ContinueStoringToJsonObjectField( - outputValue, "Sync Enabled", netSyncEnabled, defaultNetSyncEnabled, azrtti_typeidm_netSyncEnabled)>(), - context); - - result.Combine(resultNetSyncEnabled); - } - { AZ::ScopedContextPath subPathName(context, "m_interpolatePosition"); const AZ::InterpolationMode* interpolatePosition = &transformComponentInstance->m_interpolatePosition;