Merge branch 'main' into cpack_installer
This commit is contained in:
@@ -18,3 +18,4 @@ _savebackup/
|
||||
#Output folder for test results when running Automated Tests
|
||||
TestResults/**
|
||||
*.swatches
|
||||
/imgui.ini
|
||||
|
||||
@@ -9,12 +9,38 @@
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
file(READ "${CMAKE_CURRENT_LIST_DIR}/project.json" project_json)
|
||||
#! Adds the --project-path argument to the VS IDE debugger command arguments
|
||||
function(add_vs_debugger_arguments)
|
||||
# Inject the project root into the --project-path argument into the Visual Studio Debugger arguments by defaults
|
||||
list(APPEND app_targets AutomatedTesting.GameLauncher AutomatedTesting.ServerLauncher)
|
||||
list(APPEND app_targets AssetBuilder AssetProcessor AssetProcessorBatch Editor)
|
||||
foreach(app_target IN LISTS app_targets)
|
||||
if (TARGET ${app_target})
|
||||
set_property(TARGET ${app_target} APPEND PROPERTY VS_DEBUGGER_COMMAND_ARGUMENTS "--project-path=\"${CMAKE_CURRENT_LIST_DIR}\"")
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
string(JSON project_target_name ERROR_VARIABLE json_error GET ${project_json} "project_name")
|
||||
if(${json_error})
|
||||
message(FATAL_ERROR "Unable to read key 'project_name' from 'project.json'")
|
||||
endif()
|
||||
if(NOT PROJECT_NAME)
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
project(AutomatedTesting
|
||||
LANGUAGES C CXX
|
||||
VERSION 1.0.0.0
|
||||
)
|
||||
include(EngineFinder.cmake OPTIONAL)
|
||||
find_package(o3de REQUIRED)
|
||||
o3de_initialize()
|
||||
add_vs_debugger_arguments()
|
||||
else()
|
||||
# Add the project_name to global LY_PROJECTS_TARGET_NAME property
|
||||
file(READ "${CMAKE_CURRENT_LIST_DIR}/project.json" project_json)
|
||||
|
||||
set_property(GLOBAL APPEND PROPERTY LY_PROJECTS_TARGET_NAME ${project_target_name})
|
||||
add_subdirectory(Gem)
|
||||
string(JSON project_target_name ERROR_VARIABLE json_error GET ${project_json} "project_name")
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read key 'project_name' from 'project.json'")
|
||||
endif()
|
||||
|
||||
set_property(GLOBAL APPEND PROPERTY LY_PROJECTS_TARGET_NAME ${project_target_name})
|
||||
|
||||
add_subdirectory(Gem)
|
||||
endif()
|
||||
@@ -42,7 +42,6 @@ set(GEM_DEPENDENCIES
|
||||
Gem::SurfaceData
|
||||
Gem::GradientSignal
|
||||
Gem::Vegetation
|
||||
|
||||
Gem::Atom_RHI.Private
|
||||
Gem::Atom_RPI.Private
|
||||
Gem::Atom_Feature_Common
|
||||
@@ -54,4 +53,5 @@ set(GEM_DEPENDENCIES
|
||||
Gem::ImguiAtom
|
||||
Gem::Atom_AtomBridge
|
||||
Gem::AtomFont
|
||||
Gem::Blast
|
||||
)
|
||||
|
||||
@@ -68,4 +68,5 @@ set(GEM_DEPENDENCIES
|
||||
Gem::ImguiAtom
|
||||
Gem::AtomFont
|
||||
Gem::AtomToolsFramework.Editor
|
||||
Gem::Blast.Editor
|
||||
)
|
||||
|
||||
@@ -27,28 +27,28 @@ from base import TestAutomationBase
|
||||
class TestAutomation(TestAutomationBase):
|
||||
def test_ActorSplitsAfterCollision(self, request, workspace, editor, launcher_platform):
|
||||
from . import ActorSplitsAfterCollision as test_module
|
||||
self._run_test(request, workspace, editor, test_module, expected_lines=[], unexpected_lines=["Assert"])
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
|
||||
def test_ActorSplitsAfterRadialDamage(self, request, workspace, editor, launcher_platform):
|
||||
from . import ActorSplitsAfterRadialDamage as test_module
|
||||
self._run_test(request, workspace, editor, test_module, expected_lines=[], unexpected_lines=["Assert"])
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
|
||||
def test_ActorSplitsAfterCapsuleDamage(self, request, workspace, editor, launcher_platform):
|
||||
from . import ActorSplitsAfterCapsuleDamage as test_module
|
||||
self._run_test(request, workspace, editor, test_module, expected_lines=[], unexpected_lines=["Assert"])
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
|
||||
def test_ActorSplitsAfterImpactSpreadDamage(self, request, workspace, editor, launcher_platform):
|
||||
from . import ActorSplitsAfterImpactSpreadDamage as test_module
|
||||
self._run_test(request, workspace, editor, test_module, expected_lines=[], unexpected_lines=["Assert"])
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
|
||||
def test_ActorSplitsAfterShearDamage(self, request, workspace, editor, launcher_platform):
|
||||
from . import ActorSplitsAfterShearDamage as test_module
|
||||
self._run_test(request, workspace, editor, test_module, expected_lines=[], unexpected_lines=["Assert"])
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
|
||||
def test_ActorSplitsAfterTriangleDamage(self, request, workspace, editor, launcher_platform):
|
||||
from . import ActorSplitsAfterTriangleDamage as test_module
|
||||
self._run_test(request, workspace, editor, test_module, expected_lines=[], unexpected_lines=["Assert"])
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
|
||||
def test_ActorSplitsAfterStressDamage(self, request, workspace, editor, launcher_platform):
|
||||
from . import ActorSplitsAfterStressDamage as test_module
|
||||
self._run_test(request, workspace, editor, test_module, expected_lines=[], unexpected_lines=["Assert"])
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
|
||||
@@ -135,20 +135,18 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
endif()
|
||||
|
||||
## Blast ##
|
||||
# Disabled until AutomatedTesting runs with Atom.
|
||||
# if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
# ly_add_pytest(
|
||||
# NAME AutomatedTesting::BlastTests
|
||||
# TEST_SERIAL TRUE
|
||||
# PATH ${CMAKE_CURRENT_LIST_DIR}/Blast/TestSuite_Active.py
|
||||
# TIMEOUT 500
|
||||
# RUNTIME_DEPENDENCIES
|
||||
# Legacy::Editor
|
||||
# Legacy::CryRenderNULL
|
||||
# AZ::AssetProcessor
|
||||
# AutomatedTesting.Assets
|
||||
# )
|
||||
# endif()
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::BlastTests
|
||||
TEST_SERIAL TRUE
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/Blast/TestSuite_Active.py
|
||||
TIMEOUT 3600
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
)
|
||||
endif()
|
||||
|
||||
#############
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<ObjectStream version="3">
|
||||
<Class name="BlastGlobalConfiguration" version="1" type="{0B9DB6DD-0008-4EF6-9D75-141061144353}">
|
||||
<Class name="Asset" field="BlastMaterialLibrary" value="id={251AC171-6B9C-562D-A235-4EF5E1AE6871}:0,type={55F38C86-0767-4E7F-830A-A4BF624BE4DA},hint={assets/destruction/automated_testing.blastmaterial}" version="1" type="{77A19D40-8731-4D3C-9041-1B43047366A4}"/>
|
||||
<Class name="Asset" field="BlastMaterialLibrary" value="id={251AC171-6B9C-562D-A235-4EF5E1AE6871}:0,type={55F38C86-0767-4E7F-830A-A4BF624BE4DA},hint={assets/destruction/automated_testing.blastmaterial},loadBehavior=1" version="2" type="{77A19D40-8731-4D3C-9041-1B43047366A4}"/>
|
||||
<Class name="unsigned int" field="StressSolverIterations" value="180" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
</Class>
|
||||
</ObjectStream>
|
||||
|
||||
@@ -19,9 +19,6 @@ namespace AZ
|
||||
{
|
||||
class Vector3;
|
||||
|
||||
//! Do not allow the scale to be zero to avoid problems with inverting scale.
|
||||
static constexpr float MinNonUniformScale = 1e-3f;
|
||||
|
||||
using NonUniformScaleChangedEvent = AZ::Event<const AZ::Vector3&>;
|
||||
|
||||
//! Requests for working with non-uniform scale.
|
||||
|
||||
@@ -38,6 +38,13 @@ namespace AZ
|
||||
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.
|
||||
//! @{
|
||||
static constexpr float MinTransformScale = 1e-2f;
|
||||
static constexpr float MaxTransformScale = 1e9f;
|
||||
//! @}
|
||||
|
||||
//! The basic transformation class, represented using a quaternion rotation, vector scale and vector translation.
|
||||
//! By design, cannot represent skew transformations.
|
||||
class Transform
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
#include <AzFramework/Components/NonUniformScaleComponent.h>
|
||||
#include <AzCore/Serialization/SerializeContext.h>
|
||||
#include <AzCore/Math/Transform.h>
|
||||
#include <AzCore/Math/ToString.h>
|
||||
#include <AzCore/Component/Entity.h>
|
||||
|
||||
@@ -81,13 +82,13 @@ namespace AzFramework
|
||||
|
||||
void NonUniformScaleComponent::SetScale(const AZ::Vector3& scale)
|
||||
{
|
||||
if (scale.GetMinElement() >= AZ::MinNonUniformScale)
|
||||
if (scale.GetMinElement() >= AZ::MinTransformScale && scale.GetMaxElement() <= AZ::MaxTransformScale)
|
||||
{
|
||||
m_scale = scale;
|
||||
}
|
||||
else
|
||||
{
|
||||
AZ::Vector3 clampedScale = scale.GetMax(AZ::Vector3(AZ::MinNonUniformScale));
|
||||
AZ::Vector3 clampedScale = scale.GetClamp(AZ::Vector3(AZ::MinTransformScale), AZ::Vector3(AZ::MaxTransformScale));
|
||||
AZ_Warning("Non-uniform Scale Component", false, "SetScale value was clamped from %s to %s for entity %s",
|
||||
AZ::ToString(scale).c_str(), AZ::ToString(clampedScale).c_str(), GetEntity()->GetName().c_str());
|
||||
m_scale = clampedScale;
|
||||
|
||||
@@ -256,6 +256,8 @@ namespace AzToolsFramework
|
||||
|
||||
m_userSettings = AZ::UserSettings::CreateFind<AssetEditorWidgetUserSettings>(k_assetEditorWidgetSettings, AZ::UserSettings::CT_LOCAL);
|
||||
|
||||
UpdateRecentFileListState();
|
||||
|
||||
QObject::connect(m_recentFileMenu, &QMenu::aboutToShow, this, &AssetEditorWidget::PopulateRecentMenu);
|
||||
}
|
||||
|
||||
@@ -952,7 +954,8 @@ namespace AzToolsFramework
|
||||
|
||||
void AssetEditorWidget::AddRecentPath(const AZStd::string& recentPath)
|
||||
{
|
||||
m_userSettings->AddRecentPath(recentPath);
|
||||
m_userSettings->AddRecentPath(recentPath);
|
||||
UpdateRecentFileListState();
|
||||
}
|
||||
|
||||
void AssetEditorWidget::PopulateRecentMenu()
|
||||
@@ -989,6 +992,21 @@ namespace AzToolsFramework
|
||||
m_saveAsAssetAction->setEnabled(true);
|
||||
}
|
||||
|
||||
void AssetEditorWidget::UpdateRecentFileListState()
|
||||
{
|
||||
if (m_recentFileMenu)
|
||||
{
|
||||
if (!m_userSettings || m_userSettings->m_recentPaths.empty())
|
||||
{
|
||||
m_recentFileMenu->setEnabled(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_recentFileMenu->setEnabled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace AssetEditor
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
|
||||
@@ -122,6 +122,8 @@ namespace AzToolsFramework
|
||||
void OnCatalogAssetAdded(const AZ::Data::AssetId& assetId) override;
|
||||
void OnCatalogAssetRemoved(const AZ::Data::AssetId& assetId, const AZ::Data::AssetInfo& assetInfo) override;
|
||||
|
||||
void UpdateRecentFileListState();
|
||||
|
||||
private:
|
||||
void DirtyAsset();
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace AzToolsFramework
|
||||
m_prefabUndoCache.Destroy();
|
||||
}
|
||||
|
||||
PrefabOperationResult PrefabPublicHandler::CreatePrefab(const AZStd::vector<AZ::EntityId>& entityIds, AZStd::string_view filePath)
|
||||
PrefabOperationResult PrefabPublicHandler::CreatePrefab(const AZStd::vector<AZ::EntityId>& entityIds, AZ::IO::PathView filePath)
|
||||
{
|
||||
// Retrieve entityList from entityIds
|
||||
EntityList inputEntityList;
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace AzToolsFramework
|
||||
void UnregisterPrefabPublicHandlerInterface();
|
||||
|
||||
// PrefabPublicInterface...
|
||||
PrefabOperationResult CreatePrefab(const AZStd::vector<AZ::EntityId>& entityIds, AZStd::string_view filePath) override;
|
||||
PrefabOperationResult CreatePrefab(const AZStd::vector<AZ::EntityId>& entityIds, AZ::IO::PathView filePath) override;
|
||||
PrefabOperationResult InstantiatePrefab(AZStd::string_view filePath, AZ::EntityId parent, AZ::Vector3 position) override;
|
||||
PrefabOperationResult SavePrefab(AZ::IO::Path filePath) override;
|
||||
PrefabEntityResult CreateEntity(AZ::EntityId parentId, const AZ::Vector3& position) override;
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace AzToolsFramework
|
||||
* @param filePath The path for the new prefab file.
|
||||
* @return An outcome object; on failure, it comes with an error message detailing the cause of the error.
|
||||
*/
|
||||
virtual PrefabOperationResult CreatePrefab(const AZStd::vector<AZ::EntityId>& entityIds, AZStd::string_view filePath) = 0;
|
||||
virtual PrefabOperationResult CreatePrefab(const AZStd::vector<AZ::EntityId>& entityIds, AZ::IO::PathView filePath) = 0;
|
||||
|
||||
/**
|
||||
* Instantiate a prefab from a prefab file.
|
||||
|
||||
+6
-3
@@ -13,6 +13,7 @@
|
||||
#include <AzToolsFramework/ToolsComponents/EditorNonUniformScaleComponent.h>
|
||||
#include <AzCore/Serialization/EditContext.h>
|
||||
#include <AzFramework/Components/NonUniformScaleComponent.h>
|
||||
#include <AzCore/Math/Transform.h>
|
||||
#include <AzCore/Math/ToString.h>
|
||||
|
||||
namespace AzToolsFramework
|
||||
@@ -44,7 +45,9 @@ namespace AzToolsFramework
|
||||
->DataElement(
|
||||
AZ::Edit::UIHandlers::Default, &EditorNonUniformScaleComponent::m_scale, "Non-uniform Scale",
|
||||
"Non-uniform scale for this entity only (does not propagate through hierarchy)")
|
||||
->Attribute(AZ::Edit::Attributes::Min, AZ::MinNonUniformScale)
|
||||
->Attribute(AZ::Edit::Attributes::Min, AZ::MinTransformScale)
|
||||
->Attribute(AZ::Edit::Attributes::Max, AZ::MaxTransformScale)
|
||||
->Attribute(AZ::Edit::Attributes::Step, 0.1f)
|
||||
->Attribute(AZ::Edit::Attributes::ChangeNotify, &EditorNonUniformScaleComponent::OnScaleChanged)
|
||||
;
|
||||
}
|
||||
@@ -106,13 +109,13 @@ namespace AzToolsFramework
|
||||
|
||||
void EditorNonUniformScaleComponent::SetScale(const AZ::Vector3& scale)
|
||||
{
|
||||
if (scale.GetMinElement() >= AZ::MinNonUniformScale)
|
||||
if (scale.GetMinElement() >= AZ::MinTransformScale && scale.GetMaxElement() <= AZ::MaxTransformScale)
|
||||
{
|
||||
m_scale = scale;
|
||||
}
|
||||
else
|
||||
{
|
||||
AZ::Vector3 clampedScale = scale.GetMax(AZ::Vector3(AZ::MinNonUniformScale));
|
||||
AZ::Vector3 clampedScale = scale.GetClamp(AZ::Vector3(AZ::MinTransformScale), AZ::Vector3(AZ::MaxTransformScale));
|
||||
AZ_Warning("Editor Non-uniform Scale Component", false, "SetScale value was clamped from %s to %s for entity %s",
|
||||
AZ::ToString(scale).c_str(), AZ::ToString(clampedScale).c_str(), GetEntity()->GetName().c_str());
|
||||
m_scale = clampedScale;
|
||||
|
||||
-1
@@ -1276,7 +1276,6 @@ namespace AzToolsFramework
|
||||
Attribute(AZ::Edit::Attributes::SliceFlags, AZ::Edit::SliceFlags::NotPushableOnSliceRoot)->
|
||||
DataElement(TransformScaleHandler, &EditorTransform::m_scale, "Scale", "Local Scale")->
|
||||
Attribute(AZ::Edit::Attributes::Step, 0.1f)->
|
||||
Attribute(AZ::Edit::Attributes::Min, 0.01f)->
|
||||
Attribute(AZ::Edit::Attributes::ReadOnly, &EditorTransform::m_locked)
|
||||
;
|
||||
}
|
||||
|
||||
+3
-2
@@ -12,6 +12,7 @@
|
||||
|
||||
#include "AzToolsFramework_precompiled.h"
|
||||
#include <ToolsComponents/TransformScalePropertyHandler.h>
|
||||
#include <AzCore/Math/Transform.h>
|
||||
#include <AzCore/Math/Vector3.h>
|
||||
|
||||
namespace AzToolsFramework
|
||||
@@ -36,8 +37,8 @@ namespace AzToolsFramework
|
||||
AzToolsFramework::PropertyEditorGUIMessages::Bus::Broadcast(&AzToolsFramework::PropertyEditorGUIMessages::RequestWrite, newCtrl);
|
||||
});
|
||||
|
||||
newCtrl->setMinimum(0.01f);
|
||||
newCtrl->setMaximum(std::numeric_limits<float>::max());
|
||||
newCtrl->setMinimum(AZ::MinTransformScale);
|
||||
newCtrl->setMaximum(AZ::MaxTransformScale);
|
||||
|
||||
return newCtrl;
|
||||
}
|
||||
|
||||
+14
-2
@@ -24,6 +24,7 @@
|
||||
#include <AzToolsFramework/AssetBrowser/AssetBrowserBus.h>
|
||||
#include <AzToolsFramework/AssetBrowser/AssetSelectionModel.h>
|
||||
#include <AzToolsFramework/AssetBrowser/Entries/SourceAssetBrowserEntry.h>
|
||||
#include <AzToolsFramework/Prefab/PrefabLoaderInterface.h>
|
||||
#include <AzToolsFramework/ToolsComponents/EditorLayerComponentBus.h>
|
||||
#include <AzToolsFramework/UI/EditorEntityUi/EditorEntityUiInterface.h>
|
||||
#include <AzToolsFramework/UI/Prefab/PrefabIntegrationInterface.h>
|
||||
@@ -39,9 +40,12 @@ namespace AzToolsFramework
|
||||
{
|
||||
namespace Prefab
|
||||
{
|
||||
|
||||
EditorEntityUiInterface* PrefabIntegrationManager::s_editorEntityUiInterface = nullptr;
|
||||
PrefabPublicInterface* PrefabIntegrationManager::s_prefabPublicInterface = nullptr;
|
||||
PrefabEditInterface* PrefabIntegrationManager::s_prefabEditInterface = nullptr;
|
||||
PrefabLoaderInterface* PrefabIntegrationManager::s_prefabLoaderInterface = nullptr;
|
||||
|
||||
const AZStd::string PrefabIntegrationManager::s_prefabFileExtension = ".prefab";
|
||||
|
||||
void PrefabUserSettings::Reflect(AZ::ReflectContext* context)
|
||||
@@ -79,6 +83,13 @@ namespace AzToolsFramework
|
||||
return;
|
||||
}
|
||||
|
||||
s_prefabLoaderInterface = AZ::Interface<PrefabLoaderInterface>::Get();
|
||||
if (s_prefabLoaderInterface == nullptr)
|
||||
{
|
||||
AZ_Assert(false, "Prefab - could not get PrefabLoaderInterface on PrefabIntegrationManager construction.");
|
||||
return;
|
||||
}
|
||||
|
||||
EditorContextMenuBus::Handler::BusConnect();
|
||||
PrefabInstanceContainerNotificationBus::Handler::BusConnect();
|
||||
AZ::Interface<PrefabIntegrationInterface>::Register(this);
|
||||
@@ -320,14 +331,15 @@ namespace AzToolsFramework
|
||||
|
||||
GenerateSuggestedFilenameFromEntities(prefabRootEntities, suggestedName);
|
||||
|
||||
if (!QueryUserForPrefabSaveLocation(suggestedName, targetDirectory, AZ_CRC("PrefabUserSettings"), activeWindow, prefabName, prefabFilePath))
|
||||
if (!QueryUserForPrefabSaveLocation(
|
||||
suggestedName, targetDirectory, AZ_CRC("PrefabUserSettings"), activeWindow, prefabName, prefabFilePath))
|
||||
{
|
||||
// User canceled prefab creation, or error prevented continuation.
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
auto createPrefabOutcome = s_prefabPublicInterface->CreatePrefab(selectedEntities, prefabFilePath);
|
||||
auto createPrefabOutcome = s_prefabPublicInterface->CreatePrefab(selectedEntities, s_prefabLoaderInterface->GetRelativePathToProject(prefabFilePath.data()));
|
||||
|
||||
if (!createPrefabOutcome.IsSuccess())
|
||||
{
|
||||
|
||||
@@ -29,6 +29,9 @@ namespace AzToolsFramework
|
||||
{
|
||||
namespace Prefab
|
||||
{
|
||||
|
||||
class PrefabLoaderInterface;
|
||||
|
||||
//! Structure for saving/retrieving user settings related to prefab workflows.
|
||||
class PrefabUserSettings
|
||||
: public AZ::UserSettings
|
||||
@@ -129,6 +132,7 @@ namespace AzToolsFramework
|
||||
static EditorEntityUiInterface* s_editorEntityUiInterface;
|
||||
static PrefabPublicInterface* s_prefabPublicInterface;
|
||||
static PrefabEditInterface* s_prefabEditInterface;
|
||||
static PrefabLoaderInterface* s_prefabLoaderInterface;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1603,7 +1603,7 @@ namespace AzToolsFramework
|
||||
|
||||
const AZ::Vector3 uniformScale = AZ::Vector3(action.m_start.m_sign * sumVectorElements(action.LocalScaleOffset()));
|
||||
const AZ::Vector3 scale = (AZ::Vector3::CreateOne() +
|
||||
(uniformScale / initialScale)).GetMax(AZ::Vector3(0.01f));
|
||||
(uniformScale / initialScale)).GetClamp(AZ::Vector3(AZ::MinTransformScale), AZ::Vector3(AZ::MaxTransformScale));
|
||||
const AZ::Transform scaleTransform = AZ::Transform::CreateScale(scale);
|
||||
|
||||
if (action.m_modifiers.Alt())
|
||||
|
||||
@@ -18,6 +18,21 @@ foreach(project_name project_path IN ZIP_LISTS LY_PROJECTS_TARGET_NAME LY_PROJEC
|
||||
# If the project_path is relative, it is evaluated relative to the ${LY_ROOT_FOLDER}
|
||||
# Otherwise the the absolute project_path is returned with symlinks resolved
|
||||
file(REAL_PATH ${project_path} project_real_path BASE_DIRECTORY ${LY_ROOT_FOLDER})
|
||||
if(NOT project_name)
|
||||
if(NOT EXISTS ${project_real_path}/project.json)
|
||||
message(FATAL_ERROR "The specified project path of ${project_real_path} does not contain a project.json file")
|
||||
else()
|
||||
# Add the project_name to global LY_PROJECTS_TARGET_NAME property
|
||||
file(READ "${project_real_path}/project.json" project_json)
|
||||
string(JSON project_name ERROR_VARIABLE json_error GET ${project_json} "project_name")
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "There is an error reading the \"project_name\" key from the '${project_real_path}/project.json' file: ${json_error}")
|
||||
endif()
|
||||
message(WARNING "The project located at path ${project_real_path} has a valid \"project name\" of '${project_name}' read from it's project.json file."
|
||||
" This indicates that the ${project_real_path}/CMakeLists.txt is not properly appending the \"project name\" "
|
||||
"to the LY_PROJECTS_TARGET_NAME global property. Other configuration errors might occur")
|
||||
endif()
|
||||
endif()
|
||||
################################################################################
|
||||
# Monolithic game
|
||||
################################################################################
|
||||
|
||||
@@ -96,6 +96,11 @@ bool LegacyViewportCameraControllerInstance::HandleMouseMove(
|
||||
speedScale *= gSettings.cameraFastMoveSpeed;
|
||||
}
|
||||
|
||||
if (m_inMoveMode || m_inOrbitMode || m_inRotateMode || m_inZoomMode)
|
||||
{
|
||||
m_totalMouseMoveDelta += (QPoint(currentMousePos.m_x, currentMousePos.m_y)-QPoint(previousMousePos.m_x, previousMousePos.m_y)).manhattanLength();
|
||||
}
|
||||
|
||||
if ((m_inRotateMode && m_inMoveMode) || m_inZoomMode)
|
||||
{
|
||||
Matrix34 m = AZTransformToLYTransform(viewportContext->GetCameraTransform());
|
||||
@@ -343,11 +348,15 @@ bool LegacyViewportCameraControllerInstance::HandleInputChannelEvent(const AzFra
|
||||
}
|
||||
|
||||
shouldCaptureCursor = true;
|
||||
// Record how much the cursor has been moved to see if we should own the mouse up event.
|
||||
m_totalMouseMoveDelta = 0;
|
||||
}
|
||||
else if (state == InputChannel::State::Ended)
|
||||
{
|
||||
m_inZoomMode = false;
|
||||
m_inRotateMode = false;
|
||||
// If we've moved the cursor more than a couple pixels, we should eat this mouse up event to prevent the context menu controller from seeing it.
|
||||
shouldConsumeEvent = m_totalMouseMoveDelta > 2;
|
||||
shouldCaptureCursor = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,6 +58,7 @@ namespace SandboxEditor
|
||||
bool m_inMoveMode = false;
|
||||
bool m_inOrbitMode = false;
|
||||
bool m_inZoomMode = false;
|
||||
int m_totalMouseMoveDelta = 0;
|
||||
float m_orbitDistance = 10.f;
|
||||
float m_moveSpeed = 1.f;
|
||||
AZ::Vector3 m_orbitTarget = {};
|
||||
|
||||
@@ -102,7 +102,8 @@ namespace AZ
|
||||
// Register Shader Resource Group Layout Builder
|
||||
AssetBuilderSDK::AssetBuilderDesc srgLayoutBuilderDescriptor;
|
||||
srgLayoutBuilderDescriptor.m_name = "Shader Resource Group Layout Builder";
|
||||
srgLayoutBuilderDescriptor.m_version = 52; // ATOM-14780
|
||||
srgLayoutBuilderDescriptor.m_version = 53; // ATOM-15196
|
||||
|
||||
srgLayoutBuilderDescriptor.m_patterns.push_back(AssetBuilderSDK::AssetBuilderPattern("*.azsl", AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard));
|
||||
srgLayoutBuilderDescriptor.m_patterns.push_back(AssetBuilderSDK::AssetBuilderPattern("*.azsli", AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard));
|
||||
srgLayoutBuilderDescriptor.m_patterns.push_back(AssetBuilderSDK::AssetBuilderPattern(AZStd::string::format("*.%s", SrgLayoutBuilder::MergedPartialSrgsExtension), AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard));
|
||||
@@ -117,7 +118,7 @@ namespace AZ
|
||||
// Register Shader Asset Builder
|
||||
AssetBuilderSDK::AssetBuilderDesc shaderAssetBuilderDescriptor;
|
||||
shaderAssetBuilderDescriptor.m_name = "Shader Asset Builder";
|
||||
shaderAssetBuilderDescriptor.m_version = 96; // SPEC-6065
|
||||
shaderAssetBuilderDescriptor.m_version = 97; // ATOM-15196
|
||||
// .shader file changes trigger rebuilds
|
||||
shaderAssetBuilderDescriptor.m_patterns.push_back(AssetBuilderSDK::AssetBuilderPattern( AZStd::string::format("*.%s", RPI::ShaderSourceData::Extension), AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard));
|
||||
shaderAssetBuilderDescriptor.m_busId = azrtti_typeid<ShaderAssetBuilder>();
|
||||
@@ -132,7 +133,7 @@ namespace AZ
|
||||
shaderVariantAssetBuilderDescriptor.m_name = "Shader Variant Asset Builder";
|
||||
// Both "Shader Variant Asset Builder" and "Shader Asset Builder" produce ShaderVariantAsset products. If you update
|
||||
// ShaderVariantAsset you will need to update BOTH version numbers, not just "Shader Variant Asset Builder".
|
||||
shaderVariantAssetBuilderDescriptor.m_version = 17; // SPEC-6065
|
||||
shaderVariantAssetBuilderDescriptor.m_version = 18; // ATOM-15196
|
||||
shaderVariantAssetBuilderDescriptor.m_patterns.push_back(AssetBuilderSDK::AssetBuilderPattern(AZStd::string::format("*.%s", RPI::ShaderVariantListSourceData::Extension), AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard));
|
||||
shaderVariantAssetBuilderDescriptor.m_busId = azrtti_typeid<ShaderVariantAssetBuilder>();
|
||||
shaderVariantAssetBuilderDescriptor.m_createJobFunction = AZStd::bind(&ShaderVariantAssetBuilder::CreateJobs, &m_shaderVariantAssetBuilder, AZStd::placeholders::_1, AZStd::placeholders::_2);
|
||||
|
||||
@@ -646,8 +646,8 @@ namespace AZ
|
||||
return 0; // Nothing to draw.
|
||||
}
|
||||
|
||||
auto vertexBuffer = RPI::DynamicDrawInterface::Get()->GetDynamicBuffer(totalVtxBufferSize);
|
||||
auto indexBuffer = RPI::DynamicDrawInterface::Get()->GetDynamicBuffer(totalIdxBufferSize);
|
||||
auto vertexBuffer = RPI::DynamicDrawInterface::Get()->GetDynamicBuffer(totalVtxBufferSize, RHI::Alignment::InputAssembly);
|
||||
auto indexBuffer = RPI::DynamicDrawInterface::Get()->GetDynamicBuffer(totalIdxBufferSize, RHI::Alignment::InputAssembly);
|
||||
|
||||
if (!vertexBuffer || !indexBuffer)
|
||||
{
|
||||
|
||||
@@ -186,7 +186,7 @@ namespace AZ
|
||||
{
|
||||
for (const RPI::Pass* pass : passes)
|
||||
{
|
||||
m_timestampEntries.push_back({ pass->GetName(), pass->GetTimestampResult().GetTimestampInNanoseconds() });
|
||||
m_timestampEntries.push_back({pass->GetName(), pass->GetLatestTimestampResult().GetDurationInNanoseconds()});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ namespace AZ
|
||||
{
|
||||
for (const RPI::Pass* pass : passes)
|
||||
{
|
||||
m_pipelineStatisticsEntries.push_back({ pass->GetName(), pass->GetPipelineStatisticsResult() });
|
||||
m_pipelineStatisticsEntries.push_back({pass->GetName(), pass->GetLatestPipelineStatisticsResult()});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,38 +30,42 @@ namespace AZ
|
||||
{
|
||||
None = 0,
|
||||
|
||||
/// Supports input assembly access through a IndexBufferView or StreamBufferView.
|
||||
/// Supports input assembly access through a IndexBufferView or StreamBufferView. This flag is for buffers that are not updated often
|
||||
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),
|
||||
|
||||
/// Supports constant access through a ShaderResourceGroup.
|
||||
Constant = AZ_BIT(1),
|
||||
Constant = AZ_BIT(2),
|
||||
|
||||
/// Supports read access through a ShaderResourceGroup.
|
||||
ShaderRead = AZ_BIT(2),
|
||||
ShaderRead = AZ_BIT(3),
|
||||
|
||||
/// Supports write access through ShaderResourceGroup.
|
||||
ShaderWrite = AZ_BIT(3),
|
||||
ShaderWrite = AZ_BIT(4),
|
||||
|
||||
/// Supports read-write access through a ShaderResourceGroup.
|
||||
ShaderReadWrite = ShaderRead | ShaderWrite,
|
||||
|
||||
/// Supports read access for GPU copy operations.
|
||||
CopyRead = AZ_BIT(4),
|
||||
CopyRead = AZ_BIT(5),
|
||||
|
||||
/// Supports write access for GPU copy operations.
|
||||
CopyWrite = AZ_BIT(5),
|
||||
CopyWrite = AZ_BIT(6),
|
||||
|
||||
/// Supports predication access for conditional rendering.
|
||||
Predication = AZ_BIT(6),
|
||||
Predication = AZ_BIT(7),
|
||||
|
||||
/// Supports indirect buffer access for indirect draw/dispatch.
|
||||
Indirect = AZ_BIT(7),
|
||||
Indirect = AZ_BIT(8),
|
||||
|
||||
/// Supports ray tracing acceleration structure usage.
|
||||
RayTracingAccelerationStructure = AZ_BIT(8),
|
||||
RayTracingAccelerationStructure = AZ_BIT(9),
|
||||
|
||||
/// Supports ray tracing shader table usage.
|
||||
RayTracingShaderTable = AZ_BIT(9)
|
||||
RayTracingShaderTable = AZ_BIT(10)
|
||||
|
||||
};
|
||||
|
||||
AZ_DEFINE_ENUM_BITWISE_OPERATORS(AZ::RHI::BufferBindFlags);
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace AZ
|
||||
if (SerializeContext* serializeContext = azrtti_cast<SerializeContext*>(context))
|
||||
{
|
||||
serializeContext->Class<ReflectSystemComponent, AZ::Component>()
|
||||
->Version(2);
|
||||
->Version(3);
|
||||
}
|
||||
|
||||
ReflectNamedEnums(context);
|
||||
@@ -266,6 +266,7 @@ namespace AZ
|
||||
serializeContext->Enum<BufferBindFlags>()
|
||||
->Value("None", BufferBindFlags::None)
|
||||
->Value("InputAssembly", BufferBindFlags::InputAssembly)
|
||||
->Value("DynamicInputAssembly", BufferBindFlags::DynamicInputAssembly)
|
||||
->Value("Constant", BufferBindFlags::Constant)
|
||||
->Value("CopyRead", BufferBindFlags::CopyRead)
|
||||
->Value("CopyWrite", BufferBindFlags::CopyWrite)
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace AZ
|
||||
// needs to be a multiple of elementsize as well as divisible by DX12::Alignment types.
|
||||
m_usePageAllocator = false;
|
||||
|
||||
if (!RHI::CheckBitsAny(descriptor.m_bindFlags, RHI::BufferBindFlags::ShaderWrite | RHI::BufferBindFlags::CopyWrite | RHI::BufferBindFlags::InputAssembly))
|
||||
if (!RHI::CheckBitsAny(descriptor.m_bindFlags, RHI::BufferBindFlags::ShaderWrite | RHI::BufferBindFlags::CopyWrite | RHI::BufferBindFlags::InputAssembly | RHI::BufferBindFlags::DynamicInputAssembly))
|
||||
{
|
||||
m_usePageAllocator = true;
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace AZ
|
||||
{
|
||||
m_device = &device;
|
||||
|
||||
if (RHI::CheckBitsAll(descriptor.m_bindFlags, RHI::BufferBindFlags::InputAssembly))
|
||||
if(RHI::CheckBitsAny(descriptor.m_bindFlags, RHI::BufferBindFlags::InputAssembly | RHI::BufferBindFlags::DynamicInputAssembly))
|
||||
{
|
||||
m_readOnlyState |= D3D12_RESOURCE_STATE_VERTEX_AND_CONSTANT_BUFFER | D3D12_RESOURCE_STATE_INDEX_BUFFER;
|
||||
}
|
||||
|
||||
@@ -670,7 +670,13 @@ namespace AZ
|
||||
}
|
||||
else
|
||||
{
|
||||
result &= AddExistingResourceEntry("texture", resourceStartPos, regId, argBufferStr);
|
||||
bool isAdditionSuccessfull = AddExistingResourceEntry("texture", resourceStartPos, regId, argBufferStr);
|
||||
if(!isAdditionSuccessfull)
|
||||
{
|
||||
//In metal depth textures use keyword depth2d/depth2d_array/depthcube/depthcube_array/depth2d_ms/depth2d_ms_array
|
||||
isAdditionSuccessfull |= AddExistingResourceEntry("depth", resourceStartPos, regId, argBufferStr);
|
||||
}
|
||||
result &= isAdditionSuccessfull;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
@@ -827,10 +833,13 @@ namespace AZ
|
||||
AZStd::string& argBufferStr) const
|
||||
{
|
||||
size_t prevEndOfLine = argBufferStr.rfind("\n", resourceStartPos);
|
||||
size_t nextEndOfLine = argBufferStr.find("\n", resourceStartPos);
|
||||
size_t startOfEntryPos = argBufferStr.find(resourceStr, prevEndOfLine);
|
||||
if(startOfEntryPos == AZStd::string::npos)
|
||||
|
||||
//Check to see if a valid entry is found.
|
||||
if(startOfEntryPos == AZStd::string::npos || startOfEntryPos > nextEndOfLine)
|
||||
{
|
||||
AZ_Error(MetalShaderPlatformName, false, "Entry-> %s not found within Descriptor set %s", resourceStr, argBufferStr.c_str());
|
||||
AZ_Error(MetalShaderPlatformName, startOfEntryPos != AZStd::string::npos, "Entry-> %s not found within Descriptor set %s", resourceStr, argBufferStr.c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -295,7 +295,7 @@ namespace AZ
|
||||
|
||||
const RHI::Size sourceSize = RHI::Size(subresourceLayout.m_size.m_width, heightToCopy, 1);
|
||||
const RHI::Origin sourceOrigin = RHI::Origin(0, destHeight, depth);
|
||||
CopyBufferToImage(framePacket, image, stagingRowPitch, stagingSlicePitch,
|
||||
CopyBufferToImage(framePacket, image, stagingRowPitch, bytesCopied,
|
||||
curMip, arraySlice, sourceSize, sourceOrigin);
|
||||
|
||||
framePacket->m_dataOffset += stagingSize;
|
||||
|
||||
@@ -210,6 +210,12 @@ namespace AZ
|
||||
{
|
||||
return GetCPUGPUMemoryMode();
|
||||
}
|
||||
|
||||
//This flag is used for IA buffers that is updated frequently and hence shared mmory is the best fit
|
||||
if (RHI::CheckBitsAll(descriptor.m_bindFlags, RHI::BufferBindFlags::DynamicInputAssembly))
|
||||
{
|
||||
return MTLStorageModeShared;
|
||||
}
|
||||
|
||||
return GetCPUGPUMemoryMode();
|
||||
}
|
||||
|
||||
@@ -107,6 +107,7 @@ namespace AZ
|
||||
bool forceUnique = RHI::CheckBitsAny(
|
||||
bufferDescriptor.m_bindFlags,
|
||||
RHI::BufferBindFlags::InputAssembly |
|
||||
RHI::BufferBindFlags::DynamicInputAssembly |
|
||||
RHI::BufferBindFlags::RayTracingAccelerationStructure |
|
||||
RHI::BufferBindFlags::RayTracingShaderTable);
|
||||
|
||||
|
||||
@@ -685,7 +685,7 @@ namespace AZ
|
||||
using BindFlags = RHI::BufferBindFlags;
|
||||
VkBufferUsageFlags usageFlags{ 0 };
|
||||
|
||||
if (RHI::CheckBitsAny(bindFlags, BindFlags::InputAssembly))
|
||||
if (RHI::CheckBitsAny(bindFlags, BindFlags::InputAssembly | BindFlags::DynamicInputAssembly))
|
||||
{
|
||||
usageFlags |=
|
||||
VK_BUFFER_USAGE_INDEX_BUFFER_BIT |
|
||||
@@ -932,7 +932,7 @@ namespace AZ
|
||||
VkPipelineStageFlags GetResourcePipelineStateFlags(const RHI::BufferBindFlags& bindFlags)
|
||||
{
|
||||
VkPipelineStageFlags stagesFlags = {};
|
||||
if (RHI::CheckBitsAny(bindFlags, RHI::BufferBindFlags::InputAssembly))
|
||||
if (RHI::CheckBitsAny(bindFlags, RHI::BufferBindFlags::InputAssembly | RHI::BufferBindFlags::DynamicInputAssembly))
|
||||
{
|
||||
stagesFlags |= VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT | VK_PIPELINE_STAGE_VERTEX_INPUT_BIT;
|
||||
}
|
||||
@@ -1042,7 +1042,7 @@ namespace AZ
|
||||
VkAccessFlags GetResourceAccessFlags(const RHI::BufferBindFlags& bindFlags)
|
||||
{
|
||||
VkAccessFlags accessFlags = {};
|
||||
if (RHI::CheckBitsAny(bindFlags, RHI::BufferBindFlags::InputAssembly))
|
||||
if (RHI::CheckBitsAny(bindFlags, RHI::BufferBindFlags::InputAssembly | RHI::BufferBindFlags::DynamicInputAssembly))
|
||||
{
|
||||
accessFlags |= VK_ACCESS_INDIRECT_COMMAND_READ_BIT | VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT | VK_ACCESS_INDEX_READ_BIT;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,6 @@
|
||||
"BudgetInBytes": 25165824,
|
||||
"BufferPoolHeapMemoryLevel": "Host",
|
||||
"BufferPoolhostMemoryAccess": "Write",
|
||||
"BufferPoolBindFlags": "InputAssembly"
|
||||
"BufferPoolBindFlags": "DynamicInputAssembly"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace AZ
|
||||
//! buffer->Write(data, size);
|
||||
//! // Use the buffer view for DrawItem or etc.
|
||||
//! }
|
||||
//! Note: DynamicBuffer should only be used for InputAssembly buffer or Constant buffer (not supported yet).
|
||||
//! Note: DynamicBuffer should only be used for DynamicInputAssembly buffer or Constant buffer (not supported yet).
|
||||
class DynamicBuffer
|
||||
: public AZStd::intrusive_base
|
||||
{
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <Atom/RHI.Reflect/AttachmentEnums.h>
|
||||
#include <Atom/RHI.Reflect/QueryPoolDescriptor.h>
|
||||
|
||||
#include <AtomCore/std/containers/array_view.h>
|
||||
@@ -43,15 +44,19 @@ namespace AZ
|
||||
{
|
||||
public:
|
||||
TimestampResult() = default;
|
||||
TimestampResult(uint64_t timestampInTicks);
|
||||
TimestampResult(uint64_t timestampQueryResultLow, uint64_t timestampQueryResultHigh);
|
||||
TimestampResult(AZStd::array_view<TimestampResult>&& timestampResultArray);
|
||||
TimestampResult(uint64_t beginTick, uint64_t endTick, RHI::HardwareQueueClass hardwareQueueClass);
|
||||
|
||||
uint64_t GetTimestampInNanoseconds() const;
|
||||
uint64_t GetTimestampInTicks() const;
|
||||
uint64_t GetDurationInNanoseconds() const;
|
||||
uint64_t GetDurationInTicks() const;
|
||||
uint64_t GetTimestampBeginInTicks() const;
|
||||
|
||||
void Add(const TimestampResult& extent);
|
||||
|
||||
private:
|
||||
uint64_t m_timestampInTicks = 0u;
|
||||
// the timestamp of begin and duration in ticks.
|
||||
uint64_t m_begin = 0;
|
||||
uint64_t m_duration = 0;
|
||||
RHI::HardwareQueueClass m_hardwareQueueClass = RHI::HardwareQueueClass::Graphics;
|
||||
};
|
||||
|
||||
//! The structure that is used to read back the results form the PipelineStatistics queries
|
||||
|
||||
@@ -122,7 +122,6 @@ namespace AZ
|
||||
|
||||
private:
|
||||
// RPI::Pass overrides...
|
||||
TimestampResult GetTimestampResultInternal() const override;
|
||||
PipelineStatisticsResult GetPipelineStatisticsResultInternal() const override;
|
||||
|
||||
// --- Hierarchy related functions ---
|
||||
|
||||
@@ -211,11 +211,11 @@ namespace AZ
|
||||
//! Prints the pass
|
||||
virtual void DebugPrint() const;
|
||||
|
||||
//! Return the Timestamp result of this pass
|
||||
TimestampResult GetTimestampResult() const;
|
||||
//! Return the latest Timestamp result of this pass
|
||||
TimestampResult GetLatestTimestampResult() const;
|
||||
|
||||
//! Return the PipelineStatistic result of this pass
|
||||
PipelineStatisticsResult GetPipelineStatisticsResult() const;
|
||||
//! Return the latest PipelineStatistic result of this pass
|
||||
PipelineStatisticsResult GetLatestPipelineStatisticsResult() const;
|
||||
|
||||
//! Enables/Disables Timestamp queries for this pass
|
||||
virtual void SetTimestampQueryEnabled(bool enable);
|
||||
|
||||
@@ -74,8 +74,9 @@ namespace AZ
|
||||
|
||||
const RHI::BufferView* Buffer::GetBufferView() const
|
||||
{
|
||||
if (m_rhiBuffer->GetDescriptor().m_bindFlags == RHI::BufferBindFlags::InputAssembly)
|
||||
if(RHI::CheckBitsAny(m_rhiBuffer->GetDescriptor().m_bindFlags, RHI::BufferBindFlags::InputAssembly | RHI::BufferBindFlags::DynamicInputAssembly))
|
||||
{
|
||||
|
||||
AZ_Assert(false, "Input assembly buffer doesn't need a regular buffer view, it requires a stream or index buffer view.");
|
||||
return nullptr;
|
||||
}
|
||||
@@ -203,11 +204,11 @@ namespace AZ
|
||||
void Buffer::InitBufferView()
|
||||
{
|
||||
// Skip buffer view creation for input assembly buffers
|
||||
if (m_rhiBuffer->GetDescriptor().m_bindFlags == RHI::BufferBindFlags::InputAssembly)
|
||||
if(RHI::CheckBitsAny(m_rhiBuffer->GetDescriptor().m_bindFlags, RHI::BufferBindFlags::InputAssembly | RHI::BufferBindFlags::DynamicInputAssembly))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
m_bufferView = m_rhiBuffer->GetBufferView(m_bufferViewDescriptor);
|
||||
|
||||
if(!m_bufferView.get())
|
||||
|
||||
@@ -100,12 +100,12 @@ namespace AZ
|
||||
bufferPoolDesc.m_hostMemoryAccess = RHI::HostMemoryAccess::Write;
|
||||
break;
|
||||
case CommonBufferPoolType::StaticInputAssembly:
|
||||
bufferPoolDesc.m_bindFlags = RHI::BufferBindFlags::InputAssembly;
|
||||
bufferPoolDesc.m_bindFlags = RHI::BufferBindFlags::InputAssembly | RHI::BufferBindFlags::ShaderRead;
|
||||
bufferPoolDesc.m_heapMemoryLevel = RHI::HeapMemoryLevel::Device;
|
||||
bufferPoolDesc.m_hostMemoryAccess = RHI::HostMemoryAccess::Write;
|
||||
break;
|
||||
case CommonBufferPoolType::DynamicInputAssembly:
|
||||
bufferPoolDesc.m_bindFlags = RHI::BufferBindFlags::InputAssembly;
|
||||
bufferPoolDesc.m_bindFlags = RHI::BufferBindFlags::DynamicInputAssembly | RHI::BufferBindFlags::ShaderRead;
|
||||
bufferPoolDesc.m_heapMemoryLevel = RHI::HeapMemoryLevel::Host;
|
||||
bufferPoolDesc.m_hostMemoryAccess = RHI::HostMemoryAccess::Write;
|
||||
break;
|
||||
|
||||
@@ -63,6 +63,7 @@ namespace AZ
|
||||
// [GFX TODO][ATOM-13182] Add unit tests for DynamicBufferAllocator's Allocate function
|
||||
RHI::Ptr<DynamicBuffer> DynamicBufferAllocator::Allocate(uint32_t size, [[maybe_unused]]uint32_t alignment)
|
||||
{
|
||||
size = RHI::AlignUp(size, alignment);
|
||||
uint32_t allocatePosition = 0;
|
||||
|
||||
//m_ringBufferStartAddress can be null for Null back end
|
||||
|
||||
@@ -21,41 +21,39 @@ namespace AZ
|
||||
namespace RPI
|
||||
{
|
||||
// --- TimestampResult ---
|
||||
|
||||
TimestampResult::TimestampResult(uint64_t timestampInTicks)
|
||||
TimestampResult::TimestampResult(uint64_t beginTick, uint64_t endTick, RHI::HardwareQueueClass hardwareQueueClass)
|
||||
{
|
||||
m_timestampInTicks = timestampInTicks;
|
||||
AZ_Assert(endTick >= beginTick, "TimestampResult: bad inputs");
|
||||
m_begin = beginTick;
|
||||
m_duration = endTick - beginTick;
|
||||
m_hardwareQueueClass = hardwareQueueClass;
|
||||
}
|
||||
|
||||
TimestampResult::TimestampResult(uint64_t timestampQueryResultLow, uint64_t timestampQueryResultHigh)
|
||||
{
|
||||
const uint64_t low = AZStd::min(timestampQueryResultLow, timestampQueryResultHigh);
|
||||
const uint64_t high = AZStd::max(timestampQueryResultLow, timestampQueryResultHigh);
|
||||
|
||||
m_timestampInTicks = high - low;
|
||||
}
|
||||
|
||||
TimestampResult::TimestampResult(AZStd::array_view<TimestampResult>&& timestampResultArray)
|
||||
{
|
||||
// Loop through all the child passes, and accumulate all the timestampTicks
|
||||
for (const TimestampResult& timestampResult : timestampResultArray)
|
||||
{
|
||||
m_timestampInTicks += timestampResult.m_timestampInTicks;
|
||||
}
|
||||
}
|
||||
|
||||
uint64_t TimestampResult::GetTimestampInNanoseconds() const
|
||||
uint64_t TimestampResult::GetDurationInNanoseconds() const
|
||||
{
|
||||
const RHI::Ptr<RHI::Device> device = RHI::GetRHIDevice();
|
||||
const AZStd::chrono::microseconds timeInMicroseconds = device->GpuTimestampToMicroseconds(m_timestampInTicks, RHI::HardwareQueueClass::Graphics);
|
||||
const AZStd::chrono::microseconds timeInMicroseconds = device->GpuTimestampToMicroseconds(m_duration, m_hardwareQueueClass);
|
||||
const auto timeInNanoseconds = AZStd::chrono::nanoseconds(timeInMicroseconds);
|
||||
|
||||
return static_cast<uint64_t>(timeInNanoseconds.count());
|
||||
}
|
||||
|
||||
uint64_t TimestampResult::GetTimestampInTicks() const
|
||||
uint64_t TimestampResult::GetDurationInTicks() const
|
||||
{
|
||||
return m_timestampInTicks;
|
||||
return m_duration;
|
||||
}
|
||||
|
||||
uint64_t TimestampResult::GetTimestampBeginInTicks() const
|
||||
{
|
||||
return m_begin;
|
||||
}
|
||||
|
||||
void TimestampResult::Add(const TimestampResult& extent)
|
||||
{
|
||||
uint64_t end1 = m_begin + m_duration;
|
||||
uint64_t end2 = extent.m_begin + extent.m_duration;
|
||||
m_begin = m_begin < extent.m_begin ? m_begin : extent.m_begin;
|
||||
m_duration = (end1 > end2 ? end1 : end2) - m_begin;
|
||||
}
|
||||
|
||||
// --- PipelineStatisticsResult ---
|
||||
|
||||
@@ -393,19 +393,6 @@ namespace AZ
|
||||
}
|
||||
}
|
||||
|
||||
TimestampResult ParentPass::GetTimestampResultInternal() const
|
||||
{
|
||||
AZStd::vector<TimestampResult> timestampResultArray;
|
||||
timestampResultArray.reserve(m_children.size());
|
||||
|
||||
// Calculate the Timestamp result by summing all of its child's TimestampResults
|
||||
for (const Ptr<Pass>& childPass : m_children)
|
||||
{
|
||||
timestampResultArray.emplace_back(childPass->GetTimestampResult());
|
||||
}
|
||||
return TimestampResult(timestampResultArray);
|
||||
}
|
||||
|
||||
PipelineStatisticsResult ParentPass::GetPipelineStatisticsResultInternal() const
|
||||
{
|
||||
AZStd::vector<PipelineStatisticsResult> pipelineStatisticsResultArray;
|
||||
@@ -414,7 +401,7 @@ namespace AZ
|
||||
// Calculate the PipelineStatistics result by summing all of its child's PipelineStatistics
|
||||
for (const Ptr<Pass>& childPass : m_children)
|
||||
{
|
||||
pipelineStatisticsResultArray.emplace_back(childPass->GetPipelineStatisticsResult());
|
||||
pipelineStatisticsResultArray.emplace_back(childPass->GetLatestPipelineStatisticsResult());
|
||||
}
|
||||
return PipelineStatisticsResult(pipelineStatisticsResultArray);
|
||||
}
|
||||
|
||||
@@ -1273,24 +1273,14 @@ namespace AZ
|
||||
}
|
||||
}
|
||||
|
||||
TimestampResult Pass::GetTimestampResult() const
|
||||
TimestampResult Pass::GetLatestTimestampResult() const
|
||||
{
|
||||
if (IsEnabled() && IsTimestampQueryEnabled())
|
||||
{
|
||||
return GetTimestampResultInternal();
|
||||
}
|
||||
|
||||
return TimestampResult();
|
||||
return GetTimestampResultInternal();
|
||||
}
|
||||
|
||||
PipelineStatisticsResult Pass::GetPipelineStatisticsResult() const
|
||||
PipelineStatisticsResult Pass::GetLatestPipelineStatisticsResult() const
|
||||
{
|
||||
if (IsEnabled() && IsPipelineStatisticsQueryEnabled())
|
||||
{
|
||||
return GetPipelineStatisticsResultInternal();
|
||||
}
|
||||
|
||||
return PipelineStatisticsResult();
|
||||
return GetPipelineStatisticsResultInternal();
|
||||
}
|
||||
|
||||
TimestampResult Pass::GetTimestampResultInternal() const
|
||||
|
||||
@@ -174,7 +174,7 @@ namespace AZ
|
||||
}
|
||||
else if (GetAttachmentType() == RHI::AttachmentType::Buffer)
|
||||
{
|
||||
bool isInputAssembly = RHI::CheckBitsAny(m_descriptor.m_buffer.m_bindFlags, RHI::BufferBindFlags::InputAssembly);
|
||||
bool isInputAssembly = RHI::CheckBitsAny(m_descriptor.m_buffer.m_bindFlags, RHI::BufferBindFlags::InputAssembly | RHI::BufferBindFlags::DynamicInputAssembly);
|
||||
bool isConstant = RHI::CheckBitsAny(m_descriptor.m_buffer.m_bindFlags, RHI::BufferBindFlags::Constant);
|
||||
|
||||
// Since InputAssembly and Constant cannot be inferred they are set manually. If those flags are set we don't want to add inferred flags on top as it may have a performance penalty
|
||||
|
||||
@@ -539,7 +539,7 @@ namespace AZ
|
||||
const uint32_t TimestampResultQueryCount = 2u;
|
||||
uint64_t timestampResult[TimestampResultQueryCount] = {0};
|
||||
query->GetLatestResult(×tampResult, sizeof(uint64_t) * TimestampResultQueryCount);
|
||||
m_timestampResult = TimestampResult(timestampResult[0], timestampResult[1]);
|
||||
m_timestampResult = TimestampResult(timestampResult[0], timestampResult[1], RHI::HardwareQueueClass::Graphics);
|
||||
});
|
||||
|
||||
ExecuteOnPipelineStatisticsQuery([this](RHI::Ptr<Query> query)
|
||||
|
||||
@@ -173,6 +173,7 @@ namespace AZ
|
||||
m_serviceThread.join();
|
||||
Data::AssetBus::MultiHandler::BusDisconnect();
|
||||
|
||||
m_newShaderVariantPendingRequests.clear();
|
||||
m_shaderVariantTreePendingRequests.clear();
|
||||
m_shaderVariantPendingRequests.clear();
|
||||
m_shaderVariantData.clear();
|
||||
|
||||
@@ -109,8 +109,8 @@ namespace MaterialEditor
|
||||
AZ::RHI::Ptr<AZ::RPI::ParentPass> rootPass = AZ::RPI::PassSystemInterface::Get()->GetRootPass();
|
||||
if (rootPass)
|
||||
{
|
||||
AZ::RPI::TimestampResult timestampResult = rootPass->GetTimestampResult();
|
||||
double gpuFrameTimeMs = aznumeric_cast<double>(timestampResult.GetTimestampInNanoseconds()) / 1000000;
|
||||
AZ::RPI::TimestampResult timestampResult = rootPass->GetLatestTimestampResult();
|
||||
double gpuFrameTimeMs = aznumeric_cast<double>(timestampResult.GetDurationInNanoseconds()) / 1000000;
|
||||
m_gpuFrameTimeMs.PushSample(gpuFrameTimeMs);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,7 +93,9 @@ namespace AZ
|
||||
ImGuiPipelineStatisticsView();
|
||||
|
||||
//! Draw the PipelineStatistics window.
|
||||
void DrawPipelineStatisticsWindow(bool& draw, const PassEntry* rootPassEntry, AZStd::unordered_map<AZ::Name, PassEntry>& m_timestampEntryDatabase);
|
||||
void DrawPipelineStatisticsWindow(bool& draw, const PassEntry* rootPassEntry,
|
||||
AZStd::unordered_map<AZ::Name, PassEntry>& m_timestampEntryDatabase,
|
||||
AZ::RHI::Ptr<AZ::RPI::ParentPass> rootPass);
|
||||
|
||||
//! Total number of columns (Attribute columns + PassName column).
|
||||
static const uint32_t HeaderAttributeCount = PassEntry::PipelineStatisticsAttributeCount + 1u;
|
||||
@@ -139,6 +141,9 @@ namespace AZ
|
||||
|
||||
// ImGui filter used to filter passes by the user's input.
|
||||
ImGuiTextFilter m_passFilter;
|
||||
|
||||
// Pause and showing the pipeline statistics result when it's paused.
|
||||
bool m_paused = false;
|
||||
};
|
||||
|
||||
class ImGuiTimestampView
|
||||
@@ -180,9 +185,19 @@ namespace AZ
|
||||
Count
|
||||
};
|
||||
|
||||
// Timestamp refresh type .
|
||||
enum class RefreshType : int32_t
|
||||
{
|
||||
Realtime = 0,
|
||||
OncePerSecond,
|
||||
Count
|
||||
};
|
||||
|
||||
public:
|
||||
//! Draw the Timestamp window.
|
||||
void DrawTimestampWindow(bool& draw, const PassEntry* rootPassEntry, AZStd::unordered_map<Name, PassEntry>& m_timestampEntryDatabase);
|
||||
void DrawTimestampWindow(bool& draw, const PassEntry* rootPassEntry,
|
||||
AZStd::unordered_map<Name, PassEntry>& m_timestampEntryDatabase,
|
||||
AZ::RHI::Ptr<AZ::RPI::ParentPass> rootPass);
|
||||
|
||||
private:
|
||||
// Draw option for the hierarchical view of the passes.
|
||||
@@ -223,6 +238,20 @@ namespace AZ
|
||||
|
||||
// ImGui filter used to filter passes.
|
||||
ImGuiTextFilter m_passFilter;
|
||||
|
||||
// Pause and showing the timestamp result when it's paused.
|
||||
bool m_paused = false;
|
||||
|
||||
// Hide non-parent passes which has 0 execution time.
|
||||
bool m_hideZeroPasses = false;
|
||||
|
||||
// Show pass execution timeline
|
||||
bool m_showTimeline = false;
|
||||
|
||||
// Controls how often the timestamp data is refreshed
|
||||
RefreshType m_refreshType = RefreshType::OncePerSecond;
|
||||
AZStd::sys_time_t m_lastUpdateTimeMicroSecond;
|
||||
|
||||
};
|
||||
|
||||
class ImGuiGpuProfiler
|
||||
|
||||
@@ -105,9 +105,9 @@ namespace AZ
|
||||
|
||||
// [GFX TODO][ATOM-4001] Cache the timestamp and PipelineStatistics results.
|
||||
// Get the query results from the passes.
|
||||
m_timestampResult = pass->GetTimestampResult();
|
||||
m_timestampResult = pass->GetLatestTimestampResult();
|
||||
|
||||
const RPI::PipelineStatisticsResult rps = pass->GetPipelineStatisticsResult();
|
||||
const RPI::PipelineStatisticsResult rps = pass->GetLatestPipelineStatisticsResult();
|
||||
m_pipelineStatistics = { rps.m_vertexCount, rps.m_primitiveCount, rps.m_vertexShaderInvocationCount,
|
||||
rps.m_rasterizedPrimitiveCount, rps.m_renderedPrimitiveCount, rps.m_pixelShaderInvocationCount, rps.m_computeShaderInvocationCount };
|
||||
|
||||
@@ -153,7 +153,9 @@ namespace AZ
|
||||
|
||||
}
|
||||
|
||||
inline void ImGuiPipelineStatisticsView::DrawPipelineStatisticsWindow(bool& draw, const PassEntry* rootPassEntry, AZStd::unordered_map<Name, PassEntry>& passEntryDatabase)
|
||||
inline void ImGuiPipelineStatisticsView::DrawPipelineStatisticsWindow(bool& draw,
|
||||
const PassEntry* rootPassEntry, AZStd::unordered_map<Name, PassEntry>& passEntryDatabase,
|
||||
AZ::RHI::Ptr<RPI::ParentPass> rootPass)
|
||||
{
|
||||
// Early out if nothing is supposed to be drawn
|
||||
if (!draw)
|
||||
@@ -188,12 +190,6 @@ namespace AZ
|
||||
continue;
|
||||
}
|
||||
|
||||
// Filter out disabled passes for the PipelineStatistics window if necessary.
|
||||
if (!m_showDisabledPasses && !passEntry.IsPipelineStatisticsEnabled())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Filter out parent passes if necessary.
|
||||
if (!m_showParentPasses && passEntry.m_isParent)
|
||||
{
|
||||
@@ -230,6 +226,13 @@ namespace AZ
|
||||
// Start drawing the PipelineStatistics window.
|
||||
if (ImGui::Begin("PipelineStatistics Window", &draw, ImGuiWindowFlags_NoResize))
|
||||
{
|
||||
// Pause/unpause the profiling
|
||||
if (ImGui::Button(m_paused ? "Resume" : "Pause"))
|
||||
{
|
||||
m_paused = !m_paused;
|
||||
rootPass->SetPipelineStatisticsQueryEnabled(!m_paused);
|
||||
}
|
||||
|
||||
ImGui::Columns(2, "HeaderColumns");
|
||||
|
||||
// Draw the statistics of the RootPass.
|
||||
@@ -426,23 +429,16 @@ namespace AZ
|
||||
}
|
||||
|
||||
AZStd::string label;
|
||||
if (passEntry->IsPipelineStatisticsEnabled())
|
||||
if (rootEntry && m_showAttributeContribution)
|
||||
{
|
||||
if (rootEntry && m_showAttributeContribution)
|
||||
{
|
||||
label = AZStd::string::format("%llu (%u%%)",
|
||||
static_cast<AZ::u64>(passEntry->m_pipelineStatistics[attributeIdx]),
|
||||
static_cast<uint32_t>(normalized * 100.0f));
|
||||
}
|
||||
else
|
||||
{
|
||||
label = AZStd::string::format("%llu",
|
||||
static_cast<AZ::u64>(passEntry->m_pipelineStatistics[attributeIdx]));
|
||||
}
|
||||
label = AZStd::string::format("%llu (%u%%)",
|
||||
static_cast<AZ::u64>(passEntry->m_pipelineStatistics[attributeIdx]),
|
||||
static_cast<uint32_t>(normalized * 100.0f));
|
||||
}
|
||||
else
|
||||
{
|
||||
label = "-";
|
||||
label = AZStd::string::format("%llu",
|
||||
static_cast<AZ::u64>(passEntry->m_pipelineStatistics[attributeIdx]));
|
||||
}
|
||||
|
||||
if (rootEntry)
|
||||
@@ -523,7 +519,9 @@ namespace AZ
|
||||
|
||||
// --- ImGuiTimestampView ---
|
||||
|
||||
inline void ImGuiTimestampView::DrawTimestampWindow(bool& draw, const PassEntry* rootPassEntry, AZStd::unordered_map<Name, PassEntry>& timestampEntryDatabase)
|
||||
inline void ImGuiTimestampView::DrawTimestampWindow(
|
||||
bool& draw, const PassEntry* rootPassEntry, AZStd::unordered_map<Name, PassEntry>& timestampEntryDatabase,
|
||||
AZ::RHI::Ptr<RPI::ParentPass> rootPass)
|
||||
{
|
||||
// Early out if nothing is supposed to be drawn
|
||||
if (!draw)
|
||||
@@ -534,10 +532,28 @@ namespace AZ
|
||||
// Clear the references from the previous frame.
|
||||
m_passEntryReferences.clear();
|
||||
|
||||
// pass entry grid based on its timestamp
|
||||
AZStd::vector<PassEntry*> sortedPassEntries;
|
||||
AZStd::vector<AZStd::vector<PassEntry*>> sortedPassGrid;
|
||||
|
||||
// Set the child of the parent, only if it passes the filter.
|
||||
for (auto& passEntryIt : timestampEntryDatabase)
|
||||
{
|
||||
PassEntry* passEntry = &passEntryIt.second;
|
||||
|
||||
// Collect all pass entries with non-zero durations
|
||||
if (passEntry->m_timestampResult.GetDurationInTicks() > 0)
|
||||
{
|
||||
sortedPassEntries.push_back(passEntry);
|
||||
}
|
||||
|
||||
// Skip the pass if the pass' timestamp duration is 0
|
||||
if (m_hideZeroPasses && (!passEntry->m_isParent) && passEntry->m_timestampResult.GetDurationInTicks() == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Only add pass if it pass the filter.
|
||||
if (m_passFilter.PassFilter(passEntry->m_name.GetCStr()))
|
||||
{
|
||||
if (passEntry->m_parent && !passEntry->m_linked)
|
||||
@@ -545,19 +561,94 @@ namespace AZ
|
||||
passEntry->m_parent->LinkChild(passEntry);
|
||||
}
|
||||
|
||||
AZ_Assert(m_passEntryReferences.size() < TimestampEntryCount, "Too many PassEntry references. Increase the size of the array.");
|
||||
AZ_Assert(
|
||||
m_passEntryReferences.size() < TimestampEntryCount,
|
||||
"Too many PassEntry references. Increase the size of the array.");
|
||||
m_passEntryReferences.push_back(passEntry);
|
||||
}
|
||||
}
|
||||
|
||||
// Sort the pass entries based on their starting time and duration
|
||||
AZStd::sort(sortedPassEntries.begin(), sortedPassEntries.end(), [](const PassEntry* passEntry1, const PassEntry* passEntry2) {
|
||||
if (passEntry1->m_timestampResult.GetTimestampBeginInTicks() == passEntry2->m_timestampResult.GetTimestampBeginInTicks())
|
||||
{
|
||||
return passEntry1->m_timestampResult.GetDurationInTicks() < passEntry2->m_timestampResult.GetDurationInTicks();
|
||||
}
|
||||
return passEntry1->m_timestampResult.GetTimestampBeginInTicks() < passEntry2->m_timestampResult.GetTimestampBeginInTicks();
|
||||
});
|
||||
|
||||
// calculate the total GPU duration.
|
||||
RPI::TimestampResult gpuTimestamp;
|
||||
if (sortedPassEntries.size() > 0)
|
||||
{
|
||||
gpuTimestamp = sortedPassEntries.front()->m_timestampResult;
|
||||
gpuTimestamp.Add(sortedPassEntries.back()->m_timestampResult);
|
||||
}
|
||||
|
||||
// Add a pass to the pass grid which none of the pass's timestamp range won't overlap each other.
|
||||
// Search each row until the pass can be added to the end of row without overlap the previous one.
|
||||
for (auto& passEntry : sortedPassEntries)
|
||||
{
|
||||
auto row = sortedPassGrid.begin();
|
||||
for (; row != sortedPassGrid.end(); row++)
|
||||
{
|
||||
if (row->empty())
|
||||
{
|
||||
break;
|
||||
}
|
||||
auto last = (*row).back();
|
||||
if (passEntry->m_timestampResult.GetTimestampBeginInTicks() >=
|
||||
last->m_timestampResult.GetTimestampBeginInTicks() + last->m_timestampResult.GetDurationInTicks())
|
||||
{
|
||||
row->push_back(passEntry);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (row == sortedPassGrid.end())
|
||||
{
|
||||
sortedPassGrid.push_back();
|
||||
sortedPassGrid.back().push_back(passEntry);
|
||||
}
|
||||
}
|
||||
|
||||
// Refresh timestamp query
|
||||
bool needEnable = false;
|
||||
if (!m_paused)
|
||||
{
|
||||
if (m_refreshType == RefreshType::OncePerSecond)
|
||||
{
|
||||
auto now = AZStd::GetTimeNowMicroSecond();
|
||||
if (m_lastUpdateTimeMicroSecond == 0 || now - m_lastUpdateTimeMicroSecond > 1000000)
|
||||
{
|
||||
needEnable = true;
|
||||
m_lastUpdateTimeMicroSecond = now;
|
||||
}
|
||||
}
|
||||
else if (m_refreshType == RefreshType::Realtime)
|
||||
{
|
||||
needEnable = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (rootPass->IsTimestampQueryEnabled() != needEnable)
|
||||
{
|
||||
rootPass->SetTimestampQueryEnabled(needEnable);
|
||||
}
|
||||
|
||||
const ImVec2 windowSize(680.0f, 620.0f);
|
||||
ImGui::SetNextWindowSize(windowSize, ImGuiCond_Always);
|
||||
if (ImGui::Begin("Timestamp View", &draw, ImGuiWindowFlags_NoResize))
|
||||
{
|
||||
// Draw the header.
|
||||
{
|
||||
// Pause/unpause the profiling
|
||||
if (ImGui::Button(m_paused? "Resume":"Pause"))
|
||||
{
|
||||
m_paused = !m_paused;
|
||||
}
|
||||
|
||||
// Draw the frame time (GPU).
|
||||
const AZStd::string formattedTimestamp = FormatTimestampLabel(rootPassEntry->m_interpolatedTimestampInNanoseconds);
|
||||
const AZStd::string formattedTimestamp = FormatTimestampLabel(gpuTimestamp.GetDurationInNanoseconds());
|
||||
const AZStd::string headerFrameTime = AZStd::string::format("Total frame duration (GPU): %s", formattedTimestamp.c_str());
|
||||
ImGui::Text(headerFrameTime.c_str());
|
||||
|
||||
@@ -566,6 +657,17 @@ namespace AZ
|
||||
ImGui::SameLine();
|
||||
ImGui::RadioButton("Flat", reinterpret_cast<int32_t*>(&m_viewType), static_cast<int32_t>(ProfilerViewType::Flat));
|
||||
|
||||
// Draw the refresh option
|
||||
ImGui::RadioButton("Realtime", reinterpret_cast<int32_t*>(&m_refreshType), static_cast<int32_t>(RefreshType::Realtime));
|
||||
ImGui::SameLine();
|
||||
ImGui::RadioButton("Once Per Second", reinterpret_cast<int32_t*>(&m_refreshType), static_cast<int32_t>(RefreshType::OncePerSecond));
|
||||
|
||||
// Show/hide non-parent passes which have zero execution time
|
||||
ImGui::Checkbox("Hide Zero Cost Passes", &m_hideZeroPasses);
|
||||
|
||||
// Show/hide the timeline bar of all the passes which has non-zero execution time
|
||||
ImGui::Checkbox("Show Timeline", &m_showTimeline);
|
||||
|
||||
// Draw advanced options.
|
||||
const ImGuiTreeNodeFlags flags = ImGuiTreeNodeFlags_None;
|
||||
GpuProfilerImGuiHelper::TreeNode("Advanced options", flags, [this](bool unrolled)
|
||||
@@ -587,6 +689,56 @@ namespace AZ
|
||||
|
||||
ImGui::Separator();
|
||||
|
||||
// Draw the pass entry grid
|
||||
if (!sortedPassEntries.empty() && m_showTimeline)
|
||||
{
|
||||
const float passBarHeight = 20.f;
|
||||
const float passBarSpace = 3.f;
|
||||
float areaWidth = ImGui::GetContentRegionAvail().x - 20.f;
|
||||
|
||||
if (ImGui::BeginChild("Timeline", ImVec2(areaWidth, (passBarHeight + passBarSpace) * sortedPassGrid.size()), false))
|
||||
{
|
||||
// start tick and end tick for the area
|
||||
uint64_t areaStartTick = sortedPassEntries.front()->m_timestampResult.GetTimestampBeginInTicks();
|
||||
uint64_t areaEndTick = sortedPassEntries.back()->m_timestampResult.GetTimestampBeginInTicks() +
|
||||
sortedPassEntries.back()->m_timestampResult.GetDurationInTicks();
|
||||
uint64_t areaDurationInTicks = areaEndTick - areaStartTick;
|
||||
|
||||
float rowStartY = 0.f;
|
||||
for (auto& row : sortedPassGrid)
|
||||
{
|
||||
// row start y
|
||||
for (auto passEntry : row)
|
||||
{
|
||||
// button start and end
|
||||
float buttonStartX = (passEntry->m_timestampResult.GetTimestampBeginInTicks() - areaStartTick) * areaWidth /
|
||||
areaDurationInTicks;
|
||||
float buttonWidth = passEntry->m_timestampResult.GetDurationInTicks() * areaWidth / areaDurationInTicks;
|
||||
ImGui::SetCursorPosX(buttonStartX);
|
||||
ImGui::SetCursorPosY(rowStartY);
|
||||
|
||||
// Adds a button and the hover colors.
|
||||
ImGui::Button(passEntry->m_name.GetCStr(), ImVec2(buttonWidth, passBarHeight));
|
||||
|
||||
if (ImGui::IsItemHovered())
|
||||
{
|
||||
ImGui::BeginTooltip();
|
||||
ImGui::Text("Name: %s", passEntry->m_name.GetCStr());
|
||||
ImGui::Text("Path: %s", passEntry->m_path.GetCStr());
|
||||
ImGui::Text("Duration in ticks: %lu", passEntry->m_timestampResult.GetDurationInTicks());
|
||||
ImGui::Text("Duration in microsecond: %.3f us", passEntry->m_timestampResult.GetDurationInNanoseconds()/1000.f);
|
||||
ImGui::EndTooltip();
|
||||
}
|
||||
}
|
||||
|
||||
rowStartY += passBarHeight + passBarSpace;
|
||||
}
|
||||
}
|
||||
ImGui::EndChild();
|
||||
|
||||
ImGui::Separator();
|
||||
}
|
||||
|
||||
// Draw the timestamp view.
|
||||
{
|
||||
static const AZStd::array<const char*, static_cast<int32_t>(TimestampMetricUnit::Count)> MetricUnitText =
|
||||
@@ -713,20 +865,18 @@ namespace AZ
|
||||
const auto drawWorkloadBar = [this](const AZStd::string& entryTime, const PassEntry* entry)
|
||||
{
|
||||
ImGui::NextColumn();
|
||||
ImGui::Text(entryTime.c_str());
|
||||
ImGui::NextColumn();
|
||||
|
||||
// Only draw the workload bar when the entry is enabled.
|
||||
if (entry->IsTimestampEnabled())
|
||||
if (entry->m_isParent)
|
||||
{
|
||||
DrawFrameWorkloadBar(NormalizeFrameWorkload(entry->m_interpolatedTimestampInNanoseconds));
|
||||
ImGui::NextColumn();
|
||||
ImGui::NextColumn();
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui::ProgressBar(0.0f, ImVec2(-1.0f, 0.0f), "Disabled");
|
||||
ImGui::Text(entryTime.c_str());
|
||||
ImGui::NextColumn();
|
||||
DrawFrameWorkloadBar(NormalizeFrameWorkload(entry->m_interpolatedTimestampInNanoseconds));
|
||||
ImGui::NextColumn();
|
||||
}
|
||||
|
||||
ImGui::NextColumn();
|
||||
};
|
||||
|
||||
static const auto createHoverMarker = [](const char* text)
|
||||
@@ -800,23 +950,17 @@ namespace AZ
|
||||
// Draw the flat view.
|
||||
for (const PassEntry* entry : m_passEntryReferences)
|
||||
{
|
||||
if (entry->m_isParent)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
const AZStd::string entryTime = FormatTimestampLabel(entry->m_interpolatedTimestampInNanoseconds);
|
||||
|
||||
ImGui::Text(entry->m_name.GetCStr());
|
||||
ImGui::NextColumn();
|
||||
ImGui::Text(entryTime.c_str());
|
||||
ImGui::NextColumn();
|
||||
|
||||
// Only draw the workload bar if the entry is enabled.
|
||||
if (entry->IsTimestampEnabled())
|
||||
{
|
||||
DrawFrameWorkloadBar(NormalizeFrameWorkload(entry->m_interpolatedTimestampInNanoseconds));
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui::ProgressBar(0.0f, ImVec2(-1.0f, 0.0f), "Disabled");
|
||||
}
|
||||
|
||||
DrawFrameWorkloadBar(NormalizeFrameWorkload(entry->m_interpolatedTimestampInNanoseconds));
|
||||
ImGui::NextColumn();
|
||||
}
|
||||
}
|
||||
@@ -890,23 +1034,33 @@ namespace AZ
|
||||
// Update the PassEntry database.
|
||||
const PassEntry* rootPassEntryRef = CreatePassEntries(rootPass);
|
||||
|
||||
bool wasDraw = draw;
|
||||
|
||||
GpuProfilerImGuiHelper::Begin("Gpu Profiler", &draw, ImGuiWindowFlags_NoResize, [this, &rootPass]()
|
||||
{
|
||||
ImGui::Checkbox("Enable TimestampView", &m_drawTimestampView);
|
||||
if (ImGui::Checkbox("Enable TimestampView", &m_drawTimestampView))
|
||||
{
|
||||
rootPass->SetTimestampQueryEnabled(m_drawTimestampView);
|
||||
}
|
||||
ImGui::Spacing();
|
||||
ImGui::Checkbox("Enable PipelineStatisticsView", &m_drawPipelineStatisticsView);
|
||||
if(ImGui::Checkbox("Enable PipelineStatisticsView", &m_drawPipelineStatisticsView))
|
||||
{
|
||||
rootPass->SetPipelineStatisticsQueryEnabled(m_drawPipelineStatisticsView);
|
||||
}
|
||||
});
|
||||
|
||||
// Draw the PipelineStatistics window.
|
||||
m_timestampView.DrawTimestampWindow(m_drawTimestampView, rootPassEntryRef, m_passEntryDatabase);
|
||||
m_timestampView.DrawTimestampWindow(m_drawTimestampView, rootPassEntryRef, m_passEntryDatabase, rootPass);
|
||||
|
||||
// Draw the PipelineStatistics window.
|
||||
m_pipelineStatisticsView.DrawPipelineStatisticsWindow(m_drawPipelineStatisticsView, rootPassEntryRef, m_passEntryDatabase);
|
||||
m_pipelineStatisticsView.DrawPipelineStatisticsWindow(m_drawPipelineStatisticsView, rootPassEntryRef, m_passEntryDatabase, rootPass);
|
||||
|
||||
// [GFX TODO][ATOM-13792] Optimization: ImGui GpuProfiler Pass hierarchy traversal.
|
||||
// Enable/Disable the Timestamp and PipelineStatistics on the RootPass
|
||||
rootPass->SetTimestampQueryEnabled(draw && m_drawTimestampView);
|
||||
rootPass->SetPipelineStatisticsQueryEnabled(draw && m_drawPipelineStatisticsView);
|
||||
//closing window
|
||||
if (wasDraw && !draw)
|
||||
{
|
||||
rootPass->SetTimestampQueryEnabled(false);
|
||||
rootPass->SetPipelineStatisticsQueryEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
inline void ImGuiGpuProfiler::InterpolatePassEntries(AZStd::unordered_map<Name, PassEntry>& passEntryDatabase, float weight) const
|
||||
@@ -918,7 +1072,7 @@ namespace AZ
|
||||
{
|
||||
// Interpolate the timestamps.
|
||||
const double interpolated = Lerp(static_cast<double>(oldEntryIt->second.m_interpolatedTimestampInNanoseconds),
|
||||
static_cast<double>(entry.second.m_timestampResult.GetTimestampInNanoseconds()),
|
||||
static_cast<double>(entry.second.m_timestampResult.GetDurationInNanoseconds()),
|
||||
static_cast<double>(weight));
|
||||
entry.second.m_interpolatedTimestampInNanoseconds = static_cast<uint64_t>(interpolated);
|
||||
}
|
||||
|
||||
+2
-1
@@ -54,8 +54,9 @@ namespace AZ
|
||||
RPI::SceneDescriptor sceneDesc;
|
||||
sceneDesc.m_featureProcessorNames.push_back("AZ::Render::TransformServiceFeatureProcessor");
|
||||
sceneDesc.m_featureProcessorNames.push_back("AZ::Render::MeshFeatureProcessor");
|
||||
sceneDesc.m_featureProcessorNames.push_back("AZ::Render::SimplePointLightFeatureProcessor");
|
||||
sceneDesc.m_featureProcessorNames.push_back("AZ::Render::SimpleSpotLightFeatureProcessor");
|
||||
sceneDesc.m_featureProcessorNames.push_back("AZ::Render::PointLightFeatureProcessor");
|
||||
sceneDesc.m_featureProcessorNames.push_back("AZ::Render::SpotLightFeatureProcessor");
|
||||
// There is currently a bug where having multiple DirectionalLightFeatureProcessors active can result in shadow flickering [ATOM-13568]
|
||||
// as well as continually rebuilding MeshDrawPackets [ATOM-13633]. Lets just disable the directional light FP for now.
|
||||
// Possibly re-enable with [GFX TODO][ATOM-13639]
|
||||
|
||||
@@ -179,7 +179,7 @@ namespace Blast
|
||||
|
||||
void EditorBlastMeshDataComponent::RegisterModel()
|
||||
{
|
||||
if (m_meshFeatureProcessor && m_meshAssets[0].GetId().IsValid())
|
||||
if (m_meshFeatureProcessor && !m_meshAssets.empty() && m_meshAssets[0].GetId().IsValid())
|
||||
{
|
||||
AZ::Render::MaterialAssignmentMap materials;
|
||||
AZ::Render::MaterialComponentRequestBus::EventResult(
|
||||
|
||||
@@ -222,6 +222,10 @@ void ImGuiManager::Initialize()
|
||||
io.DisplaySize.x = 1920;
|
||||
io.DisplaySize.y = 1080;
|
||||
|
||||
// Create a default font
|
||||
io.Fonts->AddFontDefault();
|
||||
io.Fonts->Build();
|
||||
|
||||
// Broadcast ImGui Ready to Listeners
|
||||
ImGuiUpdateListenerBus::Broadcast(&IImGuiUpdateListener::OnImGuiInitialize);
|
||||
m_currentControllerIndex = -1;
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace WhiteBox
|
||||
|
||||
// specify the data format for vertex stream data
|
||||
AZ::RHI::BufferDescriptor bufferDescriptor;
|
||||
bufferDescriptor.m_bindFlags = AZ::RHI::BufferBindFlags::InputAssembly;
|
||||
bufferDescriptor.m_bindFlags = AZ::RHI::BufferBindFlags::InputAssembly | AZ::RHI::BufferBindFlags::ShaderRead;
|
||||
bufferDescriptor.m_byteCount = bufferSize;
|
||||
bufferDescriptor.m_alignment = elementSize;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ else()
|
||||
file(READ "${CMAKE_CURRENT_LIST_DIR}/project.json" project_json)
|
||||
|
||||
string(JSON project_target_name ERROR_VARIABLE json_error GET ${project_json} "project_name")
|
||||
if(${json_error})
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read key 'project_name' from 'project.json'")
|
||||
endif()
|
||||
|
||||
|
||||
@@ -213,8 +213,14 @@ function(ly_add_test)
|
||||
add_custom_target(${unaliased_test_name} COMMAND ${CMAKE_COMMAND} -E true ${args_TEST_COMMAND} ${args_TEST_ARGUMENTS})
|
||||
|
||||
file(RELATIVE_PATH project_path ${LY_ROOT_FOLDER} ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
set(ide_path ${project_path})
|
||||
# Visual Studio doesn't support a folder layout that starts with ".."
|
||||
# So strip away the parent directory of a relative path
|
||||
if (${project_path} MATCHES [[^(\.\./)+(.*)]])
|
||||
set(ide_path "${CMAKE_MATCH_2}")
|
||||
endif()
|
||||
set_target_properties(${unaliased_test_name} PROPERTIES
|
||||
FOLDER "${project_path}"
|
||||
FOLDER "${ide_path}"
|
||||
VS_DEBUGGER_COMMAND ${test_command}
|
||||
VS_DEBUGGER_COMMAND_ARGUMENTS "${test_arguments_line}"
|
||||
)
|
||||
|
||||
Vendored
+9
-4
@@ -214,6 +214,11 @@ def CheckoutBootstrapScripts(String branchName) {
|
||||
}
|
||||
|
||||
def CheckoutRepo(boolean disableSubmodules = false) {
|
||||
|
||||
if (!fileExists(ENGINE_REPOSITORY_NAME)) {
|
||||
palMkdir(ENGINE_REPOSITORY_NAME)
|
||||
}
|
||||
|
||||
palSh('git lfs uninstall', 'Git LFS Uninstall') // Prevent git from pulling lfs objects during checkout
|
||||
|
||||
if(fileExists('.git')) {
|
||||
@@ -270,7 +275,7 @@ def PreBuildCommonSteps(Map pipelineConfig, String projectName, String pipeline,
|
||||
if(env.IS_UNIX) pythonCmd = 'sudo -E python -u '
|
||||
else pythonCmd = 'python -u '
|
||||
|
||||
if(env.RECREATE_VOLUME.toBoolean()) {
|
||||
if(env.RECREATE_VOLUME?.toBoolean()) {
|
||||
palSh("${pythonCmd} ${INCREMENTAL_BUILD_SCRIPT_PATH} --action delete --project ${projectName} --pipeline ${pipeline} --branch ${branchName} --platform ${platform} --build_type ${buildType}", 'Deleting volume')
|
||||
}
|
||||
timeout(5) {
|
||||
@@ -291,7 +296,7 @@ def PreBuildCommonSteps(Map pipelineConfig, String projectName, String pipeline,
|
||||
|
||||
// Cleanup previous repo location, we are currently at the root of the workspace, if we have a .git folder
|
||||
// we need to cleanup. Once all branches take this relocation, we can remove this
|
||||
if(env.CLEAN_WORKSPACE.toBoolean() || fileExists("${workspace}/.git")) {
|
||||
if(env.CLEAN_WORKSPACE?.toBoolean() || fileExists("${workspace}/.git")) {
|
||||
if(fileExists(workspace)) {
|
||||
palRmDir(workspace)
|
||||
}
|
||||
@@ -315,7 +320,7 @@ def PreBuildCommonSteps(Map pipelineConfig, String projectName, String pipeline,
|
||||
script: 'python/get_python.bat'
|
||||
}
|
||||
|
||||
if(env.CLEAN_OUTPUT_DIRECTORY.toBoolean() || env.CLEAN_ASSETS.toBoolean()) {
|
||||
if(env.CLEAN_OUTPUT_DIRECTORY?.toBoolean() || env.CLEAN_ASSETS?.toBoolean()) {
|
||||
def command = "${pipelineConfig.BUILD_ENTRY_POINT} --platform ${platform} --type clean"
|
||||
if (env.IS_UNIX) {
|
||||
sh label: "Running ${platform} clean",
|
||||
@@ -457,7 +462,7 @@ try {
|
||||
}
|
||||
}
|
||||
|
||||
if(env.BUILD_NUMBER == '1') {
|
||||
if(env.BUILD_NUMBER == '1' && !branchName.startsWith('PR-')) {
|
||||
// Exit pipeline early on the intial build. This allows Jenkins to load the pipeline for the branch and enables users
|
||||
// to select build parameters on their first actual build. See https://issues.jenkins.io/browse/JENKINS-41929
|
||||
currentBuild.result = 'SUCCESS'
|
||||
|
||||
@@ -281,5 +281,19 @@
|
||||
"CMAKE_TARGET": "ALL_BUILD",
|
||||
"CMAKE_NATIVE_BUILD_ARGS": "/m /nologo"
|
||||
}
|
||||
},
|
||||
"install_profile_vs2019": {
|
||||
"TAGS": [
|
||||
"nightly"
|
||||
],
|
||||
"COMMAND": "build_windows.cmd",
|
||||
"PARAMETERS": {
|
||||
"CONFIGURATION": "profile",
|
||||
"OUTPUT_DIRECTORY": "build\\windows_vs2019",
|
||||
"CMAKE_OPTIONS": "-G \"Visual Studio 16 2019\" -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=TRUE -DCMAKE_INSTALL_PREFIX=build\\install",
|
||||
"CMAKE_LY_PROJECTS": "",
|
||||
"CMAKE_TARGET": "INSTALL",
|
||||
"CMAKE_NATIVE_BUILD_ARGS": "/m /nologo"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user