diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000000..d7ede549bc --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,128 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, religion, or sexual identity +and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the + overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or + advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email + address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +conduct@o3de.org. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series +of actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or +permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within +the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.0, available at +https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. + +Community Impact Guidelines were inspired by [Mozilla's code of conduct +enforcement ladder](https://github.com/mozilla/diversity). + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see the FAQ at +https://www.contributor-covenant.org/faq. Translations are available at +https://www.contributor-covenant.org/translations. diff --git a/Code/Sandbox/Editor/CryEdit.cpp b/Code/Sandbox/Editor/CryEdit.cpp index b9c4f92ae8..e143e4dc66 100644 --- a/Code/Sandbox/Editor/CryEdit.cpp +++ b/Code/Sandbox/Editor/CryEdit.cpp @@ -2312,13 +2312,6 @@ int CCryEditApp::IdleProcessing(bool bBackgroundUpdate) m_bPrevActive = bActive; - AZStd::chrono::system_clock::time_point now = AZStd::chrono::system_clock::now(); - static AZStd::chrono::system_clock::time_point lastUpdate = now; - - AZStd::chrono::duration delta = now - lastUpdate; - - lastUpdate = now; - // Don't tick application if we're doing idle processing during an assert. const bool isErrorWindowVisible = (gEnv && gEnv->pSystem->IsAssertDialogVisible()); if (isErrorWindowVisible) @@ -2330,15 +2323,11 @@ int CCryEditApp::IdleProcessing(bool bBackgroundUpdate) } else if (bActive || (bBackgroundUpdate && !bIsAppWindow)) { - if (GetIEditor()->IsInGameMode()) - { - // Update Game - GetIEditor()->GetGameEngine()->Update(); - } - else - { - GetIEditor()->GetGameEngine()->Update(); + // Update Game + GetIEditor()->GetGameEngine()->Update(); + if (!GetIEditor()->IsInGameMode()) + { if (m_pEditor) { m_pEditor->Update(); @@ -2351,15 +2340,13 @@ int CCryEditApp::IdleProcessing(bool bBackgroundUpdate) { pEditor->GetSystem()->DoWorkDuringOcclusionChecks(); } + } - // Since the rendering is done based on the eNotify_OnIdleUpdate, we should trigger a TickSystem as well. - // To ensure that there's a system tick for every render done in Idle - AZ::ComponentApplication* componentApplication = nullptr; - AZ::ComponentApplicationBus::BroadcastResult(componentApplication, &AZ::ComponentApplicationRequests::GetApplication); - if (componentApplication) - { - componentApplication->TickSystem(); - } + AZ::ComponentApplication* componentApplication = nullptr; + AZ::ComponentApplicationBus::BroadcastResult(componentApplication, &AZ::ComponentApplicationRequests::GetApplication); + if (componentApplication) + { + componentApplication->TickSystem(); } } else if (GetIEditor()->GetSystem() && GetIEditor()->GetSystem()->GetILog()) diff --git a/Code/Sandbox/Editor/EditorViewportWidget.cpp b/Code/Sandbox/Editor/EditorViewportWidget.cpp index 72d0487087..82ec8e4092 100644 --- a/Code/Sandbox/Editor/EditorViewportWidget.cpp +++ b/Code/Sandbox/Editor/EditorViewportWidget.cpp @@ -100,7 +100,7 @@ AZ_CVAR( bool, ed_visibility_logTiming, false, nullptr, AZ::ConsoleFunctorFlags::Null, "Output the timing of the new IVisibilitySystem query"); -AZ_CVAR(bool, ed_useNewCameraSystem, false, nullptr, AZ::ConsoleFunctorFlags::Null, "Use the new Editor camera system"); +AZ_CVAR(bool, ed_useNewCameraSystem, true, nullptr, AZ::ConsoleFunctorFlags::Null, "Use the new Editor camera system"); namespace SandboxEditor { diff --git a/Code/Sandbox/Editor/MainWindow.cpp b/Code/Sandbox/Editor/MainWindow.cpp index d4741eafb8..05a1a027b0 100644 --- a/Code/Sandbox/Editor/MainWindow.cpp +++ b/Code/Sandbox/Editor/MainWindow.cpp @@ -489,11 +489,6 @@ void MainWindow::Initialize() ActionOverrideRequestBus::Event( GetEntityContextId(), &ActionOverrideRequests::SetupActionOverrideHandler, this); - // This function only happens after we're pretty sure that the engine has successfully started - so now would be a good time to start ticking the message pumps/etc. - AzToolsFramework::Ticker* ticker = new AzToolsFramework::Ticker(this); - ticker->Start(); - connect(ticker, &AzToolsFramework::Ticker::Tick, this, &MainWindow::SystemTick); - AzToolsFramework::EditorEventsBus::Broadcast(&AzToolsFramework::EditorEvents::NotifyMainWindowInitialized, this); } diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Utils/ProfilingCaptureBus.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Utils/ProfilingCaptureBus.h index 540d3971fc..7d61c99b43 100644 --- a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Utils/ProfilingCaptureBus.h +++ b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Utils/ProfilingCaptureBus.h @@ -17,7 +17,7 @@ namespace AZ { public: virtual ~ProfilingCaptureRequests() = default; - + //! Dump the Timestamp from passes to a json file. virtual bool CapturePassTimestamp(const AZStd::string& outputFilePath) = 0; @@ -27,6 +27,8 @@ namespace AZ //! Dump the Cpu Profiling Statistics to a json file. virtual bool CaptureCpuProfilingStatistics(const AZStd::string& outputFilePath) = 0; + //! Dump the benchmark metadata to a json file. + virtual bool CaptureBenchmarkMetadata(const AZStd::string& benchmarkName, const AZStd::string& outputFilePath) = 0; }; using ProfilingCaptureRequestBus = EBus; @@ -35,21 +37,26 @@ namespace AZ { public: virtual ~ProfilingCaptureNotifications() = default; - + //! Notify when the current Timestamp query capture is finished //! @param result Set to true if it's finished successfully - //! @param info The output file path or error information which depends on the return. + //! @param info The output file path or error information which depends on the return. virtual void OnCaptureQueryTimestampFinished(bool result, const AZStd::string& info) = 0; //! Notify when the current PipelineStatistics query capture is finished //! @param result Set to true if it's finished successfully - //! @param info The output file path or error information which depends on the return. + //! @param info The output file path or error information which depends on the return. virtual void OnCaptureQueryPipelineStatisticsFinished(bool result, const AZStd::string& info) = 0; //! Notify when the current CpuProfilingStatistics capture is finished //! @param result Set to true if it's finished successfully - //! @param info The output file path or error information which depends on the return. + //! @param info The output file path or error information which depends on the return. virtual void OnCaptureCpuProfilingStatisticsFinished(bool result, const AZStd::string& info) = 0; + + //! Notify when the current BenchmarkMetadata capture is finished + //! @param result Set to true if it's finished successfully + //! @param info The output file path or error information which depends on the return. + virtual void OnCaptureBenchmarkMetadataFinished(bool result, const AZStd::string& info) = 0; }; using ProfilingCaptureNotificationBus = EBus; diff --git a/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp index 89d52a8bdd..0321fd6954 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -550,7 +551,10 @@ namespace AZ } else { - AZ_Error("MeshDataInstance::OnAssetReady", false, "Failed to create model instance for '%s'", asset.GetHint().c_str()); + //when running with null renderer, the RPI::Model::FindOrCreate(...) is expected to return nullptr, so suppress this error. + AZ_Error( + "MeshDataInstance::OnAssetReady", RHI::IsNullRenderer(), "Failed to create model instance for '%s'", + asset.GetHint().c_str()); } } diff --git a/Gems/Atom/Feature/Common/Code/Source/ProfilingCaptureSystemComponent.cpp b/Gems/Atom/Feature/Common/Code/Source/ProfilingCaptureSystemComponent.cpp index 113e28db3b..64c1ddd676 100644 --- a/Gems/Atom/Feature/Common/Code/Source/ProfilingCaptureSystemComponent.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/ProfilingCaptureSystemComponent.cpp @@ -8,6 +8,7 @@ #include "ProfilingCaptureSystemComponent.h" #include +#include #include #include @@ -33,7 +34,8 @@ namespace AZ AZ_EBUS_BEHAVIOR_BINDER(ProfilingCaptureNotificationBusHandler, "{E45E4F37-EC1F-4010-994B-4F80998BEF15}", AZ::SystemAllocator, OnCaptureQueryTimestampFinished, OnCaptureQueryPipelineStatisticsFinished, - OnCaptureCpuProfilingStatisticsFinished + OnCaptureCpuProfilingStatisticsFinished, + OnCaptureBenchmarkMetadataFinished ); void OnCaptureQueryTimestampFinished(bool result, const AZStd::string& info) override @@ -51,6 +53,11 @@ namespace AZ Call(FN_OnCaptureCpuProfilingStatisticsFinished, result, info); } + void OnCaptureBenchmarkMetadataFinished(bool result, const AZStd::string& info) override + { + Call(FN_OnCaptureBenchmarkMetadataFinished, result, info); + } + static void Reflect(AZ::ReflectContext* context) { if (AZ::BehaviorContext* behaviorContext = azrtti_cast(context)) @@ -121,7 +128,7 @@ namespace AZ static void Reflect(AZ::ReflectContext* context); CpuProfilingStatisticsSerializerEntry() = default; - CpuProfilingStatisticsSerializerEntry(const RHI::CachedTimeRegion& cahcedTimeRegion); + CpuProfilingStatisticsSerializerEntry(const RHI::CachedTimeRegion& cachedTimeRegion); private: Name m_groupName; @@ -139,6 +146,34 @@ namespace AZ AZStd::vector m_cpuProfilingStatisticsSerializerEntries; }; + // Intermediate class to serialize benchmark metadata. + class BenchmarkMetadataSerializer + { + public: + class GpuEntry + { + public: + AZ_TYPE_INFO(Render::BenchmarkMetadataSerializer::GpuEntry, "{3D5C2DDE-59FB-4E28-9605-D2A083E34505}"); + static void Reflect(AZ::ReflectContext* context); + + GpuEntry() = default; + GpuEntry(const RHI::PhysicalDeviceDescriptor& descriptor); + + private: + AZStd::string m_description; + uint32_t m_driverVersion; + }; + + AZ_TYPE_INFO(Render::BenchmarkMetadataSerializer, "{2BC41B6F-528F-4E59-AEDA-3B9D74E323EC}"); + static void Reflect(AZ::ReflectContext* context); + + BenchmarkMetadataSerializer() = default; + BenchmarkMetadataSerializer(const AZStd::string& benchmarkName, const RHI::PhysicalDeviceDescriptor& gpuDescriptor); + + AZStd::string m_benchmarkName; + GpuEntry m_gpuEntry; + }; + // --- DelayedQueryCaptureHelper --- bool DelayedQueryCaptureHelper::StartCapture(CaptureCallback&& captureCallback) @@ -309,6 +344,49 @@ namespace AZ } } + // --- BenchmarkMetadataSerializer --- + + BenchmarkMetadataSerializer::BenchmarkMetadataSerializer(const AZStd::string& benchmarkName, const RHI::PhysicalDeviceDescriptor& gpuDescriptor) + { + m_benchmarkName = benchmarkName; + m_gpuEntry = GpuEntry(gpuDescriptor); + } + + void BenchmarkMetadataSerializer::Reflect(AZ::ReflectContext* context) + { + if (auto* serializeContext = azrtti_cast(context)) + { + serializeContext->Class() + ->Version(1) + ->Field("benchmarkName", &BenchmarkMetadataSerializer::m_benchmarkName) + ->Field("gpuInfo", &BenchmarkMetadataSerializer::m_gpuEntry) + ; + } + + GpuEntry::Reflect(context); + } + + // --- GpuEntry --- + + BenchmarkMetadataSerializer::GpuEntry::GpuEntry(const RHI::PhysicalDeviceDescriptor& descriptor) + { + m_description = descriptor.m_description; + m_driverVersion = descriptor.m_driverVersion; + } + + + void BenchmarkMetadataSerializer::GpuEntry::Reflect(AZ::ReflectContext* context) + { + if (auto* serializeContext = azrtti_cast(context)) + { + serializeContext->Class() + ->Version(1) + ->Field("description", &GpuEntry::m_description) + ->Field("driverVersion", &GpuEntry::m_driverVersion) + ; + } + } + // --- ProfilingCaptureSystemComponent --- void ProfilingCaptureSystemComponent::Reflect(AZ::ReflectContext* context) @@ -328,6 +406,7 @@ namespace AZ ->Event("CapturePassTimestamp", &ProfilingCaptureRequestBus::Events::CapturePassTimestamp) ->Event("CapturePassPipelineStatistics", &ProfilingCaptureRequestBus::Events::CapturePassPipelineStatistics) ->Event("CaptureCpuProfilingStatistics", &ProfilingCaptureRequestBus::Events::CaptureCpuProfilingStatistics) + ->Event("CaptureBenchmarkMetadata", &ProfilingCaptureRequestBus::Events::CaptureBenchmarkMetadata) ; ProfilingCaptureNotificationBusHandler::Reflect(context); @@ -336,6 +415,7 @@ namespace AZ TimestampSerializer::Reflect(context); PipelineStatisticsSerializer::Reflect(context); CpuProfilingStatisticsSerializer::Reflect(context); + BenchmarkMetadataSerializer::Reflect(context); } void ProfilingCaptureSystemComponent::Activate() @@ -507,6 +587,43 @@ namespace AZ return captureStarted; } + bool ProfilingCaptureSystemComponent::CaptureBenchmarkMetadata(const AZStd::string& benchmarkName, const AZStd::string& outputFilePath) + { + const bool captureStarted = m_benchmarkMetadataCapture.StartCapture([this, benchmarkName, outputFilePath]() + { + JsonSerializerSettings serializationSettings; + serializationSettings.m_keepDefaults = true; + + const RHI::PhysicalDeviceDescriptor& gpuDescriptor = RHI::GetRHIDevice()->GetPhysicalDevice().GetDescriptor(); + + BenchmarkMetadataSerializer serializer(benchmarkName, gpuDescriptor); + const auto saveResult = JsonSerializationUtils::SaveObjectToFile(&serializer, + outputFilePath, (BenchmarkMetadataSerializer*)nullptr, &serializationSettings); + + AZStd::string captureInfo = outputFilePath; + if (!saveResult.IsSuccess()) + { + captureInfo = AZStd::string::format("Failed to save benchmark metadata data to file '%s'. Error: %s", + outputFilePath.c_str(), + saveResult.GetError().c_str()); + AZ_Warning("ProfilingCaptureSystemComponent", false, captureInfo.c_str()); + } + + // Notify listeners that the benchmark metadata capture has finished. + ProfilingCaptureNotificationBus::Broadcast(&ProfilingCaptureNotificationBus::Events::OnCaptureBenchmarkMetadataFinished, + saveResult.IsSuccess(), + captureInfo); + }); + + // Start the TickBus. + if (captureStarted) + { + TickBus::Handler::BusConnect(); + } + + return captureStarted; + } + AZStd::vector ProfilingCaptureSystemComponent::CollectPassesRecursively(const RPI::Pass* root) const { AZStd::vector passes; @@ -548,9 +665,10 @@ namespace AZ m_timestampCapture.UpdateCapture(); m_pipelineStatisticsCapture.UpdateCapture(); m_cpuProfilingStatisticsCapture.UpdateCapture(); + m_benchmarkMetadataCapture.UpdateCapture(); // Disconnect from the TickBus if all capture states are set to idle. - if (m_timestampCapture.IsIdle() && m_pipelineStatisticsCapture.IsIdle() && m_cpuProfilingStatisticsCapture.IsIdle()) + if (m_timestampCapture.IsIdle() && m_pipelineStatisticsCapture.IsIdle() && m_cpuProfilingStatisticsCapture.IsIdle() && m_benchmarkMetadataCapture.IsIdle()) { TickBus::Handler::BusDisconnect(); } diff --git a/Gems/Atom/Feature/Common/Code/Source/ProfilingCaptureSystemComponent.h b/Gems/Atom/Feature/Common/Code/Source/ProfilingCaptureSystemComponent.h index 8442761408..5bfa6722d1 100644 --- a/Gems/Atom/Feature/Common/Code/Source/ProfilingCaptureSystemComponent.h +++ b/Gems/Atom/Feature/Common/Code/Source/ProfilingCaptureSystemComponent.h @@ -69,6 +69,7 @@ namespace AZ bool CapturePassTimestamp(const AZStd::string& outputFilePath) override; bool CapturePassPipelineStatistics(const AZStd::string& outputFilePath) override; bool CaptureCpuProfilingStatistics(const AZStd::string& outputFilePath) override; + bool CaptureBenchmarkMetadata(const AZStd::string& benchmarkName, const AZStd::string& outputFilePath) override; private: void OnTick(float deltaTime, ScriptTimePoint time) override; @@ -81,6 +82,7 @@ namespace AZ DelayedQueryCaptureHelper m_timestampCapture; DelayedQueryCaptureHelper m_pipelineStatisticsCapture; DelayedQueryCaptureHelper m_cpuProfilingStatisticsCapture; + DelayedQueryCaptureHelper m_benchmarkMetadataCapture; }; } } diff --git a/scripts/build/bootstrap/incremental_build_util.py b/scripts/build/bootstrap/incremental_build_util.py index c5e74d9ad7..df36757222 100755 --- a/scripts/build/bootstrap/incremental_build_util.py +++ b/scripts/build/bootstrap/incremental_build_util.py @@ -198,6 +198,7 @@ def create_volume(ec2_client, availability_zone, snapshot_hint, repository_name, parameters = dict( AvailabilityZone = availability_zone, VolumeType=disk_type, + Encrypted=True, TagSpecifications= [{ 'ResourceType': 'volume', 'Tags': [